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

printf_("%.1e", 9.96) prints "10.0e+00", should print "1.0e+01" #120

Open
eyalroz opened this issue Aug 3, 2021 · 0 comments
Open

printf_("%.1e", 9.96) prints "10.0e+00", should print "1.0e+01" #120

eyalroz opened this issue Aug 3, 2021 · 0 comments

Comments

@eyalroz
Copy link

eyalroz commented Aug 3, 2021

(migrated from eyalroz#24):

When we

printf_("%.3e", 9.96)

the rounding to 1 decimal precision digit makes the value 10.0, which should print as 1.0e+01 in exponent format. Unfortunately, library do not make sure and "re-normalize" the result of rounding, and produces 10.0e+00 instead.

eyalroz referenced this issue in eyalroz/printf Aug 4, 2021
…ed output in two other testcase, which was indeed what the library was producing, but is invalid ("%e" output with a two-digit integral part).
eyalroz added a commit to eyalroz/printf that referenced this issue Aug 4, 2021
…g, we now check whether the rounding of the fractional part according to the precision limits breaks the "%e" constraint of a single-digit integral part.
eyalroz added a commit to eyalroz/printf that referenced this issue Aug 4, 2021
…d corrected the expected output in two other testcase, which was indeed what the library was producing, but is invalid ("%e" output with a two-digit integral part).
eyalroz added a commit to eyalroz/printf that referenced this issue Aug 4, 2021
…thin an "%e" printing, we now check whether the rounding of the fractional part according to the precision limits breaks the "%e" constraint of a single-digit integral part.
eyalroz added a commit to eyalroz/printf that referenced this issue Aug 4, 2021
…thin an "%e" printing, we now check whether the rounding of the fractional part according to the precision limits breaks the "%e" constraint of a single-digit integral part.
eyalroz added a commit to eyalroz/printf that referenced this issue Aug 5, 2021
…thin an "%e" printing, we now check whether the rounding of the fractional part according to the precision limits breaks the "%e" constraint of a single-digit integral part.
eyalroz added a commit to eyalroz/printf that referenced this issue Aug 5, 2021
…thin an "%e" printing, we now check whether the rounding of the fractional part according to the precision limits breaks the "%e" constraint of a single-digit integral part.
eyalroz added a commit to eyalroz/printf that referenced this issue Aug 6, 2021
…thin an "%e" printing, we now check whether the rounding of the fractional part according to the precision limits breaks the "%e" constraint of a single-digit integral part.
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

No branches or pull requests

1 participant