in reply to int's behaviour

Just like there are periodic numbers in decimal (1/3), there are periodic numbers in binary (1/10). To store those numbers as a decimal number (like floats do) would require infinite storage, so some error is introduced into those numbers when storing them in floats. I suspect your problem lies such those numbers. Here are two examples
>perl -le"print substr +(reverse unpack 'B*', pack 'd', shift), 12" .1 1101100110011001100110011001100110011001100101011001 ^^^^ period >perl -le"printf '%.16e', shift" .1 1.0000000000000001e-001 ^ error

The error isn't always obvious at first since the system does a little bit of rounding automatically, but some errors can easily be noticed when the error is compounded through addition.

>perl -le"$x=.1; $n=$x*100; print int $n" 10 >perl -le"$x=.1; $n+=$x for 1..100; print int $n" 9

Note: reverse is needed on x86 machines since they store floats in little-endian order.