Number.prototype.toHexExponential
This is similar to 'toExponential' but is in the normalised hexadecimal
form instead of decimal.
E.g. 1.4A2p+4
The letter 'p' corresponds to decimal's 'e', and means "times 2 to the
power of".
The *binary* exponent is represented in signed *decimal*.
The hex representation should probably be in lowercase to match that of
'toString(16)'.
GNU's printf provides this format with its %a and %A conversions. The
format is useful for transferring arbitrary binary floating-point values
exactly, whereas decimal formats round them.
Number.prototype.toString() generates as many digits as needed for the
number to be representable unambiguously.
(if I wanted packed binary number representation, then rather some form
of base32 - it packs more)
Herby
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss