expm1-specialVals.js (815B)
1 // Copyright 2015 Microsoft Corporation. All rights reserved. 2 // This code is governed by the license found in the LICENSE file. 3 4 /*--- 5 description: Math.expm1 with sample values. 6 es6id: 20.2.2.15 7 ---*/ 8 9 assert.sameValue(Math.expm1(NaN), Number.NaN, 10 "Math.expm1 produces incorrect output for NaN"); 11 assert.sameValue(Math.expm1(Number.NEGATIVE_INFINITY), -1, 12 "Math.expm1 should produce -1 for Number.NEGATIVE_INFINITY"); 13 assert.sameValue(Math.expm1(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY, 14 "Math.expm1 should produce POSITIVE infinity for Number.POSITIVE_INFINITY"); 15 assert.sameValue(1 / Math.expm1(-0), Number.NEGATIVE_INFINITY, 16 "Math.expm1 should produce -0 for -0"); 17 assert.sameValue(1 / Math.expm1(0), Number.POSITIVE_INFINITY, 18 "Math.expm1 should produce +0 for +0"); 19 20 reportCompare(0, 0);