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

Condition is always false #362

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Condition is always false #362

wants to merge 1 commit into from

Conversation

helpau
Copy link
Contributor

@helpau helpau commented Dec 25, 2024

Benchmarks(for gcd) shows probably significant(about 15%) improvement

@helpau helpau requested a review from ckrause as a code owner December 25, 2024 17:58
Copy link
Contributor

@ckrause ckrause left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good in general, but we must be 100% sure that this case cannot occur to avoid an infinite loop. need to check the details of the mod() for this

@helpau
Copy link
Contributor Author

helpau commented Dec 27, 2024

looks good in general, but we must be 100% sure that this case cannot occur to avoid an infinite loop. need to check the details of the mod() for this

Sorry, I can't write a strict mathematical proof. The optimization seemed pretty obvious to me because 0<=a,b<INF, and also because a,b and gcd(a,b) are decreasing at each iteration.

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