Expand description
ECMAScript Number::toString for binary64.
The JavaScript frontend keeps a Number literal as String(value), the
text JavaScript prints, so both runtimes agree on it. Rust’s {:e} gives
the shortest digits that read back as the value; ECMAScript picks the
even neighbour where Rust rounds a tie away from zero.
The emitted Rust prelude (ml_number::js_number) is the same algorithm.
Functions§
- js_
number String(x)for a JavaScript Numberx.- js_
number_ literal String(Number(text))for the text of a JavaScript numeric literal without separators or suffix: decimal, or0x,0o,0bintegers.