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

implement divmod and gcd in C #1292

Merged
merged 2 commits into from
Dec 4, 2024
Merged

Conversation

johnynek
Copy link
Owner

@johnynek johnynek commented Dec 3, 2024

the strategy here was to implement an algorithm in scala, which I scalachecked with lots of assertions verifying the claims and invariants, then transcribe that algorithm over.

It can still be optimized. That said, it is likely not an optimal algorithm, though I hope not disastrous. I think the recursion basically amounts to long division.

@johnynek johnynek merged commit eb9a51b into main Dec 4, 2024
8 checks passed
@johnynek johnynek deleted the oscar/20241203-implement_divmod branch December 4, 2024 02:36
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