diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2025-03-19 19:07:57 +0100 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2025-03-19 19:07:57 +0100 |
commit | 993660621a0a834c93eaad68713b2dc25508b326 (patch) | |
tree | f64f4007dd9b079b16230319c917e64760fbed5d /tests | |
parent | 9f1864a268d7ae2d86971f0a6415aa6371498039 (diff) | |
download | quickjs-993660621a0a834c93eaad68713b2dc25508b326.tar.gz quickjs-993660621a0a834c93eaad68713b2dc25508b326.zip |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_builtin.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_builtin.js b/tests/test_builtin.js index 1c47f8f..f547037 100644 --- a/tests/test_builtin.js +++ b/tests/test_builtin.js @@ -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() |