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.
In reply to Re^5: float values and operators
by dave_the_m
in thread float values and operators
by soulchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |