summaryrefslogtreecommitdiff
path: root/test/suite/sputnik/Conformance/15_Native/15.8_The_Math_Object/15.8.2_Function_Properties_of_the_Math_Object/15.8.2.13_pow/S15.8.2.13_A23.js
blob: 0fa88ce7464a4a444f9366fa946e968cb3df1ff4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * @name: S15.8.2.13_A23;
 * @section: 15.8.2.13;
 * @assertion: If x<0 and x is finite and y is finite and y is not an integer, Math.pow(x,y) is NaN;
 * @description: Checking if Math.pow(x,y) is NaN, where x<0 and x is finite and y is finite and y is not an integer;
 */
 
// CHECK#1

y = NaN;
x = new Array();
x[0] = -1.7976931348623157E308; //largest (by module) finite number
x[1] = -Math.PI;
x[2] = -1;
x[3] = -0.000000000000001;
xnum = 4;

y[0] = -Math.PI;
y[1] = -Math.E;
y[2] = -1.000000000000001;
y[3] = -0.000000000000001;
y[4] = 0.000000000000001;
y[5] = 1.000000000000001;
y[6] = Math.E;
y[7] = Math.PI;
ynum = 8;

for (i = 0; i < xnum; i++)
	for (j = 0; j < ynum; j++)
		if (!isNaN(Math.pow(x[i],y[j])))
			$ERROR("#1: isNaN(Math.pow(" + x[i] + ", " + y[j] + ")) === false");