Skip to main content

Module number

Module number 

Source
Expand description

JS number semantics the client has to reproduce exactly: Number.prototype.toString (also what JSON.stringify writes) and Number(string).

Functionsยง

format
String(n) in JS, i.e. ECMAScript Number::toString(n, 10).
is_int32
(n | 0) === n in JS: whether n is exactly an int32. -0 counts, because -0 === 0.
is_js_whitespace
ECMAScript WhiteSpace plus LineTerminator.
is_safe_integer
Number.isSafeInteger(n) in JS.
parse
Number(string) in JS (ECMAScript StringToNumber): trims JS whitespace, maps the empty string to 0, and accepts decimal, Infinity, and 0x/0o/0b literals. Anything else is NaN.