Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complex dtype support in finfo() #484

Merged
merged 2 commits into from
Oct 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions spec/API_specification/array_api/data_type_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@ def can_cast(from_: Union[dtype, array], to: dtype, /) -> bool:

def finfo(type: Union[dtype, array], /) -> finfo_object:
"""
Machine limits for real-valued floating-point data types.
Machine limits for floating-point data types.

Parameters
----------
type: Union[dtype, array]
the kind of real-valued floating-point data-type about which to get information.
the kind of floating-point data-type about which to get information. If complex, the information is about its component data type.

.. note::
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.

Returns
-------
Expand All @@ -60,23 +63,23 @@ def finfo(type: Union[dtype, array], /) -> finfo_object:

- **bits**: *int*

number of bits occupied by the floating-point data type.
number of bits occupied by the real-valued floating-point data type.

- **eps**: *float*

difference between 1.0 and the next smallest representable floating-point number larger than 1.0 according to the IEEE-754 standard.
difference between 1.0 and the next smallest representable real-valued floating-point number larger than 1.0 according to the IEEE-754 standard.

- **max**: *float*

largest representable number.
largest representable real-valued number.

- **min**: *float*

smallest representable number.
smallest representable real-valued number.

- **smallest_normal**: *float*

smallest positive floating-point number with full precision.
smallest positive real-valued floating-point number with full precision.
"""

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