ieeeBinaryToDecimal
ieeeBinaryToDecimal(
value,format):Decimal
Defined in: packages/math-numbers/src/ieee754/binary/ieee-binary-to-decimal.ts:25
The exact decimal value of a finite binary float, at any width.
Always exact and always terminating: the value is sig × 2^e, and a negative
e divides by a power of two, which 1/2 = 5/10 turns into a finite decimal
— so no rounding is possible and none happens. Going through
ieeeBinaryToNumber instead would cap the answer at binary64 and throw away
everything a binary128 carries past ~15 digits.
The result is the exact expansion, not the shortest numeral that round-trips:
binary64’s 0.1 comes back as its full 55-digit value.
Parameters
Section titled “Parameters”A finite value in the unpacked pseudo-normal form.
format
Section titled “format”The format value is expressed in, which fixes its precision.
Returns
Section titled “Returns”The same number as a canonical Decimal.