mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
Improve behaviour of llAtan2 to make it closer to SL's.
Especially regarding NaN inputs. Add regression tests.
This commit is contained in:
parent
159fae90bf
commit
14488ddd92
2 changed files with 32 additions and 0 deletions
24
testfuncs.py
24
testfuncs.py
|
@ -880,6 +880,30 @@ def do_tests():
|
|||
test('llAsin(2.0)', NaN)
|
||||
test('llAcos(2.0)', NaN)
|
||||
test('llAtan2(0.0, 0.0)', 0.0)
|
||||
test('llAtan2(-0.0, -1.0)', F32(-math.pi))
|
||||
test('llAtan2(0.0, -1.0)', F32(math.pi))
|
||||
test('llAtan2(-Infinity, -1.0)', F32(-math.pi/2))
|
||||
test('llAtan2(Infinity, -1.0)', F32(math.pi/2))
|
||||
test('llAtan2(NaN, -1.0)', NaN)
|
||||
test('llAtan2(NaN, -0.0)', NaN)
|
||||
test('llAtan2(NaN, 0.0)', NaN)
|
||||
test('llAtan2(NaN, 1.0)', NaN)
|
||||
test('llAtan2(-NaN, -1.0)', -NaN)
|
||||
test('llAtan2(-NaN, -0.0)', -NaN)
|
||||
test('llAtan2(-NaN, 0.0)', -NaN)
|
||||
test('llAtan2(-NaN, 1.0)', -NaN)
|
||||
test('llAtan2(-1.0, NaN)', NaN)
|
||||
test('llAtan2(-0.0, NaN)', NaN)
|
||||
test('llAtan2( 0.0, NaN)', NaN)
|
||||
test('llAtan2( 1.0, NaN)', NaN)
|
||||
test('llAtan2(-1.0, -NaN)', -NaN)
|
||||
test('llAtan2(-0.0, -NaN)', -NaN)
|
||||
test('llAtan2( 0.0, -NaN)', -NaN)
|
||||
test('llAtan2( 1.0, -NaN)', -NaN)
|
||||
test('llAtan2(-NaN, -NaN)', -NaN)
|
||||
test('llAtan2(-NaN, NaN)', NaN)
|
||||
test('llAtan2(NaN, -NaN)', NaN)
|
||||
test('llAtan2(NaN, NaN)', NaN)
|
||||
|
||||
# nan and -nan in llList2CSV
|
||||
test('llList2CSV([llSin(F32(4e38))])', u'-nan')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue