mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Fix more test failures on Windows.
On Windows, float('nan') produces Indeterminate. To fix, set Indet first and then set NaN to the opposite.
This commit is contained in:
parent
efcf1cb1df
commit
d54ba42330
2 changed files with 3 additions and 3 deletions
|
@ -76,8 +76,8 @@ ZERO_ROTATION = Quaternion((0.0, 0.0, 0.0, 1.0))
|
||||||
NULL_KEY = u'00000000-0000-0000-0000-000000000000'
|
NULL_KEY = u'00000000-0000-0000-0000-000000000000'
|
||||||
|
|
||||||
Infinity = float('inf')
|
Infinity = float('inf')
|
||||||
NaN = float('nan')
|
|
||||||
Indet = Infinity * 0
|
Indet = Infinity * 0
|
||||||
|
NaN = -Indet # Don't use float("nan") - Windows gets upset.
|
||||||
|
|
||||||
class ELSLTypeMismatch(Exception):
|
class ELSLTypeMismatch(Exception):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
|
@ -518,8 +518,8 @@ def do_tests():
|
||||||
test('reallyequal(NaN, Indet, 0.0)', False)
|
test('reallyequal(NaN, Indet, 0.0)', False)
|
||||||
test('reallyequal(-NaN, Indet, 0.0)', True)
|
test('reallyequal(-NaN, Indet, 0.0)', True)
|
||||||
test('reallyequal(NaN, -Indet, 0.0)', True)
|
test('reallyequal(NaN, -Indet, 0.0)', True)
|
||||||
test('reallyequal(NaN, float("nan"), 0.0)', True)
|
test('reallyequal(NaN, -(Infinity*0), 0.0)', True)
|
||||||
test('reallyequal(-float("nan"), Indet, 0.0)', True)
|
test('reallyequal(Infinity*0, Indet, 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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue