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

abs(0 + 0i) evaluates to NaN #328

Closed
auscompgeek opened this Issue Apr 22, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@auscompgeek

auscompgeek commented Apr 22, 2015

Attempting to evaluate abs(0 + 0i) returns NaN. This appears to be an unnoticed edge case in avoiding overflows when calculating the absolute value of a complex number.

abs(0 + 0i) should, obviously, return 0.

FSMaxB added a commit to FSMaxB/mathjs that referenced this issue Apr 22, 2015

Fix Bug josdejong#328 abs(0+0i) evaluates to NaN
This is a quick fix. This might need a better solution though (
numerical instabilities still remain ).
@FSMaxB

This comment has been minimized.

Collaborator

FSMaxB commented Apr 22, 2015

I fixed the problem. It was a division by zero. I'll make a pull request.

@josdejong josdejong closed this in 95c4e33 Apr 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment