diff options
Diffstat (limited to 'test/mjsunit/math-sqrt.js')
-rw-r--r-- | test/mjsunit/math-sqrt.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/mjsunit/math-sqrt.js b/test/mjsunit/math-sqrt.js index fb00d5ba..43fbf6b2 100644 --- a/test/mjsunit/math-sqrt.js +++ b/test/mjsunit/math-sqrt.js @@ -29,7 +29,11 @@ function test(expected_sqrt, value) { assertEquals(expected_sqrt, Math.sqrt(value)); - if (isFinite(value)) { + if (isFinite(value)) { + if (value === 0 && (1 / value) == -Infinity) { + // Math.pow(-0, 0.5) must be zero, but Math.sqrt(-0) is -0. + expected_sqrt = 0; + } assertEquals(expected_sqrt, Math.pow(value, 0.5)); } } |