FixedBinary.atScale

Result!(FixedBinary!(I, Bits), FixedBinaryError) atScale(int Bits)( RoundingMode mode = RoundingMode.NEAREST_EVEN) const @safe pure nothrow @nogc

Re-scales to a different fraction-bit count over the same storage. Growing is exact and checked; reducing rounds per mode.

Parameters

Bitsthe target fraction-bit count.
modehow discarded bits round when reducing.

Returns

The re-scaled value, or FixedBinaryError with OUT_OF_RANGE

when the value (after rounding) does not fit the target scale.