summaryrefslogtreecommitdiff
path: root/numpy/core/getlimits.py
diff options
context:
space:
mode:
authorMatteo Raso <33975162+MatteoRaso@users.noreply.github.com>2022-09-27 04:19:17 -0400
committerGitHub <noreply@github.com>2022-09-27 10:19:17 +0200
commit9c5a2b41cc0ade160a01b7423630f7ee1b8e63dc (patch)
tree9c72189d1c4922f1367f27941f02d37351283d11 /numpy/core/getlimits.py
parenteed6083381dbcaf7bba4638945a1c06275f56431 (diff)
downloadnumpy-9c5a2b41cc0ade160a01b7423630f7ee1b8e63dc.tar.gz
DOC: Added missing dtype attribute to `iinfo` and `finfo` docstring (#22334)
finfo() and iinfo() both have a dtype attribute, which was undocumented before this commit. [skip azp] [skip actions] Co-authored-by: Ralf Gommers <ralf.gommers@gmail.com>
Diffstat (limited to 'numpy/core/getlimits.py')
-rw-r--r--numpy/core/getlimits.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/numpy/core/getlimits.py b/numpy/core/getlimits.py
index b6f65f848..2c0f462cc 100644
--- a/numpy/core/getlimits.py
+++ b/numpy/core/getlimits.py
@@ -372,6 +372,10 @@ class finfo:
----------
bits : int
The number of bits occupied by the type.
+ dtype : dtype
+ Returns the dtype for which `finfo` returns information. For complex
+ input, the returned dtype is the associated ``float*`` dtype for its
+ real and complex components.
eps : float
The difference between 1.0 and the next smallest representable float
larger than 1.0. For example, for 64-bit binary floats in the IEEE-754
@@ -457,6 +461,14 @@ class finfo:
pp.1-70, 2008, http://www.doi.org/10.1109/IEEESTD.2008.4610935
.. [2] Wikipedia, "Denormal Numbers",
https://en.wikipedia.org/wiki/Denormal_number
+
+ Examples
+ --------
+ >>> np.finfo(np.float64).dtype
+ dtype('float64')
+ >>> np.finfo(np.complex64).dtype
+ dtype('float32')
+
"""
_finfo_cache = {}
@@ -609,6 +621,8 @@ class iinfo:
----------
bits : int
The number of bits occupied by the type.
+ dtype : dtype
+ Returns the dtype for which `iinfo` returns information.
min : int
The smallest integer expressible by the type.
max : int