jzrake / lunum

Numeric arrays for the Lua programming language
35 stars 6 forks source link

order of complex operands matters #3

Closed jzrake closed 12 years ago

jzrake commented 12 years ago

Arithmetic works incorrectly between complex and array when the complex number comes first, but correctly when it comes after the array:

print(lunar.I + lunar.range(10)) -- > 0+1j print(lunar.range(10) + lunar.I) -- > [ 0+1j, 1+1j, 2+1j, 3+1j, 4+1j, 5+1j, 6+1j, 7+1j, 8+1j, 9+1j ]

jzrake commented 12 years ago

This bug was resolved in 5fd400381c7f18be996ef571d2d724f73c9bf0f6. If either of the arguments to _complex_binary_op1 is an array, then the operation is deferred to _array_binary_op1.