FixedBinary.fromDouble

Result!(FixedBinary, FixedBinaryError) fromDouble(double value, RoundingMode mode = RoundingMode.NEAREST_EVEN) static @safe pure nothrow @nogc

Converts a finite double, rounded to the nearest representable value per mode (default NEAREST_EVEN; use HALF_AWAY to match the tested Wayland 1.26.0 conversion). The scaling is exact, so ties are decided exactly.

Parameters

valuethe floating-point value.
modehow sub-quantum remainders round.

Returns

The converted value, or FixedBinaryError with

INVALID_INPUT for NaN and ±infinity and OUT_OF_RANGE when the rounded value does not fit the storage.