diff options
Diffstat (limited to 'test/built-ins/Math')
56 files changed, 500 insertions, 497 deletions
diff --git a/test/built-ins/Math/abs/S15.8.2.1_A3.js b/test/built-ins/Math/abs/S15.8.2.1_A3.js index da4ec1890..4584dc9c9 100644 --- a/test/built-ins/Math/abs/S15.8.2.1_A3.js +++ b/test/built-ins/Math/abs/S15.8.2.1_A3.js @@ -11,5 +11,5 @@ description: Checking if Math.abs(-Infinity) equals to +Infinity var x = -Infinity; if (Math.abs(x) !== +Infinity) { - $ERROR("#1: 'var x=-Infinity; Math.abs(x) !== +Infinity'"); + $ERROR("#1: 'var x=-Infinity; Math.abs(x) !== +Infinity'"); } diff --git a/test/built-ins/Math/acosh/nan-returns.js b/test/built-ins/Math/acosh/nan-returns.js index b58e45dd5..4917b4905 100644 --- a/test/built-ins/Math/acosh/nan-returns.js +++ b/test/built-ins/Math/acosh/nan-returns.js @@ -1,18 +1,18 @@ -// Copyright 2015 Microsoft Corporation. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -description: Math.acosh with special values -es6id: 20.2.2.3 -info: | - Math.acosh ( x ) - - - If x is NaN, the result is NaN. - - If x is less than 1, the result is NaN. ----*/ - -assert.sameValue(Math.acosh(NaN), NaN, "NaN"); -assert.sameValue(Math.acosh(0.999999), NaN, "0.999999"); -assert.sameValue(Math.acosh(0), NaN, "0"); -assert.sameValue(Math.acosh(-1), NaN, "-1"); -assert.sameValue(Math.acosh(-Infinity), NaN, "-Infinity"); +// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: Math.acosh with special values
+es6id: 20.2.2.3
+info: |
+ Math.acosh ( x )
+
+ - If x is NaN, the result is NaN.
+ - If x is less than 1, the result is NaN.
+---*/
+
+assert.sameValue(Math.acosh(NaN), NaN, "NaN");
+assert.sameValue(Math.acosh(0.999999), NaN, "0.999999");
+assert.sameValue(Math.acosh(0), NaN, "0");
+assert.sameValue(Math.acosh(-1), NaN, "-1");
+assert.sameValue(Math.acosh(-Infinity), NaN, "-Infinity");
diff --git a/test/built-ins/Math/asinh/asinh-specialVals.js b/test/built-ins/Math/asinh/asinh-specialVals.js index 33d88207c..0c2fda965 100644 --- a/test/built-ins/Math/asinh/asinh-specialVals.js +++ b/test/built-ins/Math/asinh/asinh-specialVals.js @@ -1,18 +1,18 @@ -// Copyright 2015 Microsoft Corporation. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -description: Math.asinh with special values -es6id: 20.2.2.5 ----*/ - -assert.sameValue(Math.asinh(NaN), Number.NaN, - "Math.asinh produces incorrect output for NaN"); -assert.sameValue(Math.asinh(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY, - "Math.asinh should produce negative infinity for Number.NEGATIVE_INFINITY"); -assert.sameValue(Math.asinh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, - "Math.asinh should produce positive infinity for Number.POSITIVE_INFINITY"); -assert.sameValue(1 / Math.asinh(-0), Number.NEGATIVE_INFINITY, - "Math.asinh should produce -0 for -0"); -assert.sameValue(1 / Math.asinh(0), Number.POSITIVE_INFINITY, - "Math.asinh should produce +0 for +0"); +// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: Math.asinh with special values
+es6id: 20.2.2.5
+---*/
+
+assert.sameValue(Math.asinh(NaN), Number.NaN,
+ "Math.asinh produces incorrect output for NaN");
+assert.sameValue(Math.asinh(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY,
+ "Math.asinh should produce negative infinity for Number.NEGATIVE_INFINITY");
+assert.sameValue(Math.asinh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
+ "Math.asinh should produce positive infinity for Number.POSITIVE_INFINITY");
+assert.sameValue(1 / Math.asinh(-0), Number.NEGATIVE_INFINITY,
+ "Math.asinh should produce -0 for -0");
+assert.sameValue(1 / Math.asinh(0), Number.POSITIVE_INFINITY,
+ "Math.asinh should produce +0 for +0");
diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A1.js b/test/built-ins/Math/atan2/S15.8.2.5_A1.js index fafadc81b..0b1d92a2a 100644 --- a/test/built-ins/Math/atan2/S15.8.2.5_A1.js +++ b/test/built-ins/Math/atan2/S15.8.2.5_A1.js @@ -24,14 +24,14 @@ var valnum = 7; var args = new Array(); for (var i = 0; i < 2; i++) { - args[i] = NaN; - for (var j = 0; j < valnum; j++) - { - args[1 - i] = vals[j]; - assert.sameValue( - Math.atan2(args[0], args[1]), - NaN, - "(" + args[0] + ", " + args[1] + ")" - ); - } + args[i] = NaN; + for (var j = 0; j < valnum; j++) + { + args[1-i] = vals[j]; + assert.sameValue( + Math.atan2(args[0], args[1]), + NaN, + "(" + args[0] + ", " + args[1] + ")" + ); + } } diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A16.js b/test/built-ins/Math/atan2/S15.8.2.5_A16.js index 5c0ea9823..19f2509a1 100644 --- a/test/built-ins/Math/atan2/S15.8.2.5_A16.js +++ b/test/built-ins/Math/atan2/S15.8.2.5_A16.js @@ -20,7 +20,8 @@ var ynum = 3; for (var i = 0; i < ynum; i++) { assert.sameValue( - Math.atan2(y[i], x), -0, + Math.atan2(y[i], x), + -0, "(" + y[i] + ", Infinity)" ); } diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A4.js b/test/built-ins/Math/atan2/S15.8.2.5_A4.js index 5472b973f..ef663e63f 100644 --- a/test/built-ins/Math/atan2/S15.8.2.5_A4.js +++ b/test/built-ins/Math/atan2/S15.8.2.5_A4.js @@ -12,7 +12,7 @@ var y = +0; var x = new Array(); x[0] = 0.000000000000001; x[2] = +Infinity; -x[1] = 1; +x[1] = 1; var xnum = 3; for (var i = 0; i < xnum; i++) diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A8.js b/test/built-ins/Math/atan2/S15.8.2.5_A8.js index de7ff4e1e..64dc40028 100644 --- a/test/built-ins/Math/atan2/S15.8.2.5_A8.js +++ b/test/built-ins/Math/atan2/S15.8.2.5_A8.js @@ -12,13 +12,14 @@ var y = -0; var x = new Array(); x[0] = 0.000000000000001; x[2] = +Infinity; -x[1] = 1; +x[1] = 1; var xnum = 3; for (var i = 0; i < xnum; i++) { assert.sameValue( - Math.atan2(y, x[i]), -0, + Math.atan2(y, x[i]), + -0, "(-0, " + x[i] + ")" ); } diff --git a/test/built-ins/Math/atanh/atanh-specialVals.js b/test/built-ins/Math/atanh/atanh-specialVals.js index 9148c1bb4..b144e4bb5 100644 --- a/test/built-ins/Math/atanh/atanh-specialVals.js +++ b/test/built-ins/Math/atanh/atanh-specialVals.js @@ -1,31 +1,31 @@ -// Copyright 2015 Microsoft Corporation. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -description: Math.atanh with special values -es6id: 20.2.2.7 ----*/ - -assert.sameValue(Math.atanh(-1.9), Number.NaN, - "Math.atanh produces incorrect output for -1.9"); -assert.sameValue(Math.atanh(NaN), Number.NaN, - "Math.atanh produces incorrect output for NaN"); -assert.sameValue(Math.atanh(-10), Number.NaN, - "Math.atanh produces incorrect output for -10"); -assert.sameValue(Math.atanh(-Infinity), Number.NaN, - "Math.atanh produces incorrect output for -Infinity"); -assert.sameValue(Math.atanh(1.9), Number.NaN, - "Math.atanh produces incorrect output for 1.9"); -assert.sameValue(Math.atanh(10), Number.NaN, - "Math.atanh produces incorrect output for 10"); -assert.sameValue(Math.atanh(Number.POSITIVE_INFINITY), Number.NaN, - "Math.atanh produces incorrect output for Number.POSITIVE_INFINITY"); - -assert.sameValue(Math.atanh(-1), Number.NEGATIVE_INFINITY, - "Math.atanh should produce negative infinity for -1"); -assert.sameValue(Math.atanh(+1), Number.POSITIVE_INFINITY, - "Math.atanh should produce positive infinity for +1"); -assert.sameValue(1 / Math.atanh(-0), Number.NEGATIVE_INFINITY, - "Math.atanh should produce -0 for -0"); -assert.sameValue(1 / Math.atanh(0), Number.POSITIVE_INFINITY, - "Math.atanh should produce +0 for +0"); +// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: Math.atanh with special values
+es6id: 20.2.2.7
+---*/
+
+assert.sameValue(Math.atanh(-1.9), Number.NaN,
+ "Math.atanh produces incorrect output for -1.9");
+assert.sameValue(Math.atanh(NaN), Number.NaN,
+ "Math.atanh produces incorrect output for NaN");
+assert.sameValue(Math.atanh(-10), Number.NaN,
+ "Math.atanh produces incorrect output for -10");
+assert.sameValue(Math.atanh(-Infinity), Number.NaN,
+ "Math.atanh produces incorrect output for -Infinity");
+assert.sameValue(Math.atanh(1.9), Number.NaN,
+ "Math.atanh produces incorrect output for 1.9");
+assert.sameValue(Math.atanh(10), Number.NaN,
+ "Math.atanh produces incorrect output for 10");
+assert.sameValue(Math.atanh(Number.POSITIVE_INFINITY), Number.NaN,
+ "Math.atanh produces incorrect output for Number.POSITIVE_INFINITY");
+
+assert.sameValue(Math.atanh(-1), Number.NEGATIVE_INFINITY,
+ "Math.atanh should produce negative infinity for -1");
+assert.sameValue(Math.atanh(+1), Number.POSITIVE_INFINITY,
+ "Math.atanh should produce positive infinity for +1");
+assert.sameValue(1/Math.atanh(-0), Number.NEGATIVE_INFINITY,
+ "Math.atanh should produce -0 for -0");
+assert.sameValue(1/Math.atanh(0), Number.POSITIVE_INFINITY,
+ "Math.atanh should produce +0 for +0");
diff --git a/test/built-ins/Math/cbrt/cbrt-specialValues.js b/test/built-ins/Math/cbrt/cbrt-specialValues.js index 9ac640cab..a1f9fcde0 100644 --- a/test/built-ins/Math/cbrt/cbrt-specialValues.js +++ b/test/built-ins/Math/cbrt/cbrt-specialValues.js @@ -1,18 +1,18 @@ -// Copyright 2015 Microsoft Corporation. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -description: Math.cbrt with special values -es6id: 20.2.2.9 ----*/ - -assert.sameValue(Math.cbrt(NaN), Number.NaN, - "Math.cbrt produces incorrect output for NaN"); -assert.sameValue(Math.cbrt(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY, - "Math.cbrt should produce negative infinity for Number.NEGATIVE_INFINITY"); -assert.sameValue(Math.cbrt(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, - "Math.cbrt should produce positive infinity for Number.POSITIVE_INFINITY"); -assert.sameValue(1 / Math.cbrt(-0), Number.NEGATIVE_INFINITY, - "Math.cbrt should produce -0 for -0"); -assert.sameValue(1 / Math.cbrt(0), Number.POSITIVE_INFINITY, - "Math.cbrt should produce +0 for +0"); +// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: Math.cbrt with special values
+es6id: 20.2.2.9
+---*/
+
+assert.sameValue(Math.cbrt(NaN), Number.NaN,
+ "Math.cbrt produces incorrect output for NaN");
+assert.sameValue(Math.cbrt(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY,
+ "Math.cbrt should produce negative infinity for Number.NEGATIVE_INFINITY");
+assert.sameValue(Math.cbrt(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
+ "Math.cbrt should produce positive infinity for Number.POSITIVE_INFINITY");
+assert.sameValue(1/Math.cbrt(-0), Number.NEGATIVE_INFINITY,
+ "Math.cbrt should produce -0 for -0");
+assert.sameValue(1/Math.cbrt(0), Number.POSITIVE_INFINITY,
+ "Math.cbrt should produce +0 for +0");
diff --git a/test/built-ins/Math/cbrt/prop-desc.js b/test/built-ins/Math/cbrt/prop-desc.js index e7d83a78f..0a5a2657c 100644 --- a/test/built-ins/Math/cbrt/prop-desc.js +++ b/test/built-ins/Math/cbrt/prop-desc.js @@ -1,12 +1,12 @@ -// Copyright 2015 Microsoft Corporation. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -description: Testing descriptor property of Math.cbrt -includes: [propertyHelper.js] -es6id: 20.2.2.9 ----*/ - -verifyNotEnumerable(Math, "cbrt"); -verifyWritable(Math, "cbrt"); -verifyConfigurable(Math, "cbrt"); +// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: Testing descriptor property of Math.cbrt
+includes: [propertyHelper.js]
+es6id: 20.2.2.9
+---*/
+
+verifyNotEnumerable(Math, "cbrt");
+verifyWritable(Math, "cbrt");
+verifyConfigurable(Math, "cbrt");
diff --git a/test/built-ins/Math/ceil/S15.8.2.6_A4.js b/test/built-ins/Math/ceil/S15.8.2.6_A4.js index 6339e327e..e600908cb 100644 --- a/test/built-ins/Math/ceil/S15.8.2.6_A4.js +++ b/test/built-ins/Math/ceil/S15.8.2.6_A4.js @@ -11,5 +11,5 @@ description: Checking if Math.ceil(x) is +Infinity, where x is +Infinity var x = +Infinity; if (Math.ceil(x) !== +Infinity) { - $ERROR("#1: 'var x = +Infinity; Math.ceil(x) !== +Infinity'"); + $ERROR("#1: 'var x = +Infinity; Math.ceil(x) !== +Infinity'"); } diff --git a/test/built-ins/Math/ceil/S15.8.2.6_A5.js b/test/built-ins/Math/ceil/S15.8.2.6_A5.js index c37068f60..74e605aab 100644 --- a/test/built-ins/Math/ceil/S15.8.2.6_A5.js +++ b/test/built-ins/Math/ceil/S15.8.2.6_A5.js @@ -11,5 +11,5 @@ description: Checking if Math.ceil(x) is -Infinity, where x is -Infinity var x = -Infinity; if (Math.ceil(x) !== -Infinity) { - $ERROR("#1: 'var x = -Infinity; Math.ceil(x) !== -Infinity'"); + $ERROR("#1: 'var x = -Infinity; Math.ceil(x) !== -Infinity'"); } diff --git a/test/built-ins/Math/ceil/S15.8.2.6_A7.js b/test/built-ins/Math/ceil/S15.8.2.6_A7.js index b951f80d4..9f6f71592 100644 --- a/test/built-ins/Math/ceil/S15.8.2.6_A7.js +++ b/test/built-ins/Math/ceil/S15.8.2.6_A7.js @@ -10,11 +10,11 @@ description: > ---*/ // CHECK#1 -for (var i = -1000; i < 1000; i++) +for (var i=-1000; i<1000; i++) { - var x = i / 10.0; - if (Math.ceil(x) !== -Math.floor(-x)) - { - $ERROR("#1: 'x = " + x + "; Math.ceil(x) !== -Math.floor(-x)'"); - } + var x = i/10.0; + if (Math.ceil(x) !== -Math.floor(-x)) + { + $ERROR("#1: 'x = " + x + "; Math.ceil(x) !== -Math.floor(-x)'"); + } } diff --git a/test/built-ins/Math/cos/S15.8.2.7_A2.js b/test/built-ins/Math/cos/S15.8.2.7_A2.js index 8d3ca7f5a..a22ee05a7 100644 --- a/test/built-ins/Math/cos/S15.8.2.7_A2.js +++ b/test/built-ins/Math/cos/S15.8.2.7_A2.js @@ -11,5 +11,5 @@ description: Checking if Math.cos(+0) is 1 var x = +0; if (Math.cos(x) !== 1) { - $ERROR("#1: 'var x = +0; Math.cos(x) !== 1'"); + $ERROR("#1: 'var x = +0; Math.cos(x) !== 1'"); } diff --git a/test/built-ins/Math/cos/S15.8.2.7_A3.js b/test/built-ins/Math/cos/S15.8.2.7_A3.js index ef100a283..b567b4406 100644 --- a/test/built-ins/Math/cos/S15.8.2.7_A3.js +++ b/test/built-ins/Math/cos/S15.8.2.7_A3.js @@ -11,5 +11,5 @@ description: Checking if Math.cos(-0) is 1 var x = -0; if (Math.cos(x) !== 1) { - $ERROR("#1: 'var x = -0; Math.cos(x) !== 1'"); + $ERROR("#1: 'var x = -0; Math.cos(x) !== 1'"); } diff --git a/test/built-ins/Math/cosh/cosh-specialVals.js b/test/built-ins/Math/cosh/cosh-specialVals.js index ddb544539..7c36a759a 100644 --- a/test/built-ins/Math/cosh/cosh-specialVals.js +++ b/test/built-ins/Math/cosh/cosh-specialVals.js @@ -1,16 +1,16 @@ -// Copyright 2015 Microsoft Corporation. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -description: Math.cosh with special values -es6id: 20.2.2.13 ----*/ - -assert.sameValue(Math.cosh(NaN), Number.NaN, - "Math.cosh produces incorrect output for NaN"); -assert.sameValue(Math.cosh(0), 1, "Math.cosh should produce 1 for input = 0"); -assert.sameValue(Math.cosh(-0), 1, "Math.cosh should produce 1 for input = -0"); -assert.sameValue(Math.cosh(Number.NEGATIVE_INFINITY), Number.POSITIVE_INFINITY, - "Math.cosh should produce Number.POSITIVE_INFINITY for Number.NEGATIVE_INFINITY"); -assert.sameValue(Math.cosh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, - "Math.cosh should produce Number.POSITIVE_INFINITY for Number.POSITIVE_INFINITY"); +// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: Math.cosh with special values
+es6id: 20.2.2.13
+---*/
+
+assert.sameValue(Math.cosh(NaN), Number.NaN,
+ "Math.cosh produces incorrect output for NaN");
+assert.sameValue(Math.cosh(0), 1, "Math.cosh should produce 1 for input = 0");
+assert.sameValue(Math.cosh(-0), 1, "Math.cosh should produce 1 for input = -0");
+assert.sameValue(Math.cosh(Number.NEGATIVE_INFINITY), Number.POSITIVE_INFINITY,
+ "Math.cosh should produce Number.POSITIVE_INFINITY for Number.NEGATIVE_INFINITY");
+assert.sameValue(Math.cosh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
+ "Math.cosh should produce Number.POSITIVE_INFINITY for Number.POSITIVE_INFINITY");
diff --git a/test/built-ins/Math/exp/S15.8.2.8_A2.js b/test/built-ins/Math/exp/S15.8.2.8_A2.js index 11ea36c45..db4ba2d12 100644 --- a/test/built-ins/Math/exp/S15.8.2.8_A2.js +++ b/test/built-ins/Math/exp/S15.8.2.8_A2.js @@ -11,5 +11,5 @@ description: Checking if Math.exp(+0) is 1 var x = +0; if (Math.exp(x) !== 1) { - $ERROR("#1: 'var x = +0; Math.exp(x) !== 1'"); + $ERROR("#1: 'var x = +0; Math.exp(x) !== 1'"); } diff --git a/test/built-ins/Math/exp/S15.8.2.8_A3.js b/test/built-ins/Math/exp/S15.8.2.8_A3.js index 6f8e4ca46..32054e3e6 100644 --- a/test/built-ins/Math/exp/S15.8.2.8_A3.js +++ b/test/built-ins/Math/exp/S15.8.2.8_A3.js @@ -11,5 +11,5 @@ description: Checking if Math.exp(-0) is 1 var x = -0; if (Math.exp(x) !== 1) { - $ERROR("#1: 'var x = -0; Math.exp(x) !== 1'"); + $ERROR("#1: 'var x = -0; Math.exp(x) !== 1'"); } diff --git a/test/built-ins/Math/exp/S15.8.2.8_A4.js b/test/built-ins/Math/exp/S15.8.2.8_A4.js index a4bb1e204..94d37dc2f 100644 --- a/test/built-ins/Math/exp/S15.8.2.8_A4.js +++ b/test/built-ins/Math/exp/S15.8.2.8_A4.js @@ -11,5 +11,5 @@ description: Checking if Math.exp(+Infinity) is +Ifinity var x = +Infinity; if (Math.exp(x) !== +Infinity) { - $ERROR("#1: 'var x = +Infinity; Math.exp(x) !== +Infinity'"); + $ERROR("#1: 'var x = +Infinity; Math.exp(x) !== +Infinity'"); } diff --git a/test/built-ins/Math/expm1/expm1-specialVals.js b/test/built-ins/Math/expm1/expm1-specialVals.js index 65aa97904..3d62cc398 100644 --- a/test/built-ins/Math/expm1/expm1-specialVals.js +++ b/test/built-ins/Math/expm1/expm1-specialVals.js @@ -1,18 +1,18 @@ -// Copyright 2015 Microsoft Corporation. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -description: Math.expm1 with sample values. -es6id: 20.2.2.15 ----*/ - -assert.sameValue(Math.expm1(NaN), Number.NaN, - "Math.expm1 produces incorrect output for NaN"); -assert.sameValue(Math.expm1(Number.NEGATIVE_INFINITY), -1, - "Math.expm1 should produce -1 for Number.NEGATIVE_INFINITY"); -assert.sameValue(Math.expm1(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, - "Math.expm1 should produce POSITIVE infinity for Number.POSITIVE_INFINITY"); -assert.sameValue(1 / Math.expm1(-0), Number.NEGATIVE_INFINITY, - "Math.expm1 should produce -0 for -0"); -assert.sameValue(1 / Math.expm1(0), Number.POSITIVE_INFINITY, - "Math.expm1 should produce +0 for +0"); +// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: Math.expm1 with sample values.
+es6id: 20.2.2.15
+---*/
+
+assert.sameValue(Math.expm1(NaN), Number.NaN,
+ "Math.expm1 produces incorrect output for NaN");
+assert.sameValue(Math.expm1(Number.NEGATIVE_INFINITY), -1,
+ "Math.expm1 should produce -1 for Number.NEGATIVE_INFINITY");
+assert.sameValue(Math.expm1(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
+ "Math.expm1 should produce POSITIVE infinity for Number.POSITIVE_INFINITY");
+assert.sameValue(1/Math.expm1(-0), Number.NEGATIVE_INFINITY,
+ "Math.expm1 should produce -0 for -0");
+assert.sameValue(1/Math.expm1(0), Number.POSITIVE_INFINITY,
+ "Math.expm1 should produce +0 for +0");
diff --git a/test/built-ins/Math/floor/S15.8.2.9_A4.js b/test/built-ins/Math/floor/S15.8.2.9_A4.js index a74af8c6e..2cdb90486 100644 --- a/test/built-ins/Math/floor/S15.8.2.9_A4.js +++ b/test/built-ins/Math/floor/S15.8.2.9_A4.js @@ -11,5 +11,5 @@ description: Checking if Math.floor(x) is +Infinity, where x is +Infinity var x = +Infinity; if (Math.floor(x) !== +Infinity) { - $ERROR("#1: 'var x = +Infinity; Math.floor(x) !== +Infinity'"); + $ERROR("#1: 'var x = +Infinity; Math.floor(x) !== +Infinity'"); } diff --git a/test/built-ins/Math/floor/S15.8.2.9_A5.js b/test/built-ins/Math/floor/S15.8.2.9_A5.js index 290ce4931..0d35398ca 100644 --- a/test/built-ins/Math/floor/S15.8.2.9_A5.js +++ b/test/built-ins/Math/floor/S15.8.2.9_A5.js @@ -11,5 +11,5 @@ description: Checking if Math.floor(x) is -Infinity, where x is -Infinity var x = -Infinity; if (Math.floor(x) !== -Infinity) { - $ERROR("#1: 'var x = -Infinity; Math.floor(x) !== -Infinity'"); + $ERROR("#1: 'var x = -Infinity; Math.floor(x) !== -Infinity'"); } diff --git a/test/built-ins/Math/floor/S15.8.2.9_A7.js b/test/built-ins/Math/floor/S15.8.2.9_A7.js index 2f19b43a7..37b598401 100644 --- a/test/built-ins/Math/floor/S15.8.2.9_A7.js +++ b/test/built-ins/Math/floor/S15.8.2.9_A7.js @@ -10,11 +10,11 @@ description: > ---*/ // CHECK#1 -for (var i = -1000; i < 1000; i++) +for (var i=-1000; i<1000; i++) { - var x = i / 10.0; - if (-Math.ceil(-x) !== Math.floor(x)) - { - $ERROR("#1: 'x = " + x + "; Math.floor(x) !== -Math.ceil(-x)'"); - } + var x = i/10.0; + if (-Math.ceil(-x) !== Math.floor(x)) + { + $ERROR("#1: 'x = " + x + "; Math.floor(x) !== -Math.ceil(-x)'"); + } } diff --git a/test/built-ins/Math/hypot/Math.hypot_Success_2.js b/test/built-ins/Math/hypot/Math.hypot_Success_2.js index 5fbe0deaa..4106a0a77 100644 --- a/test/built-ins/Math/hypot/Math.hypot_Success_2.js +++ b/test/built-ins/Math/hypot/Math.hypot_Success_2.js @@ -7,4 +7,4 @@ author: Ryan Lewis description: Math.hypot should return 5 if called with 3 and 4. ---*/ -assert.sameValue(Math.hypot(3, 4), 5, 'Math.hypot(3,4)'); +assert.sameValue(Math.hypot(3,4), 5, 'Math.hypot(3,4)'); diff --git a/test/built-ins/Math/log/S15.8.2.10_A3.js b/test/built-ins/Math/log/S15.8.2.10_A3.js index b95438b2a..93854fdfc 100644 --- a/test/built-ins/Math/log/S15.8.2.10_A3.js +++ b/test/built-ins/Math/log/S15.8.2.10_A3.js @@ -11,12 +11,12 @@ description: Checking if Math.log(+0) and Math.log(-0) equals to -Infinity var x = +0; if (Math.log(x) !== -Infinity) { - $ERROR("#1: 'var x=+0; Math.log(x) !== -Infinity'"); + $ERROR("#1: 'var x=+0; Math.log(x) !== -Infinity'"); } // CHECK#2 var x = -0; if (Math.log(x) !== -Infinity) { - $ERROR("#1: 'var x=-0; Math.log(x) !== -Infinity'"); + $ERROR("#1: 'var x=-0; Math.log(x) !== -Infinity'"); } diff --git a/test/built-ins/Math/log/S15.8.2.10_A5.js b/test/built-ins/Math/log/S15.8.2.10_A5.js index 045b73c50..1cf45192e 100644 --- a/test/built-ins/Math/log/S15.8.2.10_A5.js +++ b/test/built-ins/Math/log/S15.8.2.10_A5.js @@ -11,5 +11,5 @@ description: Checking if Math.log(+Infinity) equals to +Infinity var x = +Infinity; if (Math.log(x) !== +Infinity) { - $ERROR("#1: 'var x=+Infinity; Math.log(x) !== +Infinity'"); + $ERROR("#1: 'var x=+Infinity; Math.log(x) !== +Infinity'"); } diff --git a/test/built-ins/Math/log10/Log10-specialVals.js b/test/built-ins/Math/log10/Log10-specialVals.js index 341ea36e0..5a8411b76 100644 --- a/test/built-ins/Math/log10/Log10-specialVals.js +++ b/test/built-ins/Math/log10/Log10-specialVals.js @@ -1,32 +1,33 @@ -// Copyright 2015 Microsoft Corporation. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -description: Math.Log10 with sample values. -es6id: 20.2.2.20 ----*/ - -assert.sameValue(Math.log10(-0), Number.NEGATIVE_INFINITY, - "Math.log10 produces incorrect output for -0"); -assert.sameValue(Math.log10(+0), Number.NEGATIVE_INFINITY, - "Math.log10 produces incorrect output for +0"); -assert.sameValue(Math.log10(-0.9), Number.NaN, - "Math.log10 produces incorrect output for -0.9"); -assert.sameValue(Math.log10(NaN), Number.NaN, - "Math.log10 produces incorrect output for NaN"); -assert.sameValue(Math.log10(-10), Number.NaN, - "Math.log10 produces incorrect output for -10"); -assert.sameValue(Math.log10(null), Number.NEGATIVE_INFINITY, - "Math.log10 produces incorrect output for null"); -assert.sameValue(Math.log10(undefined), Number.NaN, - "Math.log10 produces incorrect output for undefined"); -assert.sameValue(Math.log10(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, - "Math.log10 produces incorrect output for Number.POSITIVE_INFINITY"); -assert.sameValue(Math.log10(1), 0, - "Math.log10 produces incorrect output for 1"); -assert.sameValue(Math.log10(10.00), 1, - "Math.log10 produces incorrect output for 10.00"); -assert.sameValue(Math.log10(100.00), 2, - "Math.log10 produces incorrect output for 100.00"); -assert.sameValue(Math.log10(1000.00), 3, - "Math.log10 produces incorrect output for 1000.00"); +// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: Math.Log10 with sample values.
+es6id: 20.2.2.20
+---*/
+
+assert.sameValue(Math.log10(-0), Number.NEGATIVE_INFINITY,
+ "Math.log10 produces incorrect output for -0");
+assert.sameValue(Math.log10(+0), Number.NEGATIVE_INFINITY,
+ "Math.log10 produces incorrect output for +0");
+assert.sameValue(Math.log10(-0.9), Number.NaN,
+ "Math.log10 produces incorrect output for -0.9");
+assert.sameValue(Math.log10(NaN), Number.NaN,
+ "Math.log10 produces incorrect output for NaN");
+assert.sameValue(Math.log10(-10), Number.NaN,
+ "Math.log10 produces incorrect output for -10");
+assert.sameValue(Math.log10(null), Number.NEGATIVE_INFINITY,
+ "Math.log10 produces incorrect output for null");
+assert.sameValue(Math.log10(undefined), Number.NaN,
+ "Math.log10 produces incorrect output for undefined");
+assert.sameValue(Math.log10(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
+ "Math.log10 produces incorrect output for Number.POSITIVE_INFINITY");
+assert.sameValue(Math.log10(1), 0,
+ "Math.log10 produces incorrect output for 1");
+assert.sameValue(Math.log10(10.00), 1,
+ "Math.log10 produces incorrect output for 10.00");
+assert.sameValue(Math.log10(100.00), 2,
+ "Math.log10 produces incorrect output for 100.00");
+assert.sameValue(Math.log10(1000.00), 3,
+ "Math.log10 produces incorrect output for 1000.00");
+
diff --git a/test/built-ins/Math/log2/log2-basicTests.js b/test/built-ins/Math/log2/log2-basicTests.js index bd3bb510a..3feeb1df4 100644 --- a/test/built-ins/Math/log2/log2-basicTests.js +++ b/test/built-ins/Math/log2/log2-basicTests.js @@ -1,34 +1,34 @@ -// Copyright 2015 Microsoft Corporation. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -description: Math.Log2 with sample values. -es6id: 20.2.2.23 ----*/ - -assert.sameValue(Math.log2(-0), Number.NEGATIVE_INFINITY, - "Math.log2 produces incorrect output for -0"); -assert.sameValue(Math.log2(+0), Number.NEGATIVE_INFINITY, - "Math.log2 produces incorrect output for +0"); -assert.sameValue(Math.log2(-0.9), NaN, - "Math.log2 produces incorrect output for -0.9"); -assert.sameValue(Math.log2(NaN), NaN, - "Math.log2 produces incorrect output for NaN"); -assert.sameValue(Math.log2(-10), NaN, - "Math.log2 produces incorrect output for -10"); -assert.sameValue(Math.log2(-Infinity), NaN, - "Math.log2 produces incorrect output for -Infinity"); -assert.sameValue(Math.log2(null), Number.NEGATIVE_INFINITY, - "Math.log2 produces incorrect output for null"); -assert.sameValue(Math.log2(undefined), NaN, - "Math.log2 produces incorrect output for undefined"); -assert.sameValue(Math.log2(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, - "Math.log2 produces incorrect output for Number.POSITIVE_INFINITY"); -assert.sameValue(Math.log2(1), 0, - "Math.log2 produces incorrect output for 1"); -assert.sameValue(Math.log2(2.00), 1, - "Math.log2 produces incorrect output for 2.00"); -assert.sameValue(Math.log2(4.00), 2, - "Math.log2 produces incorrect output for 4.00"); -assert.sameValue(Math.log2(8.00), 3, - "Math.log2 produces incorrect output for 8.00"); +// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: Math.Log2 with sample values.
+es6id: 20.2.2.23
+---*/
+
+assert.sameValue(Math.log2(-0), Number.NEGATIVE_INFINITY,
+ "Math.log2 produces incorrect output for -0");
+assert.sameValue(Math.log2(+0), Number.NEGATIVE_INFINITY,
+ "Math.log2 produces incorrect output for +0");
+assert.sameValue(Math.log2(-0.9), NaN,
+ "Math.log2 produces incorrect output for -0.9");
+assert.sameValue(Math.log2(NaN), NaN,
+ "Math.log2 produces incorrect output for NaN");
+assert.sameValue(Math.log2(-10), NaN,
+ "Math.log2 produces incorrect output for -10");
+assert.sameValue(Math.log2(-Infinity), NaN,
+ "Math.log2 produces incorrect output for -Infinity");
+assert.sameValue(Math.log2(null), Number.NEGATIVE_INFINITY,
+ "Math.log2 produces incorrect output for null");
+assert.sameValue(Math.log2(undefined), NaN,
+ "Math.log2 produces incorrect output for undefined");
+assert.sameValue(Math.log2(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
+ "Math.log2 produces incorrect output for Number.POSITIVE_INFINITY");
+assert.sameValue(Math.log2(1), 0,
+ "Math.log2 produces incorrect output for 1");
+assert.sameValue(Math.log2(2.00), 1,
+ "Math.log2 produces incorrect output for 2.00");
+assert.sameValue(Math.log2(4.00), 2,
+ "Math.log2 produces incorrect output for 4.00");
+assert.sameValue(Math.log2(8.00), 3,
+ "Math.log2 produces incorrect output for 8.00");
diff --git a/test/built-ins/Math/max/S15.8.2.11_A1.js b/test/built-ins/Math/max/S15.8.2.11_A1.js index 4fb9984f5..a305b5b25 100644 --- a/test/built-ins/Math/max/S15.8.2.11_A1.js +++ b/test/built-ins/Math/max/S15.8.2.11_A1.js @@ -10,5 +10,5 @@ description: Checking if Math.max() equals to -Infinity // CHECK#1 if (Math.max() != -Infinity) { - $ERROR("#1: 'Math.max() != -Infinity'"); + $ERROR("#1: 'Math.max() != -Infinity'"); } diff --git a/test/built-ins/Math/max/S15.8.2.11_A2.js b/test/built-ins/Math/max/S15.8.2.11_A2.js index 8507e9102..04aea82ec 100644 --- a/test/built-ins/Math/max/S15.8.2.11_A2.js +++ b/test/built-ins/Math/max/S15.8.2.11_A2.js @@ -25,16 +25,16 @@ var valnum = 7; var args = new Array(); for (var i = 0; i <= 1; i++) { - args[i] = NaN; - for (var j = 0; j < valnum; j++) - { - args[1 - i] = vals[j]; - assert.sameValue( - Math.max(args[0], args[1]), - NaN, - "max(" + args[0] + ", " + args[1] + ")" - ); - } + args[i] = NaN; + for (var j = 0; j < valnum; j++) + { + args[1-i] = vals[j]; + assert.sameValue( + Math.max(args[0], args[1]), + NaN, + "max(" + args[0] + ", " + args[1] + ")" + ); + } } // CHECK #3 @@ -42,25 +42,25 @@ var k = 1; var l = 2; for (var i = 0; i <= 2; i++) { - args[i] = NaN; - if (i === 1) - { - k = 0; - } else if (i === 2) - { - l = 1; - } - for (var j = 0; j < valnum; j++) - { - for (var jj = 0; jj < valnum; jj++) - { - args[k] = vals[j]; - args[l] = vals[jj]; - assert.sameValue( - Math.max(args[0], args[1], args[2]), - NaN, - "max(" + args[0] + ", " + args[1] + ", " + args[2] + ")" - ); - } - } + args[i] = NaN; + if (i === 1) + { + k = 0; + } else if (i === 2) + { + l = 1; + } + for (var j = 0; j < valnum; j++) + { + for (var jj = 0; jj < valnum; jj++) + { + args[k] = vals[j]; + args[l] = vals[jj]; + assert.sameValue( + Math.max(args[0], args[1], args[2]), + NaN, + "max(" + args[0] + ", " + args[1] + ", " + args[2] + ")" + ); + } + } } diff --git a/test/built-ins/Math/max/S15.8.2.11_A4.js b/test/built-ins/Math/max/S15.8.2.11_A4.js index 7055503d3..fab69fcf3 100644 --- a/test/built-ins/Math/max/S15.8.2.11_A4.js +++ b/test/built-ins/Math/max/S15.8.2.11_A4.js @@ -9,15 +9,15 @@ description: Checking if Math.max.length property is defined and equals to 2 // CHECK#1 if (typeof Math.max !== "function") { - $ERROR('#1: Math.max method is not defined'); + $ERROR('#1: Math.max method is not defined'); } // CHECK#2 if (typeof Math.max.length === "undefined") { - $ERROR('#2: length property of Math.max method is undefined'); + $ERROR('#2: length property of Math.max method is undefined'); } // CHECK#3 if (Math.max.length !== 2) { - $ERROR('#3: The length property of the Math.max method is not 2'); + $ERROR('#3: The length property of the Math.max method is not 2'); } diff --git a/test/built-ins/Math/min/S15.8.2.12_A1.js b/test/built-ins/Math/min/S15.8.2.12_A1.js index 0a396aead..ef52ac785 100644 --- a/test/built-ins/Math/min/S15.8.2.12_A1.js +++ b/test/built-ins/Math/min/S15.8.2.12_A1.js @@ -10,5 +10,5 @@ description: Checking if Math.min() equals to +Infinity // CHECK#1 if (Math.min() != +Infinity) { - $ERROR("#1: 'Math.min() != +Infinity'"); + $ERROR("#1: 'Math.min() != +Infinity'"); } diff --git a/test/built-ins/Math/min/S15.8.2.12_A2.js b/test/built-ins/Math/min/S15.8.2.12_A2.js index 2c90b2865..3ec27bf76 100644 --- a/test/built-ins/Math/min/S15.8.2.12_A2.js +++ b/test/built-ins/Math/min/S15.8.2.12_A2.js @@ -26,16 +26,16 @@ var valnum = 7; var args = new Array(); for (var i = 0; i <= 1; i++) { - args[i] = NaN; - for (var j = 0; j < valnum; j++) - { - args[1 - i] = vals[j]; - assert.sameValue( - Math.min(args[0], args[1]), - NaN, - "min(" + args[0] + ", " + args[1] + ")" - ); - } + args[i] = NaN; + for (var j = 0; j < valnum; j++) + { + args[1-i] = vals[j]; + assert.sameValue( + Math.min(args[0], args[1]), + NaN, + "min(" + args[0] + ", " + args[1] + ")" + ); + } } // CHECK #3 @@ -43,25 +43,25 @@ var k = 1; var l = 2; for (var i = 0; i <= 2; i++) { - args[i] = NaN; - if (i === 1) - { - k = 0; - } else if (i === 2) - { - l = 1; - } - for (var j = 0; j < valnum; j++) - { - for (var jj = 0; jj < valnum; jj++) - { - args[k] = vals[j]; - args[l] = vals[jj]; - assert.sameValue( - Math.min(args[0], args[1], args[2]), - NaN, - "min(" + args[0] + ", " + args[1] + ", " + args[2] + ")" - ); - } - } + args[i] = NaN; + if (i === 1) + { + k = 0; + } else if (i === 2) + { + l = 1; + } + for (var j = 0; j < valnum; j++) + { + for (var jj = 0; jj < valnum; jj++) + { + args[k] = vals[j]; + args[l] = vals[jj]; + assert.sameValue( + Math.min(args[0], args[1], args[2]), + NaN, + "min(" + args[0] + ", " + args[1] + ", " + args[2] + ")" + ); + } + } } diff --git a/test/built-ins/Math/min/S15.8.2.12_A4.js b/test/built-ins/Math/min/S15.8.2.12_A4.js index e4f16bed2..d2555044c 100644 --- a/test/built-ins/Math/min/S15.8.2.12_A4.js +++ b/test/built-ins/Math/min/S15.8.2.12_A4.js @@ -9,15 +9,15 @@ description: Checking if Math.min.length property is defined and equals to 2 // CHECK#1 if (typeof Math.min !== "function") { - $ERROR('#1: Math.min method is not defined'); + $ERROR('#1: Math.min method is not defined'); } // CHECK#2 if (typeof Math.min.length === "undefined") { - $ERROR('#2: length property of Math.min method is undefined'); + $ERROR('#2: length property of Math.min method is undefined'); } // CHECK#3 if (Math.min.length !== 2) { - $ERROR('#3: The length property of the Math.min method is not 2'); + $ERROR('#3: The length property of the Math.min method is not 2'); } diff --git a/test/built-ins/Math/pow/applying-the-exp-operator_A10.js b/test/built-ins/Math/pow/applying-the-exp-operator_A10.js index fc788b35f..a21cdb0be 100644 --- a/test/built-ins/Math/pow/applying-the-exp-operator_A10.js +++ b/test/built-ins/Math/pow/applying-the-exp-operator_A10.js @@ -19,8 +19,8 @@ var basenum = 6; for (var i = 0; i < basenum; i++) { - if (Math.pow(base[i], exponent) !== +Infinity) - { - $ERROR("#1: Math.pow(" + base[i] + ", " + exponent + ") !== +Infinity"); - } + if (Math.pow(base[i],exponent) !== +Infinity) + { + $ERROR("#1: Math.pow(" + base[i] + ", " + exponent + ") !== +Infinity"); + } } diff --git a/test/built-ins/Math/pow/applying-the-exp-operator_A11.js b/test/built-ins/Math/pow/applying-the-exp-operator_A11.js index f44e1d30c..536b51474 100644 --- a/test/built-ins/Math/pow/applying-the-exp-operator_A11.js +++ b/test/built-ins/Math/pow/applying-the-exp-operator_A11.js @@ -17,8 +17,8 @@ var exponentnum = 4; for (var i = 0; i < exponentnum; i++) { - if (Math.pow(base, exponent[i]) !== +Infinity) - { - $ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity"); - } + if (Math.pow(base,exponent[i]) !== +Infinity) + { + $ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity"); + } } diff --git a/test/built-ins/Math/pow/applying-the-exp-operator_A13.js b/test/built-ins/Math/pow/applying-the-exp-operator_A13.js index daac829f4..9096d37fb 100644 --- a/test/built-ins/Math/pow/applying-the-exp-operator_A13.js +++ b/test/built-ins/Math/pow/applying-the-exp-operator_A13.js @@ -16,8 +16,8 @@ var exponentnum = 3; for (var i = 0; i < exponentnum; i++) { - if (Math.pow(base, exponent[i]) !== -Infinity) - { - $ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== -Infinity"); - } + if (Math.pow(base,exponent[i]) !== -Infinity) + { + $ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== -Infinity"); + } } diff --git a/test/built-ins/Math/pow/applying-the-exp-operator_A14.js b/test/built-ins/Math/pow/applying-the-exp-operator_A14.js index e5ab5e270..a987088d6 100644 --- a/test/built-ins/Math/pow/applying-the-exp-operator_A14.js +++ b/test/built-ins/Math/pow/applying-the-exp-operator_A14.js @@ -18,8 +18,8 @@ var exponentnum = 5; for (var i = 0; i < exponentnum; i++) { - if (Math.pow(base, exponent[i]) !== +Infinity) - { - $ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity"); - } + if (Math.pow(base,exponent[i]) !== +Infinity) + { + $ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity"); + } } diff --git a/test/built-ins/Math/pow/applying-the-exp-operator_A18.js b/test/built-ins/Math/pow/applying-the-exp-operator_A18.js index 565353c2c..ddf01dada 100644 --- a/test/built-ins/Math/pow/applying-the-exp-operator_A18.js +++ b/test/built-ins/Math/pow/applying-the-exp-operator_A18.js @@ -17,8 +17,8 @@ var exponentnum = 4; for (var i = 0; i < exponentnum; i++) { - if (Math.pow(base, exponent[i]) !== +Infinity) - { - $ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity"); - } + if (Math.pow(base,exponent[i]) !== +Infinity) + { + $ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity"); + } } diff --git a/test/built-ins/Math/pow/applying-the-exp-operator_A2.js b/test/built-ins/Math/pow/applying-the-exp-operator_A2.js index 41d840c29..d0dc29cc2 100644 --- a/test/built-ins/Math/pow/applying-the-exp-operator_A2.js +++ b/test/built-ins/Math/pow/applying-the-exp-operator_A2.js @@ -22,8 +22,8 @@ var basenum = 9; for (var i = 0; i < basenum; i++) { - if (Math.pow(base[i], exponent) !== 1) - { - $ERROR("#1: Math.pow(" + base[i] + ", " + exponent + ") !== 1"); - } + if (Math.pow(base[i],exponent) !== 1) + { + $ERROR("#1: Math.pow(" + base[i] + ", " + exponent + ") !== 1"); + } } diff --git a/test/built-ins/Math/pow/applying-the-exp-operator_A21.js b/test/built-ins/Math/pow/applying-the-exp-operator_A21.js index 5a2cf3b0e..f5b246ed6 100644 --- a/test/built-ins/Math/pow/applying-the-exp-operator_A21.js +++ b/test/built-ins/Math/pow/applying-the-exp-operator_A21.js @@ -16,8 +16,8 @@ var exponentnum = 3; for (var i = 0; i < exponentnum; i++) { - if (Math.pow(base, exponent[i]) !== -Infinity) - { - $ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== -Infinity"); - } + if (Math.pow(base,exponent[i]) !== -Infinity) + { + $ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== -Infinity"); + } } diff --git a/test/built-ins/Math/pow/applying-the-exp-operator_A22.js b/test/built-ins/Math/pow/applying-the-exp-operator_A22.js index 807519549..de41acd01 100644 --- a/test/built-ins/Math/pow/applying-the-exp-operator_A22.js +++ b/test/built-ins/Math/pow/applying-the-exp-operator_A22.js @@ -18,8 +18,8 @@ var exponentnum = 5; for (var i = 0; i < exponentnum; i++) { - if (Math.pow(base, exponent[i]) !== +Infinity) - { - $ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity"); - } + if (Math.pow(base, exponent[i]) !== +Infinity) + { + $ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity"); + } } diff --git a/test/built-ins/Math/pow/applying-the-exp-operator_A23.js b/test/built-ins/Math/pow/applying-the-exp-operator_A23.js index 4104d287b..826a4305b 100644 --- a/test/built-ins/Math/pow/applying-the-exp-operator_A23.js +++ b/test/built-ins/Math/pow/applying-the-exp-operator_A23.js @@ -27,7 +27,7 @@ exponent[7] = Math.PI; var exponentnum = 8; for (var i = 0; i < basenum; i++) { - for (var j = 0; j < exponentnum; j++) { + for (var j = 0; j < exponentnum; j++) { assert.sameValue( Math.pow(base[i], exponent[j]), NaN, diff --git a/test/built-ins/Math/pow/applying-the-exp-operator_A3.js b/test/built-ins/Math/pow/applying-the-exp-operator_A3.js index 7fa5ecc46..e0edd6acf 100644 --- a/test/built-ins/Math/pow/applying-the-exp-operator_A3.js +++ b/test/built-ins/Math/pow/applying-the-exp-operator_A3.js @@ -22,8 +22,8 @@ var basenum = 9; for (var i = 0; i < basenum; i++) { - if (Math.pow(base[i], exponent) !== 1) - { - $ERROR("#1: Math.pow(" + base[i] + ", -0) !== 1"); - } + if (Math.pow(base[i],exponent) !== 1) + { + $ERROR("#1: Math.pow(" + base[i] + ", -0) !== 1"); + } } diff --git a/test/built-ins/Math/pow/applying-the-exp-operator_A5.js b/test/built-ins/Math/pow/applying-the-exp-operator_A5.js index 1d8fa231a..a5bf6f33a 100644 --- a/test/built-ins/Math/pow/applying-the-exp-operator_A5.js +++ b/test/built-ins/Math/pow/applying-the-exp-operator_A5.js @@ -19,8 +19,8 @@ var basenum = 6; for (var i = 0; i < basenum; i++) { - if (Math.pow(base[i], exponent) !== +Infinity) - { - $ERROR("#1: Math.pow(" + base[i] + ", " + exponent + ") !== +Infinity"); - } + if (Math.pow(base[i],exponent) !== +Infinity) + { + $ERROR("#1: Math.pow(" + base[i] + ", " + exponent + ") !== +Infinity"); + } } diff --git a/test/built-ins/Math/random/S15.8.2.14_A1.js b/test/built-ins/Math/random/S15.8.2.14_A1.js index 4b5db856b..10cc9f466 100644 --- a/test/built-ins/Math/random/S15.8.2.14_A1.js +++ b/test/built-ins/Math/random/S15.8.2.14_A1.js @@ -14,15 +14,15 @@ description: > // CHECK#1 for (var i = 0; i < 100; i++) { - var val = Math.random(); + var val = Math.random(); - assert.sameValue( - typeof val, 'number', 'should not produce a non-numeric value: ' + val - ); - assert.notSameValue(val, NaN, 'should not produce NaN'); + assert.sameValue( + typeof val, 'number', 'should not produce a non-numeric value: ' + val + ); + assert.notSameValue(val, NaN, 'should not produce NaN'); - if (val < 0 || val >= 1) - { - $ERROR("#1: Math.random() = " + val); - } + if (val < 0 || val >= 1) + { + $ERROR("#1: Math.random() = " + val); + } } diff --git a/test/built-ins/Math/round/S15.8.2.15_A4.js b/test/built-ins/Math/round/S15.8.2.15_A4.js index b5743303f..cfc81a02a 100644 --- a/test/built-ins/Math/round/S15.8.2.15_A4.js +++ b/test/built-ins/Math/round/S15.8.2.15_A4.js @@ -11,5 +11,5 @@ description: Checking if Math.round(x) is +Infinity, where x is +Infinity var x = +Infinity; if (Math.round(x) !== +Infinity) { - $ERROR("#1: 'var x=+Infinity; Math.round(x) !== +Infinity'"); + $ERROR("#1: 'var x=+Infinity; Math.round(x) !== +Infinity'"); } diff --git a/test/built-ins/Math/round/S15.8.2.15_A5.js b/test/built-ins/Math/round/S15.8.2.15_A5.js index 0447ef01c..8c0fff3b7 100644 --- a/test/built-ins/Math/round/S15.8.2.15_A5.js +++ b/test/built-ins/Math/round/S15.8.2.15_A5.js @@ -11,5 +11,5 @@ description: Checking if Math.round(x) is -Infinity, where x is -Infinity var x = -Infinity; if (Math.round(x) !== -Infinity) { - $ERROR("#1: 'var x=-Infinity; Math.round(x) !== -Infinity'"); + $ERROR("#1: 'var x=-Infinity; Math.round(x) !== -Infinity'"); } diff --git a/test/built-ins/Math/round/S15.8.2.15_A6.js b/test/built-ins/Math/round/S15.8.2.15_A6.js index a96cd1124..ffb74f313 100644 --- a/test/built-ins/Math/round/S15.8.2.15_A6.js +++ b/test/built-ins/Math/round/S15.8.2.15_A6.js @@ -15,25 +15,25 @@ description: > // CHECK#1 for (var i = 0; i <= 1000; i++) { - var x = i / 10.0; - if (Math.round(x) !== Math.floor(x + 0.5)) - { - $ERROR("#1: 'x = " + x + "; Math.round(x) !== Math.floor(x + 0.5)'") - } + var x = i/10.0; + if (Math.round(x) !== Math.floor(x + 0.5)) + { + $ERROR("#1: 'x = " + x + "; Math.round(x) !== Math.floor(x + 0.5)'") + } } for (i = -5; i >= -1000; i--) { - if (i === -5) - { - x = -0.500000000000001; - } else - { - x = i / 10.0; - } - - if (Math.round(x) !== Math.floor(x + 0.5)) - { - $ERROR("#2: 'x = " + x + "; Math.round(x) !== Math.floor(x + 0.5)'") - } + if (i === -5) + { + x = -0.500000000000001; + } else + { + x = i/10.0; + } + + if (Math.round(x) !== Math.floor(x + 0.5)) + { + $ERROR("#2: 'x = " + x + "; Math.round(x) !== Math.floor(x + 0.5)'") + } } diff --git a/test/built-ins/Math/round/S15.8.2.15_A7.js b/test/built-ins/Math/round/S15.8.2.15_A7.js index ed92c8bf5..ad26e408e 100644 --- a/test/built-ins/Math/round/S15.8.2.15_A7.js +++ b/test/built-ins/Math/round/S15.8.2.15_A7.js @@ -21,7 +21,7 @@ if (1 / Math.round(-0.5) !== 1 / -0) { // CHECK#2 if (1 / Math.round(-0.25) !== 1 / -0) { - $ERROR("#2: '1 / Math.round(-0.25) !== 1 / -0'"); + $ERROR("#2: '1 / Math.round(-0.25) !== 1 / -0'"); } // CHECK#3 diff --git a/test/built-ins/Math/sign/sign-specialVals.js b/test/built-ins/Math/sign/sign-specialVals.js index 9026c223c..0e63fe895 100644 --- a/test/built-ins/Math/sign/sign-specialVals.js +++ b/test/built-ins/Math/sign/sign-specialVals.js @@ -1,20 +1,20 @@ -// Copyright 2015 Microsoft Corporation. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -description: > - Returns the sign of the x, indicating whether x is positive, negative or zero. -es6id: 20.2.2.29 ----*/ - -assert.sameValue(Math.sign(NaN), NaN, "NaN"); -assert.sameValue(Math.sign(-0), -0, "-0"); -assert.sameValue(Math.sign(0), 0, "0"); - -assert.sameValue(Math.sign(-0.000001), -1, "-0.000001"); -assert.sameValue(Math.sign(-1), -1, "-1"); -assert.sameValue(Math.sign(-Infinity), -1, "-Infinity"); - -assert.sameValue(Math.sign(0.000001), 1, "0.000001"); -assert.sameValue(Math.sign(1), 1, "1"); -assert.sameValue(Math.sign(Infinity), 1, "Infinity"); +// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: >
+ Returns the sign of the x, indicating whether x is positive, negative or zero.
+es6id: 20.2.2.29
+---*/
+
+assert.sameValue(Math.sign(NaN), NaN, "NaN");
+assert.sameValue(Math.sign(-0), -0, "-0");
+assert.sameValue(Math.sign(0), 0, "0");
+
+assert.sameValue(Math.sign(-0.000001), -1, "-0.000001");
+assert.sameValue(Math.sign(-1), -1, "-1");
+assert.sameValue(Math.sign(-Infinity), -1, "-Infinity");
+
+assert.sameValue(Math.sign(0.000001), 1, "0.000001");
+assert.sameValue(Math.sign(1), 1, "1");
+assert.sameValue(Math.sign(Infinity), 1, "Infinity");
diff --git a/test/built-ins/Math/sinh/sinh-specialVals.js b/test/built-ins/Math/sinh/sinh-specialVals.js index beda3cd0f..cc93825cb 100644 --- a/test/built-ins/Math/sinh/sinh-specialVals.js +++ b/test/built-ins/Math/sinh/sinh-specialVals.js @@ -1,18 +1,18 @@ -// Copyright 2015 Microsoft Corporation. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -description: Math.sinh with special values -es6id: 20.2.2.31 ----*/ - -assert.sameValue(Math.sinh(NaN), Number.NaN, - "Math.sinh produces incorrect output for NaN"); -assert.sameValue(Math.sinh(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY, - "Math.sinh should produce negative infinity for Number.NEGATIVE_INFINITY"); -assert.sameValue(Math.sinh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, - "Math.sinh should produce positive infinity for Number.POSITIVE_INFINITY"); -assert.sameValue(1 / Math.sinh(-0), Number.NEGATIVE_INFINITY, - "Math.sinh should produce -0 for -0"); -assert.sameValue(1 / Math.sinh(0), Number.POSITIVE_INFINITY, - "Math.sinh should produce +0 for +0"); +// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: Math.sinh with special values
+es6id: 20.2.2.31
+---*/
+
+assert.sameValue(Math.sinh(NaN), Number.NaN,
+ "Math.sinh produces incorrect output for NaN");
+assert.sameValue(Math.sinh(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY,
+ "Math.sinh should produce negative infinity for Number.NEGATIVE_INFINITY");
+assert.sameValue(Math.sinh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
+ "Math.sinh should produce positive infinity for Number.POSITIVE_INFINITY");
+assert.sameValue(1/Math.sinh(-0), Number.NEGATIVE_INFINITY,
+ "Math.sinh should produce -0 for -0");
+assert.sameValue(1/Math.sinh(0), Number.POSITIVE_INFINITY,
+ "Math.sinh should produce +0 for +0");
diff --git a/test/built-ins/Math/sqrt/S15.8.2.17_A5.js b/test/built-ins/Math/sqrt/S15.8.2.17_A5.js index 8cfd5fc32..45bf9cba5 100644 --- a/test/built-ins/Math/sqrt/S15.8.2.17_A5.js +++ b/test/built-ins/Math/sqrt/S15.8.2.17_A5.js @@ -11,5 +11,5 @@ description: Checking if Math.sqrt(+Infinity) is +Infinity var x = +Infinity; if (Math.sqrt(x) !== +Infinity) { - $ERROR("#1: 'var x=+Infinity; Math.sqrt(x) !== +Infinity'"); + $ERROR("#1: 'var x=+Infinity; Math.sqrt(x) !== +Infinity'"); } diff --git a/test/built-ins/Math/tanh/tanh-specialVals.js b/test/built-ins/Math/tanh/tanh-specialVals.js index a26b2af2a..27e9e5752 100644 --- a/test/built-ins/Math/tanh/tanh-specialVals.js +++ b/test/built-ins/Math/tanh/tanh-specialVals.js @@ -1,18 +1,18 @@ -// Copyright 2015 Microsoft Corporation. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -description: Math.tanh with special values -es6id: 20.2.2.34 ----*/ - -assert.sameValue(Math.tanh(NaN), Number.NaN, - "Math.tanh produces incorrect output for NaN"); -assert.sameValue(Math.tanh(Number.NEGATIVE_INFINITY), -1, - "Math.tanh should produce -1 for Number.NEGATIVE_INFINITY"); -assert.sameValue(Math.tanh(Number.POSITIVE_INFINITY), 1, - "Math.tanh should produce 1 for Number.POSITIVE_INFINITY"); -assert.sameValue(1 / Math.tanh(-0), Number.NEGATIVE_INFINITY, - "Math.tanh should produce -0 for -0"); -assert.sameValue(1 / Math.tanh(0), Number.POSITIVE_INFINITY, - "Math.tanh should produce +0 for +0"); +// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: Math.tanh with special values
+es6id: 20.2.2.34
+---*/
+
+assert.sameValue(Math.tanh(NaN), Number.NaN,
+ "Math.tanh produces incorrect output for NaN");
+assert.sameValue(Math.tanh(Number.NEGATIVE_INFINITY), -1,
+ "Math.tanh should produce -1 for Number.NEGATIVE_INFINITY");
+assert.sameValue(Math.tanh(Number.POSITIVE_INFINITY), 1,
+ "Math.tanh should produce 1 for Number.POSITIVE_INFINITY");
+assert.sameValue(1/Math.tanh(-0), Number.NEGATIVE_INFINITY,
+ "Math.tanh should produce -0 for -0");
+assert.sameValue(1/Math.tanh(0), Number.POSITIVE_INFINITY,
+ "Math.tanh should produce +0 for +0");
diff --git a/test/built-ins/Math/trunc/trunc-sampleTests.js b/test/built-ins/Math/trunc/trunc-sampleTests.js index a99c6cb50..92834c730 100644 --- a/test/built-ins/Math/trunc/trunc-sampleTests.js +++ b/test/built-ins/Math/trunc/trunc-sampleTests.js @@ -1,47 +1,47 @@ -// Copyright 2015 Microsoft Corporation. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -description: sample tests for trunc -es6id: 20.2.2.35 ----*/ - -assert.sameValue(1 / Math.trunc(0.02047410048544407), Number.POSITIVE_INFINITY, - "Math.trunc should produce +0 for values between 0 and 1"); -assert.sameValue(1 / Math.trunc(0.00000000000000001), Number.POSITIVE_INFINITY, - "Math.trunc should produce +0 for values between 0 and 1"); -assert.sameValue(1 / Math.trunc(0.9999999999999999), Number.POSITIVE_INFINITY, - "Math.trunc should produce +0 for values between 0 and 1"); -assert.sameValue(1 / Math.trunc(Number.EPSILON), Number.POSITIVE_INFINITY, - "Math.trunc should produce +0 for values between 0 and 1"); -assert.sameValue(1 / Math.trunc(Number.MIN_VALUE), Number.POSITIVE_INFINITY, - "Math.trunc should produce +0 for values between 0 and 1"); - -assert.sameValue(1 / Math.trunc(-0.02047410048544407), Number.NEGATIVE_INFINITY, - "Math.trunc should produce -0 for values between -1 and 0"); -assert.sameValue(1 / Math.trunc(-0.00000000000000001), Number.NEGATIVE_INFINITY, - "Math.trunc should produce -0 for values between -1 and 0"); -assert.sameValue(1 / Math.trunc(-0.9999999999999999), Number.NEGATIVE_INFINITY, - "Math.trunc should produce -0 for values between -1 and 0"); -assert.sameValue(1 / Math.trunc(-Number.EPSILON), Number.NEGATIVE_INFINITY, - "Math.trunc should produce -0 for values between -1 and 0"); -assert.sameValue(1 / Math.trunc(-Number.MIN_VALUE), Number.NEGATIVE_INFINITY, - "Math.trunc should produce -0 for values between -1 and 0"); - -assert.sameValue(Math.trunc(Number.MAX_VALUE), Math.floor(Number.MAX_VALUE), - "Math.trunc produces incorrect result for Number.MAX_VALUE"); -assert.sameValue(Math.trunc(10), Math.floor(10), - "Math.trunc produces incorrect result for 10"); -assert.sameValue(Math.trunc(3.9), Math.floor(3.9), - "Math.trunc produces incorrect result for 3.9"); -assert.sameValue(Math.trunc(4.9), Math.floor(4.9), - "Math.trunc produces incorrect result for 4.9"); - -assert.sameValue(Math.trunc(-Number.MAX_VALUE), Math.ceil(-Number.MAX_VALUE), - "Math.trunc produces incorrect result for -Number.MAX_VALUE"); -assert.sameValue(Math.trunc(-10), Math.ceil(-10), - "Math.trunc produces incorrect result for -10"); -assert.sameValue(Math.trunc(-3.9), Math.ceil(-3.9), - "Math.trunc produces incorrect result for -3.9"); -assert.sameValue(Math.trunc(-4.9), Math.ceil(-4.9), - "Math.trunc produces incorrect result for -4.9"); +// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: sample tests for trunc
+es6id: 20.2.2.35
+---*/
+
+assert.sameValue(1 / Math.trunc(0.02047410048544407), Number.POSITIVE_INFINITY,
+ "Math.trunc should produce +0 for values between 0 and 1");
+assert.sameValue(1 / Math.trunc(0.00000000000000001), Number.POSITIVE_INFINITY,
+ "Math.trunc should produce +0 for values between 0 and 1");
+assert.sameValue(1 / Math.trunc(0.9999999999999999), Number.POSITIVE_INFINITY,
+ "Math.trunc should produce +0 for values between 0 and 1");
+assert.sameValue(1 / Math.trunc(Number.EPSILON), Number.POSITIVE_INFINITY,
+ "Math.trunc should produce +0 for values between 0 and 1");
+assert.sameValue(1 / Math.trunc(Number.MIN_VALUE), Number.POSITIVE_INFINITY,
+ "Math.trunc should produce +0 for values between 0 and 1");
+
+assert.sameValue(1 / Math.trunc(-0.02047410048544407), Number.NEGATIVE_INFINITY,
+ "Math.trunc should produce -0 for values between -1 and 0");
+assert.sameValue(1 / Math.trunc(-0.00000000000000001), Number.NEGATIVE_INFINITY,
+ "Math.trunc should produce -0 for values between -1 and 0");
+assert.sameValue(1 / Math.trunc(-0.9999999999999999), Number.NEGATIVE_INFINITY,
+ "Math.trunc should produce -0 for values between -1 and 0");
+assert.sameValue(1 / Math.trunc(-Number.EPSILON), Number.NEGATIVE_INFINITY,
+ "Math.trunc should produce -0 for values between -1 and 0");
+assert.sameValue(1 / Math.trunc(-Number.MIN_VALUE), Number.NEGATIVE_INFINITY,
+ "Math.trunc should produce -0 for values between -1 and 0");
+
+assert.sameValue(Math.trunc(Number.MAX_VALUE), Math.floor(Number.MAX_VALUE),
+ "Math.trunc produces incorrect result for Number.MAX_VALUE");
+assert.sameValue(Math.trunc(10), Math.floor(10),
+ "Math.trunc produces incorrect result for 10");
+assert.sameValue(Math.trunc(3.9), Math.floor(3.9),
+ "Math.trunc produces incorrect result for 3.9");
+assert.sameValue(Math.trunc(4.9), Math.floor(4.9),
+ "Math.trunc produces incorrect result for 4.9");
+
+assert.sameValue(Math.trunc(-Number.MAX_VALUE), Math.ceil(-Number.MAX_VALUE),
+ "Math.trunc produces incorrect result for -Number.MAX_VALUE");
+assert.sameValue(Math.trunc(-10), Math.ceil(-10),
+ "Math.trunc produces incorrect result for -10");
+assert.sameValue(Math.trunc(-3.9), Math.ceil(-3.9),
+ "Math.trunc produces incorrect result for -3.9");
+assert.sameValue(Math.trunc(-4.9), Math.ceil(-4.9),
+ "Math.trunc produces incorrect result for -4.9");
diff --git a/test/built-ins/Math/trunc/trunc-specialVals.js b/test/built-ins/Math/trunc/trunc-specialVals.js index 19efbf6b6..a1d6e1cb2 100644 --- a/test/built-ins/Math/trunc/trunc-specialVals.js +++ b/test/built-ins/Math/trunc/trunc-specialVals.js @@ -1,16 +1,16 @@ -// Copyright 2015 Microsoft Corporation. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -description: Math.trunc with sample values. -es6id: 20.2.2.35 ----*/ - -assert.sameValue(Math.trunc(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY, - "Math.trunc should produce negative infinity for Number.NEGATIVE_INFINITY"); -assert.sameValue(Math.trunc(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, - "Math.trunc should produce positive infinity for Number.POSITIVE_INFINITY"); -assert.sameValue(1 / Math.trunc(-0), Number.NEGATIVE_INFINITY, - "Math.trunc should produce -0 for -0"); -assert.sameValue(1 / Math.trunc(0), Number.POSITIVE_INFINITY, - "Math.trunc should produce +0 for +0"); +// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: Math.trunc with sample values.
+es6id: 20.2.2.35
+---*/
+
+assert.sameValue(Math.trunc(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY,
+ "Math.trunc should produce negative infinity for Number.NEGATIVE_INFINITY");
+assert.sameValue(Math.trunc(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
+ "Math.trunc should produce positive infinity for Number.POSITIVE_INFINITY");
+assert.sameValue(1/Math.trunc(-0), Number.NEGATIVE_INFINITY,
+ "Math.trunc should produce -0 for -0");
+assert.sameValue(1/Math.trunc(0), Number.POSITIVE_INFINITY,
+ "Math.trunc should produce +0 for +0");
|