|
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 |
|
7 /** |
|
8 File Name: 15.8.2.3.js |
|
9 ECMA Section: 15.8.2.3 asin( x ) |
|
10 Description: return an approximation to the arc sine of the |
|
11 argument. the result is expressed in radians and |
|
12 range is from -PI/2 to +PI/2. special cases: |
|
13 - if x is NaN, the result is NaN |
|
14 - if x > 1, the result is NaN |
|
15 - if x < -1, the result is NaN |
|
16 - if x == +0, the result is +0 |
|
17 - if x == -0, the result is -0 |
|
18 Author: christine@netscape.com |
|
19 Date: 7 july 1997 |
|
20 |
|
21 */ |
|
22 var SECTION = "15.8.2.3"; |
|
23 var VERSION = "ECMA_1"; |
|
24 startTest(); |
|
25 var TITLE = "Math.asin()"; |
|
26 |
|
27 writeHeaderToLog( SECTION + " "+ TITLE); |
|
28 |
|
29 new TestCase( SECTION, |
|
30 "Math.asin()", |
|
31 Number.NaN, |
|
32 Math.asin() ); |
|
33 |
|
34 new TestCase( SECTION, |
|
35 "Math.asin(void 0)", |
|
36 Number.NaN, |
|
37 Math.asin(void 0) ); |
|
38 |
|
39 new TestCase( SECTION, |
|
40 "Math.asin(null)", |
|
41 0, |
|
42 Math.asin(null) ); |
|
43 |
|
44 new TestCase( SECTION, |
|
45 "Math.asin(NaN)", |
|
46 Number.NaN, |
|
47 Math.asin(Number.NaN) ); |
|
48 |
|
49 new TestCase( SECTION, |
|
50 "Math.asin('string')", |
|
51 Number.NaN, |
|
52 Math.asin("string") ); |
|
53 |
|
54 new TestCase( SECTION, |
|
55 "Math.asin('0')", |
|
56 0, |
|
57 Math.asin("0") ); |
|
58 |
|
59 new TestCase( SECTION, |
|
60 "Math.asin('1')", |
|
61 Math.PI/2, |
|
62 Math.asin("1") ); |
|
63 |
|
64 new TestCase( SECTION, |
|
65 "Math.asin('-1')", |
|
66 -Math.PI/2, |
|
67 Math.asin("-1") ); |
|
68 |
|
69 new TestCase( SECTION, |
|
70 "Math.asin(Math.SQRT1_2+'')", |
|
71 Math.PI/4, |
|
72 Math.asin(Math.SQRT1_2+'') ); |
|
73 |
|
74 new TestCase( SECTION, |
|
75 "Math.asin(-Math.SQRT1_2+'')", |
|
76 -Math.PI/4, |
|
77 Math.asin(-Math.SQRT1_2+'') ); |
|
78 |
|
79 new TestCase( SECTION, |
|
80 "Math.asin(1.000001)", |
|
81 Number.NaN, |
|
82 Math.asin(1.000001) ); |
|
83 |
|
84 new TestCase( SECTION, |
|
85 "Math.asin(-1.000001)", |
|
86 Number.NaN, |
|
87 Math.asin(-1.000001) ); |
|
88 |
|
89 new TestCase( SECTION, |
|
90 "Math.asin(0)", |
|
91 0, |
|
92 Math.asin(0) ); |
|
93 |
|
94 new TestCase( SECTION, |
|
95 "Math.asin(-0)", |
|
96 -0, |
|
97 Math.asin(-0) ); |
|
98 |
|
99 new TestCase( SECTION, |
|
100 "Infinity/Math.asin(-0)", |
|
101 -Infinity, |
|
102 Infinity/Math.asin(-0) ); |
|
103 |
|
104 new TestCase( SECTION, |
|
105 "Math.asin(1)", |
|
106 Math.PI/2, |
|
107 Math.asin(1) ); |
|
108 |
|
109 new TestCase( SECTION, |
|
110 "Math.asin(-1)", |
|
111 -Math.PI/2, |
|
112 Math.asin(-1) ); |
|
113 |
|
114 new TestCase( SECTION, |
|
115 "Math.asin(Math.SQRT1_2))", |
|
116 Math.PI/4, |
|
117 Math.asin(Math.SQRT1_2) ); |
|
118 |
|
119 new TestCase( SECTION, |
|
120 "Math.asin(-Math.SQRT1_2))", |
|
121 -Math.PI/4, |
|
122 Math.asin(-Math.SQRT1_2)); |
|
123 |
|
124 test(); |