Skip to content

Fix a bug in root and add a test case for it. #25326

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

Merged
merged 1 commit into from
Jun 10, 2019

Conversation

stephentyrone
Copy link
Contributor

For odd roots of negative values, we need to take the root of the magnitude of the number to avoid a NaN from the platform's implementation of pow, then restore the sign afterwards. We had the basic logic in place already, but were missing the step of taking the magnitude first. Also modified a test case to find this error.

For odd roots of negative values, we need to take the root of the *magnitude* of the number to avoid a NaN from the platform's implementation of `pow`, then restore the sign afterwards. We had the basic logic in place already, but were missing the step of taking the magnitude first. Also modified a test case to find this error.
@stephentyrone
Copy link
Contributor Author

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit bab64fb into swiftlang:master Jun 10, 2019
stephentyrone pushed a commit to stephentyrone/swift that referenced this pull request Jun 12, 2019
@stephentyrone stephentyrone deleted the negative-root-bug branch February 8, 2023 00:34
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.

2 participants