Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Math/atan2/S15.8.2.5_A16.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: If y<0 and y is finite and x is equal to +Infinity, Math.atan2(y,x) is -0
6 es5id: 15.8.2.5_A16
7 description: >
8 Checking if Math.atan2(y,x) is -0, where y<0 and y is finite and x
9 is equal to +Infinity
10 ---*/
11
12 // CHECK#1
13 var x = +Infinity;
14 var y = new Array();
15 y[0] = -0.000000000000001;
16 y[1] = -1;
17 y[2] = -1.7976931348623157E308; //largest by abs() finite number
18 var ynum = 3;
19
20 for (var i = 0; i < ynum; i++)
21 {
22 assert.sameValue(
23 Math.atan2(y[i], x),
24 -0,
25 "(" + y[i] + ", Infinity)"
26 );
27 }