Floating-point types v0.1.0

Source
The floating-point types float8 to float512, with their width, limit and special-value constants. The built-in float is float64 and shares its constants.

float8

extend float8

An eight-bit E4M3 floating-point number with IEEE 754 infinities and NaNs.

Source

Constants

Bits

pub const Bits: uint = 8;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 1;

The number of bytes in the representation.

Source

Lowest

pub const Lowest: float8 = -240.0f8;

The lowest finite value.

Source

Max

pub const Max: float8 = 240.0f8;

The highest finite value.

Source

MinPositive

pub const MinPositive: float8 = 0.015625f8;

The smallest positive normal value.

Source

Epsilon

pub const Epsilon: float8 = 0.125f8;

The difference between one and the next representable value.

Source

Infinity

pub const Infinity: float8;

Positive infinity.

Source

NaN

pub const NaN: float8;

A quiet not-a-number value.

Source

float16

extend float16

An IEEE 754 binary16 floating-point number.

Source

Constants

Bits

pub const Bits: uint = 16;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 2;

The number of bytes in the representation.

Source

Lowest

pub const Lowest: float16 = -65504.0f16;

The lowest finite value.

Source

Max

pub const Max: float16 = 65504.0f16;

The highest finite value.

Source

MinPositive

pub const MinPositive: float16 = 6.103515625e-05f16;

The smallest positive normal value.

Source

Epsilon

pub const Epsilon: float16 = 0.0009765625f16;

The difference between one and the next representable value.

Source

Infinity

pub const Infinity: float16;

Positive infinity.

Source

NaN

pub const NaN: float16;

A quiet not-a-number value.

Source

float32

extend float32

An IEEE 754 binary32 floating-point number.

Source

Constants

Bits

pub const Bits: uint = 32;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 4;

The number of bytes in the representation.

Source

Lowest

pub const Lowest: float32 = -3.4028234663852886e+38f32;

The lowest finite value.

Source

Max

pub const Max: float32 = 3.4028234663852886e+38f32;

The highest finite value.

Source

MinPositive

pub const MinPositive: float32 = 1.1754943508222875e-38f32;

The smallest positive normal value.

Source

Epsilon

pub const Epsilon: float32 = 1.1920928955078125e-7f32;

The difference between one and the next representable value.

Source

Infinity

pub const Infinity: float32;

Positive infinity.

Source

NaN

pub const NaN: float32;

A quiet not-a-number value.

Source

float64

extend float64

An IEEE 754 binary64 floating-point number.

Source

Constants

Bits

pub const Bits: uint = 64;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 8;

The number of bytes in the representation.

Source

Lowest

pub const Lowest: float64 = -1.7976931348623157e+308f64;

The lowest finite value.

Source

Max

pub const Max: float64 = 1.7976931348623157e+308f64;

The highest finite value.

Source

MinPositive

pub const MinPositive: float64 = 2.2250738585072014e-308f64;

The smallest positive normal value.

Source

Epsilon

pub const Epsilon: float64 = 2.2204460492503131e-16f64;

The difference between one and the next representable value.

Source

Infinity

pub const Infinity: float64;

Positive infinity.

Source

NaN

pub const NaN: float64;

A quiet not-a-number value.

Source

float80

extend float80

An x87 extended-precision floating-point number.

Source

Constants

Bits

pub const Bits: uint = 80;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 16;

The number of bytes in the representation.

Source

Lowest

pub const Lowest: float80;

The lowest finite value.

Source

Max

pub const Max: float80;

The highest finite value.

Source

MinPositive

pub const MinPositive: float80;

The smallest positive normal value.

Source

Epsilon

pub const Epsilon: float80;

The difference between one and the next representable value.

Source

Infinity

pub const Infinity: float80;

Positive infinity.

Source

NaN

pub const NaN: float80;

A quiet not-a-number value.

Source

float128

extend float128

An IEEE 754 binary128 floating-point number.

Source

Constants

Bits

pub const Bits: uint = 128;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 16;

The number of bytes in the representation.

Source

Lowest

pub const Lowest: float128;

The lowest finite value.

Source

Max

pub const Max: float128;

The highest finite value.

Source

MinPositive

pub const MinPositive: float128;

The smallest positive normal value.

Source

Epsilon

pub const Epsilon: float128;

The difference between one and the next representable value.

Source

Infinity

pub const Infinity: float128;

Positive infinity.

Source

NaN

pub const NaN: float128;

A quiet not-a-number value.

Source

float256

extend float256

An IEEE 754 binary256 floating-point number.

Source

Constants

Bits

pub const Bits: uint = 256;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 32;

The number of bytes in the representation.

Source

Lowest

pub const Lowest: float256;

The lowest finite value.

Source

Max

pub const Max: float256;

The highest finite value.

Source

MinPositive

pub const MinPositive: float256;

The smallest positive normal value.

Source

Epsilon

pub const Epsilon: float256;

The difference between one and the next representable value.

Source

Infinity

pub const Infinity: float256;

Positive infinity.

Source

NaN

pub const NaN: float256;

A quiet not-a-number value.

Source

float512

extend float512

A binary512 floating-point number in the IEEE 754 interchange-format progression.

Source

Constants

Bits

pub const Bits: uint = 512;

The number of bits in the representation.

Source

Bytes

pub const Bytes: uint = 64;

The number of bytes in the representation.

Source

Lowest

pub const Lowest: float512;

The lowest finite value.

Source

Max

pub const Max: float512;

The highest finite value.

Source

MinPositive

pub const MinPositive: float512;

The smallest positive normal value.

Source

Epsilon

pub const Epsilon: float512;

The difference between one and the next representable value.

Source

Infinity

pub const Infinity: float512;

Positive infinity.

Source

NaN

pub const NaN: float512;

A quiet not-a-number value.

Source