Skip to content

Commit 67ab474

Browse files
authored
Complex dtype support in finfo() (data-apis#484)
1 parent eba54b3 commit 67ab474

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

spec/API_specification/array_api/data_type_functions.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,15 @@ def can_cast(from_: Union[dtype, array], to: dtype, /) -> bool:
4646

4747
def finfo(type: Union[dtype, array], /) -> finfo_object:
4848
"""
49-
Machine limits for real-valued floating-point data types.
49+
Machine limits for floating-point data types.
5050
5151
Parameters
5252
----------
5353
type: Union[dtype, array]
54-
the kind of real-valued floating-point data-type about which to get information.
54+
the kind of floating-point data-type about which to get information. If complex, the information is about its component data type.
55+
56+
.. note::
57+
Complex floating-point data types are specified to always use the same precision for both its real and imaginary components, so the information should be true for either component.
5558
5659
Returns
5760
-------
@@ -60,23 +63,23 @@ def finfo(type: Union[dtype, array], /) -> finfo_object:
6063
6164
- **bits**: *int*
6265
63-
number of bits occupied by the floating-point data type.
66+
number of bits occupied by the real-valued floating-point data type.
6467
6568
- **eps**: *float*
6669
67-
difference between 1.0 and the next smallest representable floating-point number larger than 1.0 according to the IEEE-754 standard.
70+
difference between 1.0 and the next smallest representable real-valued floating-point number larger than 1.0 according to the IEEE-754 standard.
6871
6972
- **max**: *float*
7073
71-
largest representable number.
74+
largest representable real-valued number.
7275
7376
- **min**: *float*
7477
75-
smallest representable number.
78+
smallest representable real-valued number.
7679
7780
- **smallest_normal**: *float*
7881
79-
smallest positive floating-point number with full precision.
82+
smallest positive real-valued floating-point number with full precision.
8083
"""
8184

8285
def iinfo(type: Union[dtype, array], /) -> iinfo_object:

0 commit comments

Comments
 (0)