aboutsummaryrefslogtreecommitdiffstats
path: root/website/resources/scripts/testcases2/15.8.2.5_atan2.json
diff options
context:
space:
mode:
Diffstat (limited to 'website/resources/scripts/testcases2/15.8.2.5_atan2.json')
-rw-r--r--website/resources/scripts/testcases2/15.8.2.5_atan2.json152
1 files changed, 152 insertions, 0 deletions
diff --git a/website/resources/scripts/testcases2/15.8.2.5_atan2.json b/website/resources/scripts/testcases2/15.8.2.5_atan2.json
new file mode 100644
index 000000000..ce4644af4
--- /dev/null
+++ b/website/resources/scripts/testcases2/15.8.2.5_atan2.json
@@ -0,0 +1,152 @@
+{
+ "testCollection": {
+ "name": "15.8.2.5_atan2",
+ "numTests": 24,
+ "tests": [
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(NaN,y) and Math.atan2(x,NaN) is NaN for different x and y values",
+ "test": "// CHECK#1\n\nvals = new Array();\nvals[0] = -Infinity;\nvals[1] = -0.000000000000001;\nvals[2] = -0;\nvals[3] = +0\nvals[4] = 0.000000000000001;\nvals[5] = +Infinity;\nvals[6] = NaN;\nvalnum = 7;\n\nargs = new Array();\nfor (i = 0; i < 2; i++)\n{\n\targs[i] = NaN;\n\tfor (j = 0; j < valnum; j++)\n\t{\n\t\targs[1-i] = vals[j];\n\t\tif (!isNaN(Math.atan2(args[0], args[1])))\n\t\t{\n\t\t\t$ERROR(\"#1: isNaN(Math.atan2(\" + args[0] + \", \" + args[1] + \")) === false'\");\n\t\t}\n\t}\n}\n",
+ "id": "S15.8.2.5_A1"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(-0,-0) is an approximation to -PI",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n \n// CHECK#1\n//prec = 0.00000000000001;\ny = -0;\nx = -0;\nif (!isEqual(Math.atan2(y,x), -Math.PI))\n\t$ERROR(\"#1: !isEqual(Math.atan2(-0,-0), -Math.PI)\");\n",
+ "id": "S15.8.2.5_A10"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(-0,x) is an approximation to -PI, where x<0",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n \n// CHECK#1\ny = -0;\n//prec = 0.00000000000001;\nx = new Array();\nx[0] = -0.000000000000001;\nx[2] = -Infinity;\nx[1] = -1; \nxnum = 3;\n\nfor (i = 0; i < xnum; i++)\n{\n\tif (!isEqual(Math.atan2(y,x[i]), - Math.PI))\n\t\t$FAIL(\"#1: Math.abs(Math.atan2(\" + y + \", \" + x[i] + \") + Math.PI) >= \" + prec);\n}\n",
+ "id": "S15.8.2.5_A11"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,+0) is an approximation to -PI/2, where y<0",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n \n// CHECK#1\nx = +0;\n//prec = 0.00000000000001;\ny = new Array();\ny[0] = -0.000000000000001;\ny[2] = -Infinity;\ny[1] = -1; \nynum = 3;\n\nfor (i = 0; i < ynum; i++)\n{\n\tif (!isEqual(Math.atan2(y[i],x), -(Math.PI)/2))\n\t\t$FAIL(\"#1: Math.abs(Math.atan2(\" + y[i] + \", \" + x + \") + ((Math.PI)/2)) >= \" + prec);\n}\n",
+ "id": "S15.8.2.5_A12"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,-0) is an approximation to -PI/2, where y<0",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n \n// CHECK#1\nx = -0;\n//prec = 0.00000000000001;\ny = new Array();\ny[0] = -0.000000000000001;\ny[2] = -Infinity;\ny[1] = -1; \nynum = 3;\n\nfor (i = 0; i < ynum; i++)\n{\n\tif (!isEqual(Math.atan2(y[i],x), -(Math.PI)/2))\n\t\t$FAIL(\"#1: Math.abs(Math.atan2(\" + y[i] + \", -0) + ((Math.PI)/2)) >= \" + prec);\n}\n",
+ "id": "S15.8.2.5_A13"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) equals to +0, where y>0 and y is finite and x is equal to +Infinity",
+ "test": "// CHECK#1\nx = +Infinity;\ny = new Array();\ny[0] = 0.000000000000001;\ny[1] = 1;\ny[2] = 1.7976931348623157E308; //largest finite number \nynum = 3;\n\nfor (i = 0; i < ynum; i++)\n{\n\tif (Math.atan2(y[i],x) !== +0)\n\t\t$FAIL(\"#1: Math.atan2(\" + y[i] + \", \" + x + \") !== +0\");\n}\n",
+ "id": "S15.8.2.5_A14"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is an approximation to +PI, where y>0 and y is finite and x is equal to -Infinity",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n \n// CHECK#1\nx = -Infinity;\ny = new Array();\ny[0] = 0.000000000000001;\ny[1] = 1;\ny[2] = 1.7976931348623157E308; //largest finite number \nynum = 3;\n\nfor (i = 0; i < ynum; i++)\n{\n\tif (!isEqual(Math.atan2(y[i],x),Math.PI))\n\t\t$FAIL(\"#1: Math.abs(Math.atan2(\" + y[i] + \", \" + x + \") - Math.PI) >= \" + prec);\n}\n",
+ "id": "S15.8.2.5_A15"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is -0, where y<0 and y is finite and x is equal to +Infinity",
+ "test": "// CHECK#1\nx = +Infinity;\ny = new Array();\ny[0] = -0.000000000000001;\ny[1] = -1;\ny[2] = -1.7976931348623157E308; //largest by abs() finite number \nynum = 3;\n\nfor (i = 0; i < ynum; i++)\n{\n\tif (Math.atan2(y[i],x) !== -0)\n\t\t$FAIL(\"#1: Math.atan2(\" + y[i] + \", \" + x + \") !== -0\");\n}\n",
+ "id": "S15.8.2.5_A16"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is an approximation to -PI, where y<0 and y is finite and x is equal to -Infinity",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n \n// CHECK#1\nx = -Infinity;\ny = new Array();\ny[0] = -0.000000000000001;\ny[1] = -1;\ny[2] = -1.7976931348623157E308; //largest (by module) finite number \nynum = 3;\n\nfor (i = 0; i < ynum; i++)\n{\n\tif (!isEqual(Math.atan2(y[i],x), -Math.PI))\n\t\t$FAIL(\"#1: Math.abs(Math.atan2(\" + y[i] + \", \" + x + \") + Math.PI) >= \" + prec);\n}\n",
+ "id": "S15.8.2.5_A17"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is an approximation to +PI/2, where y is +Infinity and x is finite",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n \n// CHECK#1\ny = +Infinity;\nx = new Array();\nx[0] = 0.000000000000001;\nx[1] = 1;\nx[2] = 1.7976931348623157E308; //largest finite number\nx[3] = -0.000000000000001;\nx[4] = -1;\nx[5] = -1.7976931348623157E308; //largest (by module) finite number \n \nxnum = 6;\n\nfor (i = 0; i < xnum; i++)\n{\n\tif (!isEqual(Math.atan2(y,x[i]), (Math.PI)/2))\n\t\t$FAIL(\"#1: Math.abs(Math.atan2(\" + y + \", \" + x[i] + \") - (Math.PI/2)) >= \" + prec);\n}\n",
+ "id": "S15.8.2.5_A18"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is an approximation to -PI/2, where y is -Infinity and x is finite",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n\n// CHECK#1\n//prec = 0.00000000000001;\ny = -Infinity;\nx = new Array();\nx[0] = 0.000000000000001;\nx[1] = 1;\nx[2] = 1.7976931348623157E308; //largest finite number\nx[3] = -0.000000000000001;\nx[4] = -1;\nx[5] = -1.7976931348623157E308; //largest (by module) finite number \n \nxnum = 6;\n\nfor (i = 0; i < xnum; i++)\n{\n\tif (!isEqual(Math.atan2(y,x[i]), -(Math.PI)/2))\n\t\t$FAIL(\"#1: Math.abs(Math.atan2(\" + y + \", \" + x[i] + \") + (Math.PI/2)) >= \" + prec);\n}\n",
+ "id": "S15.8.2.5_A19"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is an approximation to +PI/2, where y>0 and x is +0",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n\n// CHECK#1\nx = +0;\n//prec = 0.00000000000001;\ny = new Array();\ny[0] = 0.000000000000001;\ny[2] = +Infinity;\ny[1] = 1; \nynum = 3;\n\nfor (i = 0; i < ynum; i++)\n{\n\tif (!isEqual(Math.atan2(y[i],x),(Math.PI)/2))\n\t\t$FAIL(\"#1: Math.abs(Math.atan2(\" + y[i] + \", \" + x + \") - ((Math.PI)/2)) >= \" + prec);\n}\n",
+ "id": "S15.8.2.5_A2"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is an approximation to +PI/4, where y is equal to +Infinity and x is equal to +Infinity",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n\n// CHECK#1\n//prec = 0.00000000000001;\ny = +Infinity;\nx = +Infinity;\n\nif (!isEqual(Math.atan2(y,x),(Math.PI)/4))\n\t$ERROR(\"#1: Math.abs(Math.atan2(\" + y + \", \" + x + \") - (Math.PI/4)) >= \" + prec);\n",
+ "id": "S15.8.2.5_A20"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is an approximation to +3*PI/4, where y is equal to +Infinity and x is equal to -Infinity",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n\n// CHECK#1\n//prec = 0.00000000000001;\ny = +Infinity;\nx = -Infinity;\n\nif (!isEqual(Math.atan2(y,x), (3*Math.PI)/4))\n\t$ERROR(\"#1: Math.abs(Math.atan2(\" + y + \", \" + x + \") - (3*Math.PI/4)) >= \" + prec);\n",
+ "id": "S15.8.2.5_A21"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is an approximation to -PI/4, where y is equal to -Infinity and x is equal to +Infinity",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n\n// CHECK#1\n//prec = 0.00000000000001;\ny = -Infinity;\nx = +Infinity;\n\nif (!isEqual(Math.atan2(y,x),- (Math.PI)/4))\n\t$ERROR(\"#1: Math.abs(Math.atan2(\" + y + \", \" + x + \") + (Math.PI/4)) >= \" + prec);\n",
+ "id": "S15.8.2.5_A22"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is an approximation to -3*PI/4, where y is equal to -Infinity and x is equal to -Infinity",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n\n// CHECK#1\n//prec = 0.00000000000001;\ny = -Infinity;\nx = -Infinity;\n\nif (!isEqual(Math.atan2(y,x), -(3*Math.PI)/4))\n\t$ERROR(\"#1: Math.abs(Math.atan2(\" + y + \", \" + x + \") + (3*Math.PI/4)) >= \" + prec);\n",
+ "id": "S15.8.2.5_A23"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": ": Checking if Math.atan2(argument1, argument2) is approximately equals to its mathematical values on the set of 64 argument1 values and 64 argument2 values; all the sample values is calculated with LibC;",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\");\n\n// CHECK#1\nvnum = 64;\nvar x1 = new Array();\nx1[0] = -16.00000000000000000000;\nx1[1] = -15.49206349206349200000;\nx1[2] = -14.98412698412698400000;\nx1[3] = -14.47619047619047600000;\nx1[4] = -13.96825396825396800000;\nx1[5] = -13.46031746031746000000;\nx1[6] = -12.95238095238095300000;\nx1[7] = -12.44444444444444500000;\nx1[8] = -11.93650793650793700000;\nx1[9] = -11.42857142857142900000;\nx1[10] = -10.92063492063492100000;\nx1[11] = -10.41269841269841300000;\nx1[12] = -9.90476190476190510000;\nx1[13] = -9.39682539682539720000;\nx1[14] = -8.88888888888888930000;\nx1[15] = -8.38095238095238140000;\nx1[16] = -7.87301587301587350000;\nx1[17] = -7.36507936507936560000;\nx1[18] = -6.85714285714285770000;\nx1[19] = -6.34920634920634970000;\nx1[20] = -5.84126984126984180000;\nx1[21] = -5.33333333333333390000;\nx1[22] = -4.82539682539682600000;\nx1[23] = -4.31746031746031810000;\nx1[24] = -3.80952380952381020000;\nx1[25] = -3.30158730158730230000;\nx1[26] = -2.79365079365079440000;\nx1[27] = -2.28571428571428650000;\nx1[28] = -1.77777777777777860000;\nx1[29] = -1.26984126984127070000;\nx1[30] = -0.76190476190476275000;\nx1[31] = -0.25396825396825484000;\nx1[32] = 0.25396825396825307000;\nx1[33] = 0.76190476190476275000;\nx1[34] = 1.26984126984126890000;\nx1[35] = 1.77777777777777860000;\nx1[36] = 2.28571428571428470000;\nx1[37] = 2.79365079365079440000;\nx1[38] = 3.30158730158730050000;\nx1[39] = 3.80952380952381020000;\nx1[40] = 4.31746031746031630000;\nx1[41] = 4.82539682539682600000;\nx1[42] = 5.33333333333333210000;\nx1[43] = 5.84126984126984180000;\nx1[44] = 6.34920634920634800000;\nx1[45] = 6.85714285714285770000;\nx1[46] = 7.36507936507936380000;\nx1[47] = 7.87301587301587350000;\nx1[48] = 8.38095238095237960000;\nx1[49] = 8.88888888888888930000;\nx1[50] = 9.39682539682539540000;\nx1[51] = 9.90476190476190510000;\nx1[52] = 10.41269841269841100000;\nx1[53] = 10.92063492063492100000;\nx1[54] = 11.42857142857142700000;\nx1[55] = 11.93650793650793700000;\nx1[56] = 12.44444444444444300000;\nx1[57] = 12.95238095238095300000;\nx1[58] = 13.46031746031745900000;\nx1[59] = 13.96825396825396800000;\nx1[60] = 14.47619047619047400000;\nx1[61] = 14.98412698412698400000;\nx1[62] = 15.49206349206349000000;\nx1[63] = 16.00000000000000000000;\n\n\nvar x2 = new Array();\nx2[0] = -8.00000000000000000000;\nx2[1] = -7.74603174603174600000;\nx2[2] = -7.49206349206349210000;\nx2[3] = -7.23809523809523810000;\nx2[4] = -6.98412698412698420000;\nx2[5] = -6.73015873015873020000;\nx2[6] = -6.47619047619047630000;\nx2[7] = -6.22222222222222230000;\nx2[8] = -5.96825396825396840000;\nx2[9] = -5.71428571428571440000;\nx2[10] = -5.46031746031746050000;\nx2[11] = -5.20634920634920650000;\nx2[12] = -4.95238095238095260000;\nx2[13] = -4.69841269841269860000;\nx2[14] = -4.44444444444444460000;\nx2[15] = -4.19047619047619070000;\nx2[16] = -3.93650793650793670000;\nx2[17] = -3.68253968253968280000;\nx2[18] = -3.42857142857142880000;\nx2[19] = -3.17460317460317490000;\nx2[20] = -2.92063492063492090000;\nx2[21] = -2.66666666666666700000;\nx2[22] = -2.41269841269841300000;\nx2[23] = -2.15873015873015910000;\nx2[24] = -1.90476190476190510000;\nx2[25] = -1.65079365079365110000;\nx2[26] = -1.39682539682539720000;\nx2[27] = -1.14285714285714320000;\nx2[28] = -0.88888888888888928000;\nx2[29] = -0.63492063492063533000;\nx2[30] = -0.38095238095238138000;\nx2[31] = -0.12698412698412742000;\nx2[32] = 0.12698412698412653000;\nx2[33] = 0.38095238095238138000;\nx2[34] = 0.63492063492063444000;\nx2[35] = 0.88888888888888928000;\nx2[36] = 1.14285714285714230000;\nx2[37] = 1.39682539682539720000;\nx2[38] = 1.65079365079365030000;\nx2[39] = 1.90476190476190510000;\nx2[40] = 2.15873015873015820000;\nx2[41] = 2.41269841269841300000;\nx2[42] = 2.66666666666666610000;\nx2[43] = 2.92063492063492090000;\nx2[44] = 3.17460317460317400000;\nx2[45] = 3.42857142857142880000;\nx2[46] = 3.68253968253968190000;\nx2[47] = 3.93650793650793670000;\nx2[48] = 4.19047619047618980000;\nx2[49] = 4.44444444444444460000;\nx2[50] = 4.69841269841269770000;\nx2[51] = 4.95238095238095260000;\nx2[52] = 5.20634920634920560000;\nx2[53] = 5.46031746031746050000;\nx2[54] = 5.71428571428571350000;\nx2[55] = 5.96825396825396840000;\nx2[56] = 6.22222222222222140000;\nx2[57] = 6.47619047619047630000;\nx2[58] = 6.73015873015872930000;\nx2[59] = 6.98412698412698420000;\nx2[60] = 7.23809523809523720000;\nx2[61] = 7.49206349206349210000;\nx2[62] = 7.74603174603174520000;\nx2[63] = 8.00000000000000000000;\n\n\nvar y = new Array();\ny[0] = -2.03444393579570270000;\ny[1] = -2.03444393579570270000;\ny[2] = -2.03444393579570270000;\ny[3] = -2.03444393579570270000;\ny[4] = -2.03444393579570270000;\ny[5] = -2.03444393579570270000;\ny[6] = -2.03444393579570270000;\ny[7] = -2.03444393579570270000;\ny[8] = -2.03444393579570270000;\ny[9] = -2.03444393579570270000;\ny[10] = -2.03444393579570270000;\ny[11] = -2.03444393579570270000;\ny[12] = -2.03444393579570270000;\ny[13] = -2.03444393579570270000;\ny[14] = -2.03444393579570270000;\ny[15] = -2.03444393579570270000;\ny[16] = -2.03444393579570270000;\ny[17] = -2.03444393579570270000;\ny[18] = -2.03444393579570270000;\ny[19] = -2.03444393579570270000;\ny[20] = -2.03444393579570270000;\ny[21] = -2.03444393579570270000;\ny[22] = -2.03444393579570270000;\ny[23] = -2.03444393579570270000;\ny[24] = -2.03444393579570270000;\ny[25] = -2.03444393579570270000;\ny[26] = -2.03444393579570270000;\ny[27] = -2.03444393579570270000;\ny[28] = -2.03444393579570270000;\ny[29] = -2.03444393579570270000;\ny[30] = -2.03444393579570270000;\ny[31] = -2.03444393579570270000;\ny[32] = 1.10714871779409040000;\ny[33] = 1.10714871779409040000;\ny[34] = 1.10714871779409040000;\ny[35] = 1.10714871779409040000;\ny[36] = 1.10714871779409040000;\ny[37] = 1.10714871779409040000;\ny[38] = 1.10714871779409040000;\ny[39] = 1.10714871779409040000;\ny[40] = 1.10714871779409040000;\ny[41] = 1.10714871779409040000;\ny[42] = 1.10714871779409040000;\ny[43] = 1.10714871779409040000;\ny[44] = 1.10714871779409040000;\ny[45] = 1.10714871779409040000;\ny[46] = 1.10714871779409040000;\ny[47] = 1.10714871779409040000;\ny[48] = 1.10714871779409040000;\ny[49] = 1.10714871779409040000;\ny[50] = 1.10714871779409040000;\ny[51] = 1.10714871779409040000;\ny[52] = 1.10714871779409040000;\ny[53] = 1.10714871779409040000;\ny[54] = 1.10714871779409040000;\ny[55] = 1.10714871779409040000;\ny[56] = 1.10714871779409040000;\ny[57] = 1.10714871779409040000;\ny[58] = 1.10714871779409040000;\ny[59] = 1.10714871779409040000;\ny[60] = 1.10714871779409040000;\ny[61] = 1.10714871779409040000;\ny[62] = 1.10714871779409040000;\ny[63] = 1.10714871779409040000;\n\n\n\nvar val;\nfor (i = 0; i < vnum; i++)\n{\n\tval = Math.atan2(x1[i], x2[i]);\n\tif (!isEqual(val, y[i]))\n\t{\n\t\t$ERROR(\"\\nx1 = \" + x1[i] + \"\\nx2 = \" + x2[i] + \"\\nlibc.atan2(x1,x2) = \" + y[i] + \"\\nMath.atan2(x1,x2) = \" + Math.atan2(x1[i],x2[i]) + \"\\nMath.abs(libc.atan2(x1,x2) - Math.atan2(x1,x2)) > \" + prec + \"\\n\\n\"); \n\t}\n}\n",
+ "id": "S15.8.2.5_A24"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is an approximation to +PI/2, where y>0 and x is -0",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n\n// CHECK#1\nx = -0;\n//prec = 0.00000000000001;\ny = new Array();\ny[0] = 0.000000000000001;\ny[2] = +Infinity;\ny[1] = 1; \nynum = 3;\n\nfor (i = 0; i < ynum; i++)\n{\n\tif (!isEqual(Math.atan2(y[i],x), (Math.PI)/2))\n\t\t$FAIL(\"#1: Math.abs(Math.atan2(\" + y[i] + \", \" + x + \") - ((Math.PI)/2)) >= \" + prec);\n}\n",
+ "id": "S15.8.2.5_A3"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) equals to +0, where y is +0 and x>0",
+ "test": "// CHECK#1\ny = +0;\nx = new Array();\nx[0] = 0.000000000000001;\nx[2] = +Infinity;\nx[1] = 1; \nxnum = 3;\n\nfor (i = 0; i < xnum; i++)\n{\n\tif (Math.atan2(y,x[i]) !== +0)\n\t\t$FAIL(\"#1: Math.atan2(\" + y + \", \" + x[i] + \") !== +0\");\n}\n",
+ "id": "S15.8.2.5_A4"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is +0, where y is +0 and x is +0",
+ "test": "// CHECK#1\ny = +0;\nx = +0;\nif (Math.atan2(y,x) !== +0)\n\t$ERROR(\"#1: Math.atan2(\" + y + \", \" + x + \") !== +0\");\n",
+ "id": "S15.8.2.5_A5"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is an approximation to +PI, where y is +0 and x is -0",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n\n// CHECK#1\n//prec = 0.00000000000001;\ny = +0;\nx = -0;\nif (!isEqual(Math.atan2(y,x), Math.PI))\n\t$ERROR(\"#1: Math.abs(Math.atan2(\" + y + \", -0) - Math.PI) >= \" + prec);\n",
+ "id": "S15.8.2.5_A6"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is an approximation to +PI, where y is equal to +0 and x<0",
+ "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\"); \n\n// CHECK#1\ny = +0;\n//prec = 0.00000000000001;\nx = new Array();\nx[0] = -0.000000000000001;\nx[2] = -Infinity;\nx[1] = -1; \nxnum = 3;\n\nfor (i = 0; i < xnum; i++)\n{\n\tif (!isEqual(Math.atan2(y,x[i]), Math.PI))\n\t\t$FAIL(\"#1: Math.abs(Math.atan2(\" + y + \", \" + x[i] + \") - Math.PI) >= \" + prec);\n}\n",
+ "id": "S15.8.2.5_A7"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is -0, where y is equal to -0 and x>0",
+ "test": "// CHECK#1\ny = -0;\nx = new Array();\nx[0] = 0.000000000000001;\nx[2] = +Infinity;\nx[1] = 1; \nxnum = 3;\n\nfor (i = 0; i < xnum; i++)\n{\n\tif (Math.atan2(y,x[i]) !== -0)\n\t\t$FAIL(\"#1: Math.atan2(\" + y + \", \" + x[i] + \") !== -0\");\n}\n",
+ "id": "S15.8.2.5_A8"
+ },
+ {
+ "section": "15.8.2.5",
+ "description": "Checking if Math.atan2(y,x) is -0, where y is -0 and x is +0",
+ "test": "// CHECK#1\ny = -0;\nx = +0;\nif (Math.atan2(y,x) !== -0)\n\t$ERROR(\"#1: Math.atan2(\" + y + \", \" + x + \") !== -0\");\n",
+ "id": "S15.8.2.5_A9"
+ }
+ ]
+ }
+}