-
Notifications
You must be signed in to change notification settings - Fork 3
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
Log10 #544
Log10 #544
Conversation
while(g > one) | ||
{ | ||
// TODO(ckormanyos) Do we really have to multiply individual powers | ||
// of 10 here? Or is there a reliable way to simply use pow10()? | ||
// For instance count intagral orders of exp10val and divide by pow10(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The significand is normalized before being returned by frexp10 so you can divide by pow10(digits10 - 1) to avoid the loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
significand is normalized before being returned by frexp10 so you can divide by pow10(digits10 - 1) to avoid the loop
OK @mborland cool but now I'm stuck on another point. Do you know how to recognize a pure power of
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use detail::remove_trailing_zeros
and compare the trimmed_number member to 1. That is about as efficient as it's going to get I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Will commit cool reaction to advice.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #544 +/- ##
=========================================
- Coverage 98.8% 98.6% -0.1%
=========================================
Files 189 194 +5
Lines 11700 11525 -175
Branches 0 1380 +1380
=========================================
- Hits 11556 11361 -195
- Misses 144 164 +20
... and 67 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
OK Matt (@mborland) I finally was able to implement a I did notice, however, that there are several places in the code where we end up using triple-conditional type-definitions in order to arrive at |
I guess it would be easy to add the same typedef into each of the classes and just query that. I'm cool with it. |
No description provided.