diff options
author | Linus Groh <mail@linusgroh.de> | 2020-04-28 12:39:31 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-28 14:49:43 +0200 |
commit | 3a12a8a3484415369342e4d19a7346f95ece04ee (patch) | |
tree | 8c53e284ad28c9e3d0407207603acc1058f37787 | |
parent | 1c4d776cccdbc02e62323e7a1c07a1e9f329cc7e (diff) | |
download | serenity-3a12a8a3484415369342e4d19a7346f95ece04ee.zip |
LibJS: Make Number.isInteger() test pass on Serenity
The parser doesn't like many decimals, an issue with our strtod()
implementation. Let's use division instead - all tests green again :^)
-rw-r--r-- | Libraries/LibJS/Tests/Number.isInteger.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibJS/Tests/Number.isInteger.js b/Libraries/LibJS/Tests/Number.isInteger.js index 7dd013f112..8c3a94e5e1 100644 --- a/Libraries/LibJS/Tests/Number.isInteger.js +++ b/Libraries/LibJS/Tests/Number.isInteger.js @@ -8,13 +8,13 @@ try { assert(Number.isInteger(-10000) === true); assert(Number.isInteger(5) === true); assert(Number.isInteger(5.0) === true); - assert(Number.isInteger(5.0000000000000001) === true); + assert(Number.isInteger(5 + 1/10000000000000000) === true); // FIXME: values outside of i32's range should still return true // assert(Number.isInteger(+2147483647 + 1) === true); // assert(Number.isInteger(-2147483648 - 1) === true); // assert(Number.isInteger(99999999999999999999999999999999999) === true); - assert(Number.isInteger(5.000000000000001) === false); + assert(Number.isInteger(5 + 1/1000000000000000) === false); assert(Number.isInteger(1.23) === false); assert(Number.isInteger("") === false); assert(Number.isInteger("0") === false); |