-
Notifications
You must be signed in to change notification settings - Fork 479
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
Siginificant-digits-to-precision transition made invalid by rounding #124
Comments
eyalroz
added a commit
to eyalroz/printf
that referenced
this issue
Aug 14, 2021
…ing owhen printing "%g"-specifier values in "%f" notation. Also, added a testcase check for when such rollover occurs.
eyalroz
added a commit
to eyalroz/printf
that referenced
this issue
Aug 14, 2021
…er component during rounding when printing "%g"-specifier values in decimal notation. Also, added a testcase check for when such rollover occurs.
eyalroz
added a commit
to eyalroz/printf
that referenced
this issue
Aug 15, 2021
…er component during rounding when printing "%g"-specifier values in decimal notation. Also, added a testcase check for when such rollover occurs.
eyalroz
added a commit
to eyalroz/printf
that referenced
this issue
Aug 15, 2021
…er component during rounding when printing "%g"-specifier values in decimal notation. Also, added a testcase check for when such rollover occurs.
eyalroz
added a commit
to eyalroz/printf
that referenced
this issue
Sep 27, 2021
…er component during rounding when printing "%g"-specifier values in decimal notation. Also, added a testcase check for when such rollover occurs.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If we
sprintf(buffer,"%#.3g", 99.99);
, we get100.0
- with 4 significant digits - while we should be getting100.
, with 3 significant digits.This is because, initially, we find the power of 10 to be 2; then we translate significant digits to precision, setting the precision to 1. But after this happens, we perform rounding with precision 1, so that the power of 10 becomes 3...
The text was updated successfully, but these errors were encountered: