From bcbaaeb772d4848d6501e874f9fe0885bef6c938 Mon Sep 17 00:00:00 2001 From: Andrew Cumming Date: Fri, 1 Sep 2023 18:17:53 -0400 Subject: [PATCH] Adds an example to floats.md --- floats.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/floats.md b/floats.md index e1f4858..200b9c9 100644 --- a/floats.md +++ b/floats.md @@ -95,9 +95,12 @@ Here are some things to try to investigate NumPy data types: - `np.single(2.2) + np.single(1.1) - np.single(3.3)` - `np.int_(2) ** 10; 2**10` - `np.int_(2) ** 100; 2**100` +- `np.spacing(3.0)` ``` -Note that numpy integers do not behave like python integers! They have a fixed size in bytes (and therefore maximum and minimum values), whereas Python integers are objects that adapt their size to the precision needed. +The last example is one of several functions that NumPy has for dealing with floats --- see https://numpy.org/doc/stable/reference/routines.math.html + +Note that numpy integers do not behave like Python integers! They have a fixed size in bytes (and therefore maximum and minimum values), whereas Python integers are objects that adapt their size to the precision needed.