michael@0: function test1() { michael@0: for (var i = 0; i <= 90; i++) { michael@0: var x = i/10.0; michael@0: if (Math.round(x) !== Math.floor(x + 0.5)) michael@0: assertEq(0, 1); michael@0: } michael@0: } michael@0: test1(); michael@0: michael@0: function test2() { michael@0: for (var i = -5; i >= -90; i--) { michael@0: if (i === -5) michael@0: x = -0.500000000000001; michael@0: else michael@0: x = i/10.0; michael@0: michael@0: if (Math.round(x) !== Math.floor(x + 0.5)) michael@0: assertEq(0, 1); michael@0: } michael@0: } michael@0: test2();