mirror of
https://github.com/bellard/quickjs.git
synced 2025-09-30 06:54:26 +03:00
added new dtoa library to print and parse float64 numbers. It is necessary to fix corner cases (e.g. radix != 10) and to have correct behavior regardless of the libc implementation.
This commit is contained in:
@@ -390,8 +390,12 @@ function test_number()
|
||||
assert((-25).toExponential(0), "-3e+1");
|
||||
assert((2.5).toPrecision(1), "3");
|
||||
assert((-2.5).toPrecision(1), "-3");
|
||||
assert((25).toPrecision(1) === "3e+1");
|
||||
assert((1.125).toFixed(2), "1.13");
|
||||
assert((-1.125).toFixed(2), "-1.13");
|
||||
|
||||
assert((1.3).toString(7), "1.2046204620462046205");
|
||||
assert((1.3).toString(35), "1.ahhhhhhhhhm");
|
||||
}
|
||||
|
||||
function test_eval2()
|
||||
|
Reference in New Issue
Block a user