getNaNPayload

Extracts the current payload from a NaN value Note: These functions do not check if x is truly a NaN value before extracting the payload. Using them on finite values will extract a part of the coefficient

  1. uint getNaNPayload(decimal32 x)
  2. ulong getNaNPayload(decimal64 x)
    @nogc nothrow pure @safe
    ulong
    getNaNPayload
    (
    const decimal64 x
    )
  3. ulong getNaNPayload(decimal128 x, ulong payloadHi)

Examples

decimal32 x = decimal32("nan(123)");
decimal64 y = decimal64("nan(456)");
decimal128 z = decimal128("nan(789)");

assert (getNaNPayload(x) == 123);
assert (getNaNPayload(y) == 456);
ulong hi;
assert (getNaNPayload(z, hi) == 789 && hi == 0);

Meta