in reply to How to use the int-function?

Please read What Every Computer Scientist Should Know About Floating-Point Arithmetic. The problem is not that int is misbehaving, but that the numbers aren't as exact as they appear.

Perl rounds them upon printing, it looks like an even number, but it is not.

$ perl -wE 'say +(1.255 * 100 + 0.5) * 10000000' 1260000000 $ perl -wE 'printf "%.20f\n", (1.255 * 100 + 0.5) * 10000000' 1259999999.99999976158142089844