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 mod when the divisor is slightly greater than the half of dividend (#312) #317

Merged
merged 1 commit into from Jan 10, 2024

Conversation

zlasd
Copy link
Contributor

@zlasd zlasd commented Mar 31, 2023

d.DivRound(d2, -d.exp+1) can round up when the original dividend result is closer to the ceil value. Then the Truncate function will not work as expected.

Use d.QuoRem with 0 precision can fix this.

Fix #312

Copy link
Member

@mwoss mwoss left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for fixing this issue! And deeply apologize for for late review :<

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.

Mod calculation error
3 participants