es6/Math: use Number.isNaN

use number.isNaN to test for NaN
pointed out by @anba in #60
This commit is contained in:
Sam Mikes 2014-07-31 20:50:03 +01:00 committed by smikes
parent 413e16e355
commit bd80bf7dfc
3 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@ includes: [runTestCase.js]
---*/
function testcase() {
if(Math.fround(NaN) === NaN) {
if(Number.isNaN(Math.fround(NaN))) {
return true;
}
}

View File

@ -15,7 +15,7 @@ includes: [runTestCase.js]
---*/
function testcase() {
if(Math.hypot(NaN, 3) === NaN) {
if(Number.isNaN(Math.hypot(NaN, 3))) {
return true;
}
}

View File

@ -13,7 +13,7 @@ includes: [runTestCase.js]
---*/
function testcase() {
if(Math.trunc(NaN) === NaN) {
if(Number.isNaN(Math.trunc(NaN))) {
return true;
}
}