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
The following two inputs result in the same number, i.e. x === y:
x = parse(Float128,"1e-33")
y = parse(Float128,"1.00000000000000000000000000000000005e-33")
But they are displayed as 1.00000000000000000000000000000000005e-33. Shouldn't the policy be to choose the simpler form 1e-33 for display if both are correct?
The text was updated successfully, but these errors were encountered:
Yes, simpler forms would be preferable. However this is quite difficult in general (I'll refer you to the literature on the Dragon and Grisu algorithms for Float32 and Float64). We currently rely on the formatting provided by libquadmath; its maintainers may be able to say whether improvements are feasible.
Yes, I know this is tricky. I noticed this problem because I was testing my own implementation of the Burger/Dybvig algorithm which gives the correct answer in this particular case. It's not a big deal and it's fine with me if you close this issue. If I find enough time I might be tempted to port the algorithm to Julia, but I'm not very good at writing optimized Julia code yet and whatever I come up with will most likely be too slow for production code.
The following two inputs result in the same number, i.e.
x === y
:But they are displayed as
1.00000000000000000000000000000000005e-33
. Shouldn't the policy be to choose the simpler form1e-33
for display if both are correct?The text was updated successfully, but these errors were encountered: