Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Math/log1p/specific-results.js

raw
1 // Copyright (C) 2016 The V8 Project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 es6id: 20.2.2.21
6 esid: sec-math.log1p
7 description: >
8 Return specific results
9 info: |
10 Math.log1p ( x )
11
12 If x is NaN, the result is NaN.
13 If x is less than -1, the result is NaN.
14 If x is -1, the result is -∞.
15 If x is +0, the result is +0.
16 If x is -0, the result is -0.
17 If x is +∞, the result is +∞.
18 ---*/
19
20 assert.sameValue(Math.log1p(NaN), NaN, "NaN");
21 assert.sameValue(Math.log1p(-1.000001), NaN, "-1.000001");
22 assert.sameValue(Math.log1p(-2), NaN, "-2");
23 assert.sameValue(Math.log1p(-Infinity), NaN, "-Infinity");
24 assert.sameValue(Math.log1p(-1), -Infinity, "-1");
25 assert.sameValue(Math.log1p(0), 0, "0");
26 assert.sameValue(Math.log1p(-0), -0, "-0");
27 assert.sameValue(Math.log1p(Infinity), Infinity, "Infinity");