From 64c25a472882364e12e1f42bd8c02e26e7895d55 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 22 May 2017 01:16:02 +1000 Subject: tests/test-suite/inprogress/math.js: isNaN is a shared function for tests --- tests/test-suite/inprogress/math.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/test-suite/inprogress') diff --git a/tests/test-suite/inprogress/math.js b/tests/test-suite/inprogress/math.js index 776fa3c..ae3ec7a 100644 --- a/tests/test-suite/inprogress/math.js +++ b/tests/test-suite/inprogress/math.js @@ -16,6 +16,10 @@ const prefix = ` local intbits = math.floor(math.log(maxint, 2) + 0.5) + 1 --assert((1 << intbits) == 0) + local function isNaN (x) + return (x ~= x) + end + local function checkerror (msg, f, ...) local s, err = pcall(f, ...) assert(not s and string.find(err, msg)) @@ -81,9 +85,6 @@ test("[test-suite] math: number of bits in the mantissa of a floating-point numb end end - local function isNaN (x) - return (x ~= x) - end assert(isNaN(0/0)) assert(not isNaN(1/0)) -- cgit v1.2.3-70-g09d2