Debian Codegraph @

rhino/testsrc/tests/ecma/Math/15.8.2.8.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 gTestfile = '15.8.2.8.js';
7
8 /**
9 File Name: 15.8.2.8.js
10 ECMA Section: 15.8.2.8 Math.exp(x)
11 Description: return an approximation to the exponential function of
12 the argument (e raised to the power of the argument)
13 special cases:
14 - if x is NaN return NaN
15 - if x is 0 return 1
16 - if x is -0 return 1
17 - if x is Infinity return Infinity
18 - if x is -Infinity return 0
19 Author: [email protected]
20 Date: 7 july 1997
21 */
22
23
24 var SECTION = "15.8.2.8";
25 var VERSION = "ECMA_1";
26 startTest();
27 var TITLE = "Math.exp(x)";
28
29 writeHeaderToLog( SECTION + " "+ TITLE);
30
31 new TestCase( SECTION,
32 "Math.exp.length",
33 1,
34 Math.exp.length );
35
36 new TestCase( SECTION,
37 "Math.exp()",
38 Number.NaN,
39 Math.exp() );
40
41 new TestCase( SECTION,
42 "Math.exp(null)",
43 1,
44 Math.exp(null) );
45
46 new TestCase( SECTION,
47 "Math.exp(void 0)",
48 Number.NaN,
49 Math.exp(void 0) );
50
51 new TestCase( SECTION,
52 "Math.exp(1)",
53 Math.E,
54 Math.exp(1) );
55
56 new TestCase( SECTION,
57 "Math.exp(true)",
58 Math.E,
59 Math.exp(true) );
60
61 new TestCase( SECTION,
62 "Math.exp(false)",
63 1,
64 Math.exp(false) );
65
66 new TestCase( SECTION,
67 "Math.exp('1')",
68 Math.E,
69 Math.exp('1') );
70
71 new TestCase( SECTION,
72 "Math.exp('0')",
73 1,
74 Math.exp('0') );
75
76 new TestCase( SECTION,
77 "Math.exp(NaN)",
78 Number.NaN,
79 Math.exp(Number.NaN) );
80
81 new TestCase( SECTION,
82 "Math.exp(0)",
83 1,
84 Math.exp(0) );
85
86 new TestCase( SECTION,
87 "Math.exp(-0)",
88 1,
89 Math.exp(-0) );
90
91 new TestCase( SECTION,
92 "Math.exp(Infinity)",
93 Number.POSITIVE_INFINITY,
94 Math.exp(Number.POSITIVE_INFINITY) );
95
96 new TestCase( SECTION,
97 "Math.exp(-Infinity)",
98 0,
99 Math.exp(Number.NEGATIVE_INFINITY) );
100
101 test();