Skip to content

Add note concerning subnormal numbers #341

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

Merged
merged 1 commit into from
Dec 6, 2021
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
13 changes: 9 additions & 4 deletions spec/API_specification/data_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,19 @@ IEEE 754 single-precision (32-bit) binary floating-point number (see IEEE 754-20

IEEE 754 double-precision (64-bit) binary floating-point number (see IEEE 754-2019).

```{note}
IEEE 754-2019 requires support for subnormal (a.k.a., denormal) numbers, which are useful for supporting gradual underflow. However, hardware support for subnormal numbers is not universal, and many platforms (e.g., accelerators) and compilers support toggling denormals-are-zero (DAZ) and/or flush-to-zero (FTZ) behavior to increase performance and to guard against timing attacks.

Accordingly, subnormal behavior is left unspecified and, thus, implementation-defined. Conforming implementations may vary in their support for subnormal numbers.
```

:::{admonition} Future extension
:class: hint
`complex64` and `complex128` dtypes are expected to be included in the next
`complex64` and `complex128` data types are expected to be included in the next
version of this standard and to have the following casting rules (will be added
to {ref}`type-promotion`):

![Type promotion diagram for complex dtypes in next version](/_static/images/dtype_promotion_complex.png)
![Type promotion diagram for complex data types in next version](/_static/images/dtype_promotion_complex.png)

See [array-api/issues/102](https://github.com/data-apis/array-api/issues/102)
for more details.
Expand Down Expand Up @@ -132,7 +137,7 @@ The default data types should be clearly defined in a conforming library's docum
For the purpose of organizing functions within this specification, the following data type categories are defined.

```{note}
Conforming libraries are not required to organize dtypes according to these categories. These
Conforming libraries are not required to organize data types according to these categories. These
categories are only intended for use within this specification.
```

Expand All @@ -144,7 +149,7 @@ complex data types.
### Numeric Data Types

`int8`, `int16`, `int32`, `int64`, `uint8`, `uint16`, `uint32`,
`uint64`, `float32`, and `float64` (i.e., all dtypes except for `bool`).
`uint64`, `float32`, and `float64` (i.e., all data types except for `bool`).

### Integer Data Types

Expand Down