Round a quotient of a non-default mode by its remainder - #1454
Open
ibmibmibm wants to merge 1 commit into
Open
Conversation
- The divides of the non-default rounding modes dropped the remainder of the wide quotient before the constructor rounded it. A mode which must move away from the truncated quotient could not. - The 32 and 64 bit types held five or six digits past the precision, thus the defect showed only when all of them were zero. The 128 bit types held zero or one digit, thus most quotients were wrong, and fe_dec_to_nearest_from_zero was wrong too. - The remainder now goes in as one sticky digit after the wide quotient. The 128 bit divide also takes one digit more, thus the constructor has a quotient digit to round before the sticky digit. - Both operands of the 128 bit divide have 34 digits, thus the quotient has at most 37 and the block for a wider quotient was dead. It went away. Fixes boostorg#1453
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1454 +/- ##
=========================================
+ Coverage 98.4% 98.5% +0.1%
=========================================
Files 300 301 +1
Lines 25188 25223 +35
Branches 2189 2189
=========================================
+ Hits 24774 24832 +58
+ Misses 414 391 -23
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
ibmibmibm
marked this pull request as ready for review
September 14, 2026 03:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
before the constructor rounded it. A mode which must move away from the truncated
quotient could not.
showed only when all of them were zero. The 128 bit types held zero or one digit, thus
most quotients were wrong, and fe_dec_to_nearest_from_zero was wrong too.
divide also takes one digit more, thus the constructor has a quotient digit to round
before the sticky digit.
and the block for a wider quotient was dead. It went away.
Fixes #1453