mirror of
https://github.com/bellard/quickjs.git
synced 2025-05-12 11:06:10 +08:00
enable dtoa tests on win32
This commit is contained in:
parent
d1bb520f29
commit
a44011ed5a
@ -381,11 +381,9 @@ function test_number()
|
||||
assert(Number.isNaN(Number("-")));
|
||||
assert(Number.isNaN(Number("\x00a")));
|
||||
|
||||
// TODO: Fix rounding errors on Windows/Cygwin.
|
||||
if (typeof os !== 'undefined' && ['win32', 'cygwin'].includes(os.platform)) {
|
||||
return;
|
||||
}
|
||||
|
||||
assert((1-2**-53).toString(12), "0.bbbbbbbbbbbbbba");
|
||||
assert((1000000000000000128).toString(), "1000000000000000100");
|
||||
assert((1000000000000000128).toFixed(0), "1000000000000000128");
|
||||
assert((25).toExponential(0), "3e+1");
|
||||
assert((-25).toExponential(0), "-3e+1");
|
||||
assert((2.5).toPrecision(1), "3");
|
||||
@ -393,6 +391,8 @@ function test_number()
|
||||
assert((25).toPrecision(1) === "3e+1");
|
||||
assert((1.125).toFixed(2), "1.13");
|
||||
assert((-1.125).toFixed(2), "-1.13");
|
||||
assert((0.5).toFixed(0), "1");
|
||||
assert((-0.5).toFixed(0), "-1");
|
||||
|
||||
assert((1.3).toString(7), "1.2046204620462046205");
|
||||
assert((1.3).toString(35), "1.ahhhhhhhhhm");
|
||||
|
Loading…
x
Reference in New Issue
Block a user