-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Grisu._show() with 1 digit precision shows 2 digits #6885
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This behavior may be misleading since I would consider that
2.0e-12
means the 0 is significant, which isn't the case with the second command below.On the other hand,
@printf
(which uses a different definition for the precision) returns:I guess an argument in favor of Grisu's behavior is that one gets a standard representation where
2.0
is necessarily a float, i.e. it cannot be mistakenly parsed back as an integer before the parser finds out there's an exponent part. Butfloat("2e-12")
works, so that's apparently not a problem.The text was updated successfully, but these errors were encountered: