summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2022-09-18 11:51:21 -0400
committerGitHub <noreply@github.com>2022-09-18 11:51:21 -0400
commitd6586b97a3b5d23832e729b098de0fa023246e9c (patch)
tree3c9d7caeb1d86568a6acc89c2e42072261e6f5c5
parent49cd617cc96c92ea37a36fc2318b28423d880b92 (diff)
parente792e6c58241b6e1576c3002a076b96e9f8ff21e (diff)
downloadnumpy-d6586b97a3b5d23832e729b098de0fa023246e9c.tar.gz
Merge pull request #22263 from MatteoRaso/finfo_complex
DOC: Clarified how finfo works with complex numbers (#22260)
-rw-r--r--numpy/core/getlimits.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/core/getlimits.py b/numpy/core/getlimits.py
index 4149a5303..b6f65f848 100644
--- a/numpy/core/getlimits.py
+++ b/numpy/core/getlimits.py
@@ -423,7 +423,8 @@ class finfo:
Parameters
----------
dtype : float, dtype, or instance
- Kind of floating point data-type about which to get information.
+ Kind of floating point or complex floating point
+ data-type about which to get information.
See Also
--------
@@ -445,6 +446,11 @@ class finfo:
fill the gap between 0 and ``smallest_normal``. However, subnormal numbers
may have significantly reduced precision [2]_.
+ This function can also be used for complex data types as well. If used,
+ the output will be the same as the corresponding real float type
+ (e.g. numpy.finfo(numpy.csingle) is the same as numpy.finfo(numpy.single)).
+ However, the output is true for the real and imaginary components.
+
References
----------
.. [1] IEEE Standard for Floating-Point Arithmetic, IEEE Std 754-2008,