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

Fixes #252, incorrect math computing half digits #475

Merged
merged 1 commit into from
Jul 22, 2019

Conversation

kdt3rd
Copy link
Contributor

@kdt3rd kdt3rd commented Jul 21, 2019

Based on float / double math for base 10 digits, with 1 bit of rounding
error, the equation should be floor( mantissa_digits - 1 ) * log10(2) ),
which in the case of half becomes floor( 10 * log10(2) ) or 3

Signed-off-by: Kimball Thurston kdt3rd@gmail.com

…gits

Based on float / double math for base 10 digits, with 1 bit of rounding
error, the equation should be floor( mantissa_digits - 1 ) * log10(2) ),
which in the case of half becomes floor( 10 * log10(2) ) or 3

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
@kdt3rd kdt3rd requested a review from peterhillman July 21, 2019 20:18
Copy link
Contributor

@peterhillman peterhillman left a comment

Choose a reason for hiding this comment

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

Looks good.
This will also change numeric_limits::digits10

@kdt3rd kdt3rd merged commit bca0bc0 into AcademySoftwareFoundation:master Jul 22, 2019
@kdt3rd kdt3rd deleted the fix_252 branch July 22, 2019 08:08
@cary-ilm cary-ilm added this to the v2.4.0 milestone Aug 10, 2019
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.

None yet

3 participants