LSL-PyOptimizer/unit_tests/expr.suite/operators.lsl
Sei Lisa 00b103c8aa Simplify v*q, make q*q more accurate, add q*q and q/q unit tests
vector * quaternion: Simplified by precalculating the repeated products and removing math.fsum.

quaternion * quaternion: Add more F32's to get a result closer to SL's (still not there, but we're definitively closer now).

We left out quaternion/quaternion in the tests, and the q*q test was not general enough (had many zeros). Remedied that.
2019-05-23 01:57:27 +02:00

110 lines
1.6 KiB
Text

[ 1*0
, (-1)*0
, (-1.)*0.
, (-0.)*1.
, (-0.)*-1.
, 0/9
, (-1)/-9
, (-8)/-9
, (-9)/-9
, (-1)/9
, (-8)/9
, (-9)/9
, 1/-9
, 8/-9
, 9/-9
, 1/9
, 8/9
, 9/9
, 0x80000000/-1
, <3,6,9>/3
, -(-2147483648)
, -(2147483647)
, (-2147483648)+(-1)
, (-2147483648.)+(-1.)
, (-2147483648.)+(-1)
, (-2147483648)+(-1.)
, -<-.5,.5,.4>
, -<-.5,.5,.4,-.4>
, <1.,2.,3.>+<2.,4.,6.>
, <1.,2.,3.,4.>+<2.,4.,6.,8.>
, ["1"] + ["2"]
, "1" + ["2"]
, ["1"] + "2"
, "1" + "2"
, 1-2
, 1.-2
, 1-2.
, 1.-2.
, (-2147483647)-2
, <1.,2.,3>-<2.,4.,6>
, <1.,2.,3.,4.>-<2.,4.,6.,8.>
, 2.*<1.,2.,3.>
, <1.6, 3.2, 6.4, 6.8> * <1., 0., 0., 0.>
, 1*2
, 1*2.
, 1.*2
, 1.*2.
, <3.,4.,5.>*<3.,4.,5.>
, <3.,4.,5.>*1.
, <3.,4.,5.>*ZERO_ROTATION
, <3.,4.,5.>*<.22,.26,.38,.86>
, <3.,4.,5.>/<.22,.26,.38,.86>
, "FIXME: We're not obtaining the same as SL; expected output should be 8.32 exact rather than 8.320001"
, <3.,5.,7.,17.>*<.22,.26,.38,.86>
, <3.,5.,7.,17.>/<.22,.26,.38,.86>
, 0 % 5
, 1 % 5
, 2 % 5
, 3 % 5
, 4 % 5
, 5 % 5
, 6 % 5
, (-1) % 5
, (-2) % 5
, (-3) % 5
, (-4) % 5
, (-5) % 5
, (-6) % 5
, 0 % -5
, 1 % -5
, 2 % -5
, 3 % -5
, 4 % -5
, 5 % -5
, 6 % -5
, (-1) % -5
, (-2) % -5
, (-3) % -5
, (-4) % -5
, (-5) % -5
, (-6) % -5
, (-2147483648) % 5
, (-2147483648) % -5
, 5 % (-2147483648)
, 5 % 2147483647
, <1,0,0>%<0,1,0>
, 1 << -33
, 1 << -1
, 1 << 0
, 1 << 1
, 1 << 31
, 1 << 32
, 1 << 33
, 1 << 63
, 1 << 64
, 1 << 66
, 1 << 66
, 0xC0000000 >> -33
, 0xC0000000 >> -1
, 0xC0000000 >> 0
, 0xC0000000 >> 1
, 0xC0000000 >> 30
, 0xC0000000 >> 31
, 0xC0000000 >> 32
, 0xC0000000 >> 33
, 0xC0000000 >> 63
, 0xC0000000 >> 64
, 0xC0000000 >> 65
, 0xC0000000 >> 66
]