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

Fix edge-cases for Complex.pow(.zero, <Int>), and Real.pow(zero, zero) #235

Merged
merged 3 commits into from
Sep 15, 2022

Conversation

stephentyrone
Copy link
Member

@stephentyrone stephentyrone commented Sep 15, 2022

Previously the complex pow unconditionally returned .zero, but they should actually return one of .infinity, .zero, or .one depending on whether the exponent is negative, positive, or zero, matching the behavior of real types.

Similarly, the real pow didn't quite match IEEE 754 powr for the (0, 0) case (should be .nan, was 0).

@stephentyrone
Copy link
Member Author

@swift-ci test

@stephentyrone stephentyrone changed the title Fix edge-cases for Complex.pow(.zero, <Int>) Fix edge-cases for Complex.pow(.zero, <Int>), and Real.pow(zero, zero) Sep 15, 2022
@stephentyrone
Copy link
Member Author

@swift-ci test

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.

1 participant