Debian Codegraph @

rhino/testsrc/tests/ecma/Math/15.8.2.16.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.16.js';
7
8 /**
9 File Name: 15.8.2.16.js
10 ECMA Section: 15.8.2.16 sin( x )
11 Description: return an approximation to the sine of the
12 argument. argument is expressed in radians
13 Author: [email protected]
14 Date: 7 july 1997
15
16 */
17 var SECTION = "15.8.2.16";
18 var VERSION = "ECMA_1";
19 startTest();
20 var TITLE = "Math.sin(x)";
21
22 writeHeaderToLog( SECTION + " "+ TITLE);
23
24 new TestCase( SECTION,
25 "Math.sin.length",
26 1,
27 Math.sin.length );
28
29 new TestCase( SECTION,
30 "Math.sin()",
31 Number.NaN,
32 Math.sin() );
33
34 new TestCase( SECTION,
35 "Math.sin(null)",
36 0,
37 Math.sin(null) );
38
39 new TestCase( SECTION,
40 "Math.sin(void 0)",
41 Number.NaN,
42 Math.sin(void 0) );
43
44 new TestCase( SECTION,
45 "Math.sin(false)",
46 0,
47 Math.sin(false) );
48
49 new TestCase( SECTION,
50 "Math.sin('2.356194490192')",
51 0.7071067811865,
52 Math.sin('2.356194490192') );
53
54 new TestCase( SECTION,
55 "Math.sin(NaN)",
56 Number.NaN,
57 Math.sin(Number.NaN) );
58
59 new TestCase( SECTION,
60 "Math.sin(0)",
61 0,
62 Math.sin(0) );
63
64 new TestCase( SECTION,
65 "Math.sin(-0)",
66 -0,
67 Math.sin(-0));
68
69 new TestCase( SECTION,
70 "Math.sin(Infinity)",
71 Number.NaN,
72 Math.sin(Number.POSITIVE_INFINITY));
73
74 new TestCase( SECTION,
75 "Math.sin(-Infinity)",
76 Number.NaN,
77 Math.sin(Number.NEGATIVE_INFINITY));
78
79 new TestCase( SECTION,
80 "Math.sin(0.7853981633974)",
81 0.7071067811865,
82 Math.sin(0.7853981633974));
83
84 new TestCase( SECTION,
85 "Math.sin(1.570796326795)",
86 1,
87 Math.sin(1.570796326795));
88
89 new TestCase( SECTION,
90 "Math.sin(2.356194490192)",
91 0.7071067811865,
92 Math.sin(2.356194490192));
93
94 new TestCase( SECTION,
95 "Math.sin(3.14159265359)",
96 0,
97 Math.sin(3.14159265359));
98
99 test();