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

Handle negative numbers in sqrt properly. #18174

Closed
wants to merge 1 commit into from

Conversation

huonw
Copy link
Member

@huonw huonw commented Oct 20, 2014

Closes #9987.

@rust-highfive
Copy link
Collaborator

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@alexcrichton
Copy link
Member

Could you add a test for -0.0 as well? It looks like LLVM handles this, but it probably can't hurt to have a test for it.

Also, can you clarify the documentation in Float::sqrt to say what happens in these cases? Other than that, r=me, thanks!

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

Successfully merging this pull request may close these issues.

f32/f64 sqrt has undefined behaviour for values less than -0.0
4 participants