uiua-lang/uiua

Bugs with `complex` math

Opened this issue · 1 comments

bkDJ commented

Some examples of surprising results. Not sure which should be ignored due to floating point imprecision, and which are actual issues.

ⁿ1/2 ℂ0 ¯1   # NaN
=i √ ℂ0 ¯1   # 0
=ℂ∞ 0 ×i∞    # 0
=ℂ2 0 √ℂ0 ¯4 # 0

Lines 2 and 4 were not properly displaying the error bound. I've fixed that in 89f4faf.

I'm not sure what to do about lines 1 and 3.
Line 1 has to do with the fact that for doubles, ⁿ1/2 ¯1 is NaN.
Line 3 has to do with the fact that ×0 ∞ is NaN.
While these could be fixed with checks in the interpreter, it would slow down complex arithmetic, so I'm not sure it's something I want to do.