Debian Codegraph @

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