Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs with complex math #489

Open
bkDJ opened this issue Apr 27, 2024 · 1 comment
Open

Bugs with complex math #489

bkDJ opened this issue Apr 27, 2024 · 1 comment

Comments

@bkDJ
Copy link
Contributor

bkDJ commented Apr 27, 2024

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
@kaikalii
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants