Check that the tests distinguish 0.0 and -0.0.

This commit is contained in:
Sei Lisa 2016-12-25 01:11:12 +01:00
parent 7ca81020a0
commit a68bbeac23

View file

@ -520,6 +520,11 @@ def do_tests():
test('reallyequal(NaN, -Indet, 0.0)', True) test('reallyequal(NaN, -Indet, 0.0)', True)
test('reallyequal(NaN, -(Infinity*0), 0.0)', True) test('reallyequal(NaN, -(Infinity*0), 0.0)', True)
test('reallyequal(Infinity*0, Indet, 0.0)', True) test('reallyequal(Infinity*0, Indet, 0.0)', True)
# Check that it properly distinguishes -0.0 and 0.0
test('reallyequal(-0.0, 0.0, 0.0)', False)
test('reallyequal(0.0, -0.0, 0.0)', False)
test('reallyequal(0.0, 0.0, 0.0)', True)
test('reallyequal(-0.0, -0.0, 0.0)', True)
shouldexcept('div(1.0, 0.0)', ELSLMathError) shouldexcept('div(1.0, 0.0)', ELSLMathError)
shouldexcept('div(1, 0)', ELSLMathError) shouldexcept('div(1, 0)', ELSLMathError)