Debian Codegraph @

js/src/tests/non262/Math/15.8.1.js

raw
1 /* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 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
7 /**
8 File Name: 15.8.1.js
9 ECMA Section: 15.8.1.js Value Properties of the Math Object
10 15.8.1.1 E
11 15.8.1.2 LN10
12 15.8.1.3 LN2
13 15.8.1.4 LOG2E
14 15.8.1.5 LOG10E
15 15.8.1.6 PI
16 15.8.1.7 SQRT1_2
17 15.8.1.8 SQRT2
18 Description: verify the values of some math constants
19 Author: [email protected]
20 Date: 7 july 1997
21
22 */
23 var SECTION = "15.8.1"
24 var TITLE = "Value Properties of the Math Object";
25
26 writeHeaderToLog( SECTION + " "+ TITLE);
27
28
29 new TestCase( "Math.E",
30 2.7182818284590452354,
31 Math.E );
32
33 new TestCase( "typeof Math.E",
34 "number",
35 typeof Math.E );
36
37 new TestCase( "Math.LN10",
38 2.302585092994046,
39 Math.LN10 );
40
41 new TestCase( "typeof Math.LN10",
42 "number",
43 typeof Math.LN10 );
44
45 new TestCase( "Math.LN2",
46 0.6931471805599453,
47 Math.LN2 );
48
49 new TestCase( "typeof Math.LN2",
50 "number",
51 typeof Math.LN2 );
52
53 new TestCase( "Math.LOG2E",
54 1.4426950408889634,
55 Math.LOG2E );
56
57 new TestCase( "typeof Math.LOG2E",
58 "number",
59 typeof Math.LOG2E );
60
61 new TestCase( "Math.LOG10E",
62 0.4342944819032518,
63 Math.LOG10E);
64
65 new TestCase( "typeof Math.LOG10E",
66 "number",
67 typeof Math.LOG10E);
68
69 new TestCase( "Math.PI",
70 3.14159265358979323846,
71 Math.PI );
72
73 new TestCase( "typeof Math.PI",
74 "number",
75 typeof Math.PI );
76
77 new TestCase( "Math.SQRT1_2",
78 0.7071067811865476,
79 Math.SQRT1_2);
80
81 new TestCase( "typeof Math.SQRT1_2",
82 "number",
83 typeof Math.SQRT1_2);
84
85 new TestCase( "Math.SQRT2",
86 1.4142135623730951,
87 Math.SQRT2 );
88
89 new TestCase( "typeof Math.SQRT2",
90 "number",
91 typeof Math.SQRT2 );
92
93 new TestCase( "var MATHPROPS='';for( p in Math ){ MATHPROPS +=p; };MATHPROPS",
94 "",
95 eval("var MATHPROPS='';for( p in Math ){ MATHPROPS +=p; };MATHPROPS") );
96
97 test();