Because print resp. the stringification of a float might round differently than int does. Also, What Every Computer Scientist Should Know About Floating-Point Arithmetic, also, don't use floating point numbers at all when computing monetary amounts. Do your calculations in cents, or thousandths of cents or whatever precision is needed. But never in floating precision.
In reply to Re: Floating point problems
by Corion
in thread Floating point problems
by bluescreen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |