pub enum DType {
Show 14 variants
I8,
I16,
I32,
I64,
I128,
U8,
U16,
U32,
U64,
U128,
F16,
F32,
F64,
F128,
}Expand description
Declared numeric representation, independent of the host architecture.
Variants§
I8
Signed 8-bit integer, from -128 through 127; checked arithmetic.
I16
Signed 16-bit integer, from -32768 through 32767; checked arithmetic.
I32
Signed 32-bit integer, from -2147483648 through 2147483647; checked arithmetic.
I64
Signed 64-bit integer, from -9223372036854775808 through 9223372036854775807; checked arithmetic.
I128
Signed 128-bit integer, from -170141183460469231731687303715884105728 through 170141183460469231731687303715884105727; checked arithmetic.
U8
Unsigned 8-bit integer, from 0 through 255; checked arithmetic.
U16
Unsigned 16-bit integer, from 0 through 65535; checked arithmetic.
U32
Unsigned 32-bit integer, from 0 through 4294967295; checked arithmetic.
U64
Unsigned 64-bit integer, from 0 through 18446744073709551615; checked arithmetic.
U128
Unsigned 128-bit integer, from 0 through 340282366920938463463374607431768211455; checked arithmetic.
F16
IEEE binary16: 11 significand bits, normal exponents -14 through 15, subnormals through 2^-24. Finite values only; ties-to-even rounding.
F32
IEEE binary32: 24 significand bits, normal exponents -126 through 127, subnormals through 2^-149. Finite values only; ties-to-even rounding.
F64
IEEE binary64: 53 significand bits, normal exponents -1022 through 1023, subnormals through 2^-1074. Finite values only; ties-to-even rounding.
F128
IEEE binary128: 113 significand bits, normal exponents -16382 through 16383, subnormals through 2^-16494. Portable software arithmetic retains all 128 bits. Finite values only; ties-to-even rounding.
Implementations§
Source§impl DType
impl DType
Sourcepub const ALL: [Self; 14]
pub const ALL: [Self; 14]
All supported numeric representations in signed, unsigned, float order.
Sourcepub const fn documentation(self) -> &'static str
pub const fn documentation(self) -> &'static str
Representation contract used by generated reference documentation.
Sourcepub const fn byte_width(self) -> usize
pub const fn byte_width(self) -> usize
Number of bytes in one packed element.