diff --git a/luaj-test/src/test/resources/compatibility/jme/mathlib.out b/luaj-test/src/test/resources/compatibility/jme/mathlib.out index 2fec97b8..750f7a61 100644 --- a/luaj-test/src/test/resources/compatibility/jme/mathlib.out +++ b/luaj-test/src/test/resources/compatibility/jme/mathlib.out @@ -159,8 +159,8 @@ not '2.5' true false 3^3 true 27 '2'^'0' true 1 '2.5'^'3' true 15.625 -'-2'^'1.5' true -nan -'-2.5'^'-1.5' true -nan +'-2'^'1.5' true +'-2.5'^'-1.5' true '3.0'^'3.0' true 27 2.75^2.75 true 16.149 '2.75'^'2.75' true 16.149 @@ -172,8 +172,8 @@ not '2.5' true false '-3'^4 true 81 -3^'4' true 81 '-3'^-4 true 0.0123 --4.75^'2.75' true -nan -'-2.75'^1.75 true -nan +-4.75^'2.75' true +'-2.75'^1.75 true 4.75^'-2.75' true 0.0137 '2.75'^-1.75 true 0.1702 ---------- binary operator / ---------- @@ -213,23 +213,23 @@ not '2.5' true false 4.75/'-2.75' true -1.727 '2.75'/-1.75 true -1.571 ---------- binary operator % ---------- -2%0 true -nan --2.5%0 true -nan +2%0 true +-2.5%0 true 2%1 true 5%2 true 1 -5%2 true 1 16%2 true -16%-2 true -0.5%0 true -nan +0.5%0 true 0.5%1 true 0.5 0.5%2 true 0.5 0.5%-1 true -0.5 0.5%2 true 0.5 -2.25%0 true -nan +2.25%0 true 2.25%2 true 0.25 --2%0 true -nan +-2%0 true 3%3 true -'2'%'0' true -nan +'2'%'0' true '2.5'%'3' true 2.5 '-2'%'1.5' true 1 '-2.5'%'-1.5' true -1 @@ -503,13 +503,13 @@ math.sin('0') true math.sin('2') true 0.9092 math.sin('2.5') true 0.5984 ---------- math.sqrt ---------- -math.sqrt(-2.5) true -nan -math.sqrt(-2) true -nan +math.sqrt(-2.5) true +math.sqrt(-2) true math.sqrt(0) true math.sqrt(2) true 1.4142 math.sqrt(2.5) true 1.5811 -math.sqrt('-2.5') true -nan -math.sqrt('-2') true -nan +math.sqrt('-2.5') true +math.sqrt('-2') true math.sqrt('0') true math.sqrt('2') true 1.4142 math.sqrt('2.5') true 1.5811 @@ -525,23 +525,23 @@ math.tan('0') true math.tan('2') true -2.185 math.tan('2.5') true -0.747 ---------- math.fmod ---------- -math.fmod(2,0) true -nan -math.fmod(-2.5,0) true -nan +math.fmod(2,0) true +math.fmod(-2.5,0) true math.fmod(2,1) true math.fmod(5,2) true 1 math.fmod(-5,2) true -1 math.fmod(16,2) true math.fmod(-16,-2) true -math.fmod(0.5,0) true -nan +math.fmod(0.5,0) true math.fmod(0.5,1) true 0.5 math.fmod(0.5,2) true 0.5 math.fmod(0.5,-1) true 0.5 math.fmod(0.5,2) true 0.5 -math.fmod(2.25,0) true -nan +math.fmod(2.25,0) true math.fmod(2.25,2) true 0.25 -math.fmod(-2,0) true -nan +math.fmod(-2,0) true math.fmod(3,3) true -math.fmod('2','0') true -nan +math.fmod('2','0') true math.fmod('2.5','3') true 2.5 math.fmod('-2','1.5') true -0.5 math.fmod('-2.5','-1.5') true -1 @@ -615,8 +615,8 @@ math.pow(-2,0) true 1 math.pow(3,3) true 27 math.pow('2','0') true 1 math.pow('2.5','3') true 15.625 -math.pow('-2','1.5') true -nan -math.pow('-2.5','-1.5') true -nan +math.pow('-2','1.5') true +math.pow('-2.5','-1.5') true math.pow('3.0','3.0') true 27 math.pow(2.75,2.75) true 16.149 math.pow('2.75','2.75') true 16.149 @@ -628,8 +628,8 @@ math.pow(-3,'-4') true 0.0123 math.pow('-3',4) true 81 math.pow(-3,'4') true 81 math.pow('-3',-4) true 0.0123 -math.pow(-4.75,'2.75') true -nan -math.pow('-2.75',1.75) true -nan +math.pow(-4.75,'2.75') true +math.pow('-2.75',1.75) true math.pow(4.75,'-2.75') true 0.0137 math.pow('2.75',-1.75) true 0.1702 ---------- math.max ---------- diff --git a/luaj-test/src/test/resources/compatibility/jse/mathlib.out b/luaj-test/src/test/resources/compatibility/jse/mathlib.out index 65b8f799..b3fb3be1 100644 --- a/luaj-test/src/test/resources/compatibility/jse/mathlib.out +++ b/luaj-test/src/test/resources/compatibility/jse/mathlib.out @@ -159,8 +159,8 @@ not '2.5' true false 3^3 true 27 '2'^'0' true 1 '2.5'^'3' true 15.625 -'-2'^'1.5' true -nan -'-2.5'^'-1.5' true -nan +'-2'^'1.5' true +'-2.5'^'-1.5' true '3.0'^'3.0' true 27 2.75^2.75 true 16.149 '2.75'^'2.75' true 16.149 @@ -172,8 +172,8 @@ not '2.5' true false '-3'^4 true 81 -3^'4' true 81 '-3'^-4 true 0.0123 --4.75^'2.75' true -nan -'-2.75'^1.75 true -nan +-4.75^'2.75' true +'-2.75'^1.75 true 4.75^'-2.75' true 0.0137 '2.75'^-1.75 true 0.1702 ---------- binary operator / ---------- @@ -213,23 +213,23 @@ not '2.5' true false 4.75/'-2.75' true -1.727 '2.75'/-1.75 true -1.571 ---------- binary operator % ---------- -2%0 true -nan --2.5%0 true -nan +2%0 true +-2.5%0 true 2%1 true 5%2 true 1 -5%2 true 1 16%2 true -16%-2 true -0.5%0 true -nan +0.5%0 true 0.5%1 true 0.5 0.5%2 true 0.5 0.5%-1 true -0.5 0.5%2 true 0.5 -2.25%0 true -nan +2.25%0 true 2.25%2 true 0.25 --2%0 true -nan +-2%0 true 3%3 true -'2'%'0' true -nan +'2'%'0' true '2.5'%'3' true 2.5 '-2'%'1.5' true 1 '-2.5'%'-1.5' true -1 @@ -503,13 +503,13 @@ math.sin('0') true math.sin('2') true 0.9092 math.sin('2.5') true 0.5984 ---------- math.sqrt ---------- -math.sqrt(-2.5) true -nan -math.sqrt(-2) true -nan +math.sqrt(-2.5) true +math.sqrt(-2) true math.sqrt(0) true math.sqrt(2) true 1.4142 math.sqrt(2.5) true 1.5811 -math.sqrt('-2.5') true -nan -math.sqrt('-2') true -nan +math.sqrt('-2.5') true +math.sqrt('-2') true math.sqrt('0') true math.sqrt('2') true 1.4142 math.sqrt('2.5') true 1.5811 @@ -569,13 +569,13 @@ math.cosh('0') true 1 math.cosh('2') true 3.7621 math.cosh('2.5') true 6.1322 ---------- math.log (jse only) ---------- -math.log(-2.5) true -nan -math.log(-2) true -nan +math.log(-2.5) true +math.log(-2) true math.log(0) true math.log(2) true 0.6931 math.log(2.5) true 0.9162 -math.log('-2.5') true -nan -math.log('-2') true -nan +math.log('-2.5') true +math.log('-2') true math.log('0') true math.log('2') true 0.6931 math.log('2.5') true 0.9162 @@ -602,23 +602,23 @@ math.tanh('0') true math.tanh('2') true 0.9640 math.tanh('2.5') true 0.9866 ---------- math.fmod ---------- -math.fmod(2,0) true -nan -math.fmod(-2.5,0) true -nan +math.fmod(2,0) true +math.fmod(-2.5,0) true math.fmod(2,1) true math.fmod(5,2) true 1 math.fmod(-5,2) true -1 math.fmod(16,2) true math.fmod(-16,-2) true -math.fmod(0.5,0) true -nan +math.fmod(0.5,0) true math.fmod(0.5,1) true 0.5 math.fmod(0.5,2) true 0.5 math.fmod(0.5,-1) true 0.5 math.fmod(0.5,2) true 0.5 -math.fmod(2.25,0) true -nan +math.fmod(2.25,0) true math.fmod(2.25,2) true 0.25 -math.fmod(-2,0) true -nan +math.fmod(-2,0) true math.fmod(3,3) true -math.fmod('2','0') true -nan +math.fmod('2','0') true math.fmod('2.5','3') true 2.5 math.fmod('-2','1.5') true -0.5 math.fmod('-2.5','-1.5') true -1 @@ -692,8 +692,8 @@ math.pow(-2,0) true 1 math.pow(3,3) true 27 math.pow('2','0') true 1 math.pow('2.5','3') true 15.625 -math.pow('-2','1.5') true -nan -math.pow('-2.5','-1.5') true -nan +math.pow('-2','1.5') true +math.pow('-2.5','-1.5') true math.pow('3.0','3.0') true 27 math.pow(2.75,2.75) true 16.149 math.pow('2.75','2.75') true 16.149 @@ -705,8 +705,8 @@ math.pow(-3,'-4') true 0.0123 math.pow('-3',4) true 81 math.pow(-3,'4') true 81 math.pow('-3',-4) true 0.0123 -math.pow(-4.75,'2.75') true -nan -math.pow('-2.75',1.75) true -nan +math.pow(-4.75,'2.75') true +math.pow('-2.75',1.75) true math.pow(4.75,'-2.75') true 0.0137 math.pow('2.75',-1.75) true 0.1702 ---------- math.atan2 (jse only) ---------- diff --git a/luaj-test/src/test/resources/compatibility/mathlib.lua b/luaj-test/src/test/resources/compatibility/mathlib.lua index 64598093..df53f233 100644 --- a/luaj-test/src/test/resources/compatibility/mathlib.lua +++ b/luaj-test/src/test/resources/compatibility/mathlib.lua @@ -5,6 +5,7 @@ local aliases = { ['0']='', ['-0']='', ['nan']='', + ['-nan']='', ['inf']='', ['-inf']='', ['1.#INF']='',