proptest::num::f32

Constant QUIET_NAN

source
pub const QUIET_NAN: Any;
Expand description

Generates “Quiet NaN” floats.

Operations on quiet NaNs generally simply propagate the NaN rather than invoke any exception mechanism.

The payload of the NaN is uniformly distributed over the possible values which safe Rust allows, including the sign bit (as controlled by POSITIVE and NEGATIVE).

Note however that in Rust 1.23.0 and earlier, this constitutes only one particular payload due to apparent issues with particular MIPS and PA-RISC processors which fail to implement IEEE 754-2008 correctly.

On Rust 1.24.0 and later, this does produce arbitrary payloads as documented.

On platforms where the CPU and the IEEE standard disagree on the format of a quiet NaN, values generated conform to the hardware’s expectations.