Skip to content

Fix bug in exp2() #9999

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 4 commits into from
Oct 26, 2021
Merged

Fix bug in exp2() #9999

merged 4 commits into from
Oct 26, 2021

Conversation

LewisGaul
Copy link
Contributor

@LewisGaul LewisGaul commented Oct 22, 2021

Fixes #9991.

Fix bad translation from C - lots of reliance on implicit overflow/truncation/bit manipulation!

Added testcases reproduced the failure (for f64 only), now passing.

The method used in exp2_32() is slightly different to exp2_64(), but there was an overflow addition that seemed to also need fixing to mirror musl (old implementation).

@andrewrk
Copy link
Member

Thanks! The failing CI is #10008, so we'll take the strategy of merging now and then dealing with any breakage later, since this fixes a math function.

@andrewrk andrewrk merged commit f890de6 into ziglang:master Oct 26, 2021
@LewisGaul LewisGaul deleted the LG-exp2_64-bug branch August 7, 2022 13:07
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.

exp2_64() broken for negative inputs
3 participants