1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* ***** BEGIN LICENSE BLOCK *****
3
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
5
* The contents of this file are subject to the Mozilla Public License Version
6
* 1.1 (the "License"); you may not use this file except in compliance with
7
* the License. You may obtain a copy of the License at
8
* http://www.mozilla.org/MPL/
10
* Software distributed under the License is distributed on an "AS IS" basis,
11
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
* for the specific language governing rights and limitations under the
15
* The Original Code is Mozilla Communicator client code, released
18
* The Initial Developer of the Original Code is
19
* Netscape Communications Corporation.
20
* Portions created by the Initial Developer are Copyright (C) 1998
21
* the Initial Developer. All Rights Reserved.
25
* Alternatively, the contents of this file may be used under the terms of
26
* either the GNU General Public License Version 2 or later (the "GPL"), or
27
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28
* in which case the provisions of the GPL or the LGPL are applicable instead
29
* of those above. If you wish to allow use of your version of this file only
30
* under the terms of either the GPL or the LGPL, and not to allow others to
31
* use your version of this file under the terms of the MPL, indicate your
32
* decision by deleting the provisions above and replace them with the notice
33
* and other provisions required by the GPL or the LGPL. If you do not delete
34
* the provisions above, a recipient may use your version of this file under
35
* the terms of any one of the MPL, the GPL or the LGPL.
37
* ***** END LICENSE BLOCK ***** */
39
gTestfile = '15.8.2.7.js';
42
File Name: 15.8.2.7.js
43
ECMA Section: 15.8.2.7 cos( x )
44
Description: return an approximation to the cosine of the
45
argument. argument is expressed in radians
46
Author: christine@netscape.com
51
var SECTION = "15.8.2.7";
52
var VERSION = "ECMA_1";
54
var TITLE = "Math.cos(x)";
56
writeHeaderToLog( SECTION + " "+ TITLE);
58
new TestCase( SECTION,
63
new TestCase( SECTION,
68
new TestCase( SECTION,
73
new TestCase( SECTION,
78
new TestCase( SECTION,
83
new TestCase( SECTION,
88
new TestCase( SECTION,
89
"Math.cos('Infinity')",
91
Math.cos("Infinity") );
93
new TestCase( SECTION,
94
"Math.cos('3.14159265359')",
96
Math.cos('3.14159265359') );
98
new TestCase( SECTION,
101
Math.cos(Number.NaN) );
103
new TestCase( SECTION,
108
new TestCase( SECTION,
113
new TestCase( SECTION,
114
"Math.cos(Infinity)",
116
Math.cos(Number.POSITIVE_INFINITY) );
118
new TestCase( SECTION,
119
"Math.cos(-Infinity)",
121
Math.cos(Number.NEGATIVE_INFINITY) );
123
new TestCase( SECTION,
124
"Math.cos(0.7853981633974)",
126
Math.cos(0.7853981633974) );
128
new TestCase( SECTION,
129
"Math.cos(1.570796326795)",
131
Math.cos(1.570796326795) );
133
new TestCase( SECTION,
134
"Math.cos(2.356194490192)",
136
Math.cos(2.356194490192) );
138
new TestCase( SECTION,
139
"Math.cos(3.14159265359)",
141
Math.cos(3.14159265359) );
143
new TestCase( SECTION,
144
"Math.cos(3.926990816987)",
146
Math.cos(3.926990816987) );
148
new TestCase( SECTION,
149
"Math.cos(4.712388980385)",
151
Math.cos(4.712388980385) );
153
new TestCase( SECTION,
154
"Math.cos(5.497787143782)",
156
Math.cos(5.497787143782) );
158
new TestCase( SECTION,
159
"Math.cos(Math.PI*2)",
161
Math.cos(Math.PI*2) );
163
new TestCase( SECTION,
164
"Math.cos(Math.PI/4)",
166
Math.cos(Math.PI/4) );
168
new TestCase( SECTION,
169
"Math.cos(Math.PI/2)",
171
Math.cos(Math.PI/2) );
173
new TestCase( SECTION,
174
"Math.cos(3*Math.PI/4)",
176
Math.cos(3*Math.PI/4) );
178
new TestCase( SECTION,
183
new TestCase( SECTION,
184
"Math.cos(5*Math.PI/4)",
186
Math.cos(5*Math.PI/4) );
188
new TestCase( SECTION,
189
"Math.cos(3*Math.PI/2)",
191
Math.cos(3*Math.PI/2) );
193
new TestCase( SECTION,
194
"Math.cos(7*Math.PI/4)",
196
Math.cos(7*Math.PI/4) );
198
new TestCase( SECTION,
199
"Math.cos(Math.PI*2)",
201
Math.cos(2*Math.PI) );
203
new TestCase( SECTION,
204
"Math.cos(-0.7853981633974)",
206
Math.cos(-0.7853981633974) );
208
new TestCase( SECTION,
209
"Math.cos(-1.570796326795)",
211
Math.cos(-1.570796326795) );
213
new TestCase( SECTION,
214
"Math.cos(-2.3561944901920)",
216
Math.cos(2.3561944901920) );
218
new TestCase( SECTION,
219
"Math.cos(-3.14159265359)",
221
Math.cos(3.14159265359) );
223
new TestCase( SECTION,
224
"Math.cos(-3.926990816987)",
226
Math.cos(3.926990816987) );
228
new TestCase( SECTION,
229
"Math.cos(-4.712388980385)",
231
Math.cos(4.712388980385) );
233
new TestCase( SECTION,
234
"Math.cos(-5.497787143782)",
236
Math.cos(5.497787143782) );
238
new TestCase( SECTION,
239
"Math.cos(-6.28318530718)",
241
Math.cos(6.28318530718) );
243
new TestCase( SECTION,
244
"Math.cos(-Math.PI/4)",
246
Math.cos(-Math.PI/4) );
248
new TestCase( SECTION,
249
"Math.cos(-Math.PI/2)",
251
Math.cos(-Math.PI/2) );
253
new TestCase( SECTION,
254
"Math.cos(-3*Math.PI/4)",
256
Math.cos(-3*Math.PI/4) );
258
new TestCase( SECTION,
259
"Math.cos(-Math.PI)",
261
Math.cos(-Math.PI) );
263
new TestCase( SECTION,
264
"Math.cos(-5*Math.PI/4)",
266
Math.cos(-5*Math.PI/4) );
268
new TestCase( SECTION,
269
"Math.cos(-3*Math.PI/2)",
271
Math.cos(-3*Math.PI/2) );
273
new TestCase( SECTION,
274
"Math.cos(-7*Math.PI/4)",
276
Math.cos(-7*Math.PI/4) );
278
new TestCase( SECTION,
279
"Math.cos(-Math.PI*2)",
281
Math.cos(-Math.PI*2) );