blob: a0d0e29f626f031f0e8bcda429cb22944d0ec218 (
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
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S8.5_A11_T2;
* @section: 8.5, 7.8.3;
* @assertion: The integer 0 has two representations, +0 and -0;
* @description: Compare positive_zero and negative_zero;
*/
var p_zero=+0;
var n_zero=-0;
//CHECK #1
if ((p_zero == n_zero) !== true){
$ERROR('#1: var p_zero=+0; var n_zero=-0; p_zero != n_zero');
}
//CHECK #2
if ((n_zero == 0) !== true){
$ERROR('#2: var p_zero=+0; var n_zero=-0; n_zero == 0');
}
//CHECK #3
if ((p_zero == -0) !== true){
$ERROR('#3: var p_zero=+0; var n_zero=-0; p_zero == -0');
}
//CHECK #4
if ((p_zero === 0) !== true){
$ERROR('#4: var p_zero=+0; var n_zero=-0; p_zero === 0');
}
//CHECK #5
if ((n_zero === -0) !== true){
$ERROR('#5: var p_zero=+0; var n_zero=-0; n_zero === -0');
}
|