FixedBinaryError with OUT_OF_RANGE when
it does not fit the target.
Result!(FixedBinary!(I, Bits), FixedBinaryError) toBinary(I, int Bits, S, int Sc)(
FixedDecimal!(S, Sc) value, RoundingMode mode = RoundingMode.NEAREST_EVEN) @safe pureConverts a decimal fixed-point value to the binary family, rounding per mode (exact rational conversion: the decimal text is exact, the binary parse rounds at the target quantum). Not @nogc (string construction). FixedDecimal itself is unchanged — this is a free function.
I | binary storage type. |
Bits | binary fraction-bit count. |
value | the decimal value. |
mode | how sub-quantum remainders round. |
FixedBinaryError with OUT_OF_RANGE when
it does not fit the target.