blob: aeb782c27d57a191ac1a57d94bbc3e3d94535b26 (
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
|
// 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.15_A7;
* @section: 15.8.2.15;
* @assertion: If x is less than or equal to -0 and x is greater than or equal to -0.5, Math.round(x) is equal to -0;
* @description: Checking if Math.round(x) is equal -0, where x is equal to 0, equal to -0.5, or less than -0 while greater than -0.5;
*/
// Converted for Test262 from original Sputnik source
ES5Harness.registerTest( {
id: "S15.8.2.15_A7",
path: "TestCases/15_Native/15.8_The_Math_Object/15.8.2_Function_Properties_of_the_Math_Object/15.8.2.15_round/S15.8.2.15_A7.js",
assertion: "If x is less than or equal to -0 and x is greater than or equal to -0.5, Math.round(x) is equal to -0",
description: "Checking if Math.round(x) is equal -0, where x is equal to 0, equal to -0.5, or less than -0 while greater than -0.5",
test: function testcase() {
// CHECK#1
if (Math.round(-0) !== -0)
{
$ERROR("#1: 'Math.round(-0) !== -0'");
}
// CHECK#2
if (Math.round(-0.5) !== -0)
{
$ERROR("#2: 'Math.round(-0.5) !== -0'");
}
// CHECK#3
if (Math.round(-0.25) !== -0)
{
$ERROR("#3: 'Math.round(-0.25) !== -0'");
}
}
});
|