You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the other hand, @printf (which uses a different definition for the precision) returns:
julia>@printf("%.0e", 2.45e-12)
2e-12
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. But float("2e-12") works, so that's apparently not a problem.
The text was updated successfully, but these errors were encountered:
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: