in reply to Re^4: float values and operators
in thread float values and operators
Hrm, that's what I get, too. So why doesn't the imprecision show up when you print the variables out?Because print doesn't print the full precision of its args. That's what printf is for:
$ perl585 -e'print 26.6+0.2, "\n"' 26.8 $ perl585 -e'printf "%.20f\n ", 26.6+0.2' 26.80000000000000071054
Dave.
|
|---|