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

add overflow checking for abs(::Rational) #48912

Merged
merged 3 commits into from
Mar 10, 2023

Conversation

vmpyr
Copy link
Contributor

@vmpyr vmpyr commented Mar 6, 2023

Closes: #48744

Thanks to @mikmoore for pointing out the solution clearly. I have also added a test for the new functionality and a test for the hash function (which has been changed) as well.

I had made the PR earlier, but had to close and delete it because of some mistakes I made on the git side of things.

@oscardssmith oscardssmith added performance Must go faster rationals The Rational type and values thereof labels Mar 6, 2023
@oscardssmith
Copy link
Member

Safer and 30% faster! (29 ns to 18 on my computer).

@dkarrasch
Copy link
Member

Let's rerun CI for safety, though test failure seems to be due to internet connection issues.

@dkarrasch dkarrasch closed this Mar 9, 2023
@dkarrasch dkarrasch reopened this Mar 9, 2023
@dkarrasch dkarrasch added the merge me PR is reviewed. Merge when all tests are passing label Mar 9, 2023
@dkarrasch dkarrasch merged commit ad304ea into JuliaLang:master Mar 10, 2023
@dkarrasch dkarrasch removed the merge me PR is reviewed. Merge when all tests are passing label Mar 10, 2023
Xnartharax pushed a commit to Xnartharax/julia that referenced this pull request Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster rationals The Rational type and values thereof
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should abs(::Rational) check for integer overflow?
3 participants