(data-types)=
Array API specification for supported data types.
A conforming implementation of the array API standard must provide and support the following data types.
Boolean (True or False).
An 8-bit signed integer whose values exist on the interval [-128, +127].
A 16-bit signed integer whose values exist on the interval [−32,767, +32,767].
A 32-bit signed integer whose values exist on the interval [−2,147,483,647, +2,147,483,647].
A 64-bit signed integer whose values exist on the interval [−9,223,372,036,854,775,807, +9,223,372,036,854,775,807].
An 8-bit unsigned integer whose values exist on the interval [0, +255].
A 16-bit unsigned integer whose values exist on the interval [0, +65,535].
A 32-bit unsigned integer whose values exist on the interval [0, +4,294,967,295].
A 64-bit unsigned integer whose values exist on the interval [0, +18,446,744,073,709,551,615].
IEEE 754 single-precision (32-bit) binary floating-point number (see IEEE 754-2019).
IEEE 754 double-precision (64-bit) binary floating-point number (see IEEE 754-2019).
:::{admonition} Future extension
:class: hint
complex64 and complex128 dtypes 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):
See array-api/issues/102 for more details. :::
Data types ("dtypes") are objects that can be used as `dtype` specifiers in functions and methods (e.g., `zeros((2, 3), dtype=float32)`). A conforming implementation may add methods or attributes to data type objects; however, these methods and attributes are not included in this specification.
Implementations may provide other ways to specify data types (e.g.,
`zeros((2, 3), dtype='f4')`); however, these are not included in this specification.
A conforming implementation of the array API standard may provide and support additional data types beyond those described in this specification.
(data-type-defaults)=
A conforming implementation of the array API standard must define a default floating-point data type (either float32 or float64) and a default integer data type (int32 or int64).
The default data types must be the same across platforms.
The default integer data type may vary depending on whether Python is 32-bit or 64-bit.
The default floating-point and integer data types should be clearly defined in a conforming library's documentation.
(data-type-categories)=
For the purpose of organizing functions within this specification, the following data type categories are defined.
Conforming libraries are not required to organize dtypes according to these categories. These
categories are only intended for use within this specification.
Future versions of the specification will include additional categories for
complex data types.
int8, int16, int32, int64, uint8, uint16, uint32,
uint64, float32, and float64 (i.e., all dtypes except for bool).
int8, int16, int32, int64, uint8, uint16, uint32, and
uint64.
float32 and float64.
bool.
