|
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 * If x or y is NaN, return true |
|
6 * |
|
7 * @path ch11/11.9/11.9.2/S11.9.2_A4.1_T1.js |
|
8 * @description x is NaN |
|
9 */ |
|
10 |
|
11 //CHECK#1 |
|
12 if ((Number.NaN != true) !== true) { |
|
13 $ERROR('#1: (NaN != true) === true'); |
|
14 } |
|
15 |
|
16 //CHECK#2 |
|
17 if ((Number.NaN != 1) !== true) { |
|
18 $ERROR('#2: (NaN != 1) === true'); |
|
19 } |
|
20 |
|
21 //CHECK#3 |
|
22 if ((Number.NaN != Number.NaN) !== true) { |
|
23 $ERROR('#3: (NaN != NaN) === true'); |
|
24 } |
|
25 |
|
26 //CHECK#4 |
|
27 if ((Number.NaN != Number.POSITIVE_INFINITY) !== true) { |
|
28 $ERROR('#4: (NaN != +Infinity) === true'); |
|
29 } |
|
30 |
|
31 //CHECK#5 |
|
32 if ((Number.NaN != Number.NEGATIVE_INFINITY) !== true) { |
|
33 $ERROR('#5: (NaN != -Infinity) === true'); |
|
34 } |
|
35 |
|
36 //CHECK#6 |
|
37 if ((Number.NaN != Number.MAX_VALUE) !== true) { |
|
38 $ERROR('#6: (NaN != Number.MAX_VALUE) === true'); |
|
39 } |
|
40 |
|
41 //CHECK#7 |
|
42 if ((Number.NaN != Number.MIN_VALUE) !== true) { |
|
43 $ERROR('#7: (NaN != Number.MIN_VALUE) === true'); |
|
44 } |
|
45 |
|
46 //CHECK#8 |
|
47 if ((Number.NaN != "string") !== true) { |
|
48 $ERROR('#8: (NaN != "string") === true'); |
|
49 } |
|
50 |
|
51 //CHECK#9 |
|
52 if ((Number.NaN != new Object()) !== true) { |
|
53 $ERROR('#9: (NaN != new Object()) === true'); |
|
54 } |
|
55 |
|
56 |