When hex, octal, or binary integer literals overflow u64, we used to fall back to UINT64_MAX. This produced incorrect results for any value larger than 2^64. Fix this by accumulating the value as a double digit-by-digit when the u64 parse fails.
3 lines
152 B
JavaScript
3 lines
152 B
JavaScript
var a = 0xffffffffffffffffff;
|
|
var b = 0o77777777777777777777777;
|
|
var c = 0b111111111111111111111111111111111111111111111111111111111111111111111111111;
|