-
Notifications
You must be signed in to change notification settings - Fork 7
Attempt rudimentary repair issue 1110 #1121
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
Conversation
|
Ok I put this on draft. There is a preliminary fix. I still need to put in explicit tests for the issue, as i seem to have forgotten these. This first fix, if we can agree on it and its scope, could be about ready tomorrow. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1121 +/- ##
=========================================
+ Coverage 99.4% 99.4% +0.1%
=========================================
Files 246 247 +1
Lines 16808 16861 +53
Branches 1814 1814
=========================================
+ Hits 16701 16754 +53
Misses 107 107
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
OK, this PR now handles small as well as large arguments, as mentioned in #1110. I have marked this PR as ready for review. @mborland if you like, you can take a look. I'm happy with the patch as such, but somewhat concerned about the added time/complexity, even though I protected the run-time with several filtering-style if-queries. We might be able to refine this patch down the road with improved internals from the library, but this patch seems to "do the trick". Cc: @libbooze |
|
Let me ask the original author of the remove_trailing_zeros algorithm if there's a better way to integrate the change. I'm sure we will get bit in other places (like charconv uses this for printing shortest mode) |
Yes Matt (@mborland) that is what I was thinking too. It is really just one single table entry needing special handling at 128-bits only. Maybe we could detect this case and treat it at its source. I will just let this PR sit here until we reach a decision. |
|
I think this cast is the real issue: https://github.com/cppalliance/decimal/blob/develop/include/boost/decimal/detail/cmath/sqrt.hpp#L64 The starting significand is: 1000000000000000000000000000000010 By casting to unsigned instead of just comparing against 1U the answer becomes true (1U == 1U) instead of false (100000000000000000000000000000001 == 1U) |
|
See: #1130 |
No description provided.