We don't bite newbies here... much | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
> if the stringification provided an extra 2 decimal digits
How this? There are only 2-3 bits left and 2**3 < 10, so no way to get a 16th decimal out of a double. I know it's confusing. But if you stuff a number with more than 15 decimals into a double you'll have loss anyway. And I doubt it's better in JS or python. > "cmp_ok(0.14, '==', 1.4 / 10 Well, but on the other hand eq should work because of the magic. IMHO most people understand rounding errors, the point of confusion is that exact decimal fractions are not always exact binarie floats. Probably we should have a shortcut for something like printf "%.18f" to facilitate diagnosis.
Cheers Rolf In reply to Re^4: int() function
by LanX
|
|