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 ***** */
41 File Name: 15.8.2.5.js
42 ECMA Section: 15.8.2.5 atan2( y, x )
45 Author: christine@netscape.com
49 var SECTION = "15.8.2.5";
50 var VERSION = "ECMA_1";
51 var TITLE = "Math.atan2(x,y)";
52 var BUGNUMBER="76111";
56 writeHeaderToLog( SECTION + " "+ TITLE);
58 new TestCase( SECTION,
63 new TestCase( SECTION,
66 Math.atan2(Number.NaN,0) );
68 new TestCase( SECTION,
69 "Math.atan2(null, null)",
71 Math.atan2(null, null) );
73 new TestCase( SECTION,
74 "Math.atan2(void 0, void 0)",
76 Math.atan2(void 0, void 0) );
78 new TestCase( SECTION,
83 new TestCase( SECTION,
86 Math.atan2(0,Number.NaN) );
88 new TestCase( SECTION,
93 new TestCase( SECTION,
98 new TestCase( SECTION,
99 "Math.atan2(0,0.001)",
101 Math.atan2(0,0.001) );
103 new TestCase( SECTION,
108 new TestCase( SECTION,
113 new TestCase( SECTION,
118 new TestCase( SECTION,
123 new TestCase( SECTION,
124 "Infinity/Math.atan2(-0, 1)",
126 Infinity/Math.atan2(-0,1) );
128 new TestCase( SECTION,
133 new TestCase( SECTION,
134 "Math.atan2(-0, -0)",
136 Math.atan2(-0, -0) );
138 new TestCase( SECTION,
139 "Math.atan2(-0, -1)",
141 Math.atan2(-0, -1) );
143 new TestCase( SECTION,
148 new TestCase( SECTION,
149 "Math.atan2(-1, -0)",
151 Math.atan2(-1, -0) );
153 new TestCase( SECTION,
154 "Math.atan2(1, Infinity)",
156 Math.atan2(1, Number.POSITIVE_INFINITY) );
158 new TestCase( SECTION,
159 "Math.atan2(1,-Infinity)",
161 Math.atan2(1, Number.NEGATIVE_INFINITY) );
163 new TestCase( SECTION,
164 "Math.atan2(-1, Infinity)",
166 Math.atan2(-1,Number.POSITIVE_INFINITY) );
168 new TestCase( SECTION,
169 "Infinity/Math.atan2(-1, Infinity)",
171 Infinity/Math.atan2(-1,Infinity) );
173 new TestCase( SECTION,
174 "Math.atan2(-1,-Infinity)",
176 Math.atan2(-1,Number.NEGATIVE_INFINITY) );
178 new TestCase( SECTION,
179 "Math.atan2(Infinity, 0)",
181 Math.atan2(Number.POSITIVE_INFINITY, 0) );
183 new TestCase( SECTION,
184 "Math.atan2(Infinity, 1)",
186 Math.atan2(Number.POSITIVE_INFINITY, 1) );
188 new TestCase( SECTION,
189 "Math.atan2(Infinity,-1)",
191 Math.atan2(Number.POSITIVE_INFINITY,-1) );
193 new TestCase( SECTION,
194 "Math.atan2(Infinity,-0)",
196 Math.atan2(Number.POSITIVE_INFINITY,-0) );
198 new TestCase( SECTION,
199 "Math.atan2(-Infinity, 0)",
201 Math.atan2(Number.NEGATIVE_INFINITY, 0) );
203 new TestCase( SECTION,
204 "Math.atan2(-Infinity,-0)",
206 Math.atan2(Number.NEGATIVE_INFINITY,-0) );
208 new TestCase( SECTION,
209 "Math.atan2(-Infinity, 1)",
211 Math.atan2(Number.NEGATIVE_INFINITY, 1) );
213 new TestCase( SECTION,
214 "Math.atan2(-Infinity, -1)",
216 Math.atan2(Number.NEGATIVE_INFINITY,-1) );
218 new TestCase( SECTION,
219 "Math.atan2(Infinity, Infinity)",
221 Math.atan2(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY) );
223 new TestCase( SECTION,
224 "Math.atan2(Infinity, -Infinity)",
226 Math.atan2(Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY) );
228 new TestCase( SECTION,
229 "Math.atan2(-Infinity, Infinity)",
231 Math.atan2(Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY) );
233 new TestCase( SECTION,
234 "Math.atan2(-Infinity, -Infinity)",
236 Math.atan2(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY) );
238 new TestCase( SECTION,
241 Math.atan2( -1, 1) );