ree-1.8.7-2010.02 :003 > (10015.8*100.0).to_i => 1001579 ree-1.8.7-2010.02 :004 > 10015.8*100.0 => 1001580.0 ree-1.8.7-2010.02 :005 > 1001580.0.to
http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
>> sprintf("%.16f", 10015.8*100.0) => "1001579.9999999999000000"
And Float#to_i truncates this to 1001579.
Float#to_i