mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Produce more math errors in division
Besides dividing by zero, any result producing NaN including inf/inf, NaN/anything, anything/NaN causes a math error as well. We only contemplated NaN/anything and neglected the rest, so we generalize it.
This commit is contained in:
parent
28a8f0757c
commit
23b27bd3af
2 changed files with 7 additions and 3 deletions
|
@ -493,6 +493,9 @@ def do_tests():
|
|||
|
||||
shouldexcept('div(1.0, 0.0)', ELSLMathError)
|
||||
shouldexcept('div(1, 0)', ELSLMathError)
|
||||
shouldexcept('div(NaN, 1)', ELSLMathError)
|
||||
shouldexcept('div(1, NaN)', ELSLMathError)
|
||||
shouldexcept('div(F32(1e40), F32(1e40))', ELSLMathError)
|
||||
shouldexcept('zstr("blah")', ELSLInvalidType)
|
||||
test(r'zstr(Key(u"xy\0zzy"))', Key(u'xy'))
|
||||
test('typecast(Infinity, unicode)', u'Infinity')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue