summaryrefslogtreecommitdiff
path: root/external/contributions/Google/sputnik_conformance_modified/11_Expressions/11.5_Multiplicative_Operators/11.5.3_Applying_the_percent_Operator/S11.5.3_A4_T1.1.js
blob: 75183b64a0f1ebcd09d2c50513b73aec623c8e3c (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * @name: S11.5.3_A4_T1.1;
 * @section: 11.5.3;
 * @assertion: The result of a ECMAScript floating-point remainder operation is determined by the rules of IEEE arithmetics; 
 * @description: If either operand is NaN, the result is NaN;
 */

//CHECK#1
if (isNaN(Number.NaN % Number.NaN) !== true) {
  $ERROR('#1: NaN % NaN === Not-a-Number. Actual: ' + (NaN % NaN));
}  

//CHECK#2
if (isNaN(Number.NaN % +0) !== true) {
  $ERROR('#2: NaN % +0 === Not-a-Number. Actual: ' + (NaN % +0)); 
} 

//CHECK#3
if (isNaN(Number.NaN % -0) !== true) {
  $ERROR('#3: NaN % -0 === Not-a-Number. Actual: ' + (NaN % -0)); 
} 

//CHECK#4
if (isNaN(Number.NaN % Number.POSITIVE_INFINITY) !== true) {
  $ERROR('#4: NaN % Infinity === Not-a-Number. Actual: ' + (NaN % Infinity));
} 

//CHECK#5
if (isNaN(Number.NaN % Number.NEGATIVE_INFINITY) !== true) {
  $ERROR('#5: NaN % -Infinity === Not-a-Number. Actual: ' + (NaN % -Infinity)); 
} 

//CHECK#6
if (isNaN(Number.NaN % Number.MAX_VALUE) !== true) {
  $ERROR('#6: NaN % Number.MAX_VALUE === Not-a-Number. Actual: ' + (NaN % Number.MAX_VALUE));
} 

//CHECK#7
if (isNaN(Number.NaN % Number.MIN_VALUE) !== true) {
  $ERROR('#7: NaN % Number.MIN_VALUE === Not-a-Number. Actual: ' + (NaN % Number.MIN_VALUE)); 
}

//CHECK#8
if (isNaN(Number.NaN % 1) !== true) {
  $ERROR('#8: NaN % 1 === Not-a-Number. Actual: ' + (NaN % 1));  
}