I’m sure this has been hashed out somewhere on the list before, but
my searches have turned up fruitless. I had a strange issue come up
while diagnosing a unit test failure.
Notice the first dialog compared with the rest of this IRB session.
What causes -3930.0 to be converted to a Fixnum as -3929 only after
it’s been multiplied by 100 or 100.0? Even weirder is that it seems
to only be this number. Can I workaround this?
(-39.30 * 100).to_i
(-39.30 * 100.0).to_i
(-39.31 * 100).to_i
(-9999.99 * 100).to_i
$ ruby -v
ruby 1.8.5 (2006-12-04 patchlevel 2) [i686-linux]