Ah, that makes sense. I kind of suspected it may be something like
this. However, it seems awfully strange that this is a good default
behaviour (from IRB, or Ruby in general)?

For example, if I do the same in python:

>>> (-140.14*100)
-14013.999999999998

vs Ruby:

irb(main):005:0> (-140.14*100)
=> -14014.0

I think that Python is much better in this situation - -14014.0 is
obviously not the correct value of the floating point number.

Even PHP (!) has more "reliable" behaviour in this case (Possibly -
looks as if the return type is getting formatted as an int, don't
quote me on PHP being reliable... ^_^):

<? echo (-140.14*100.0) ?>
-14014

To be honest, I am not sure what is desirable behaviour. But.. I can
say that Python behaviour in this case is much  clearer... to say "=>
-14014.0" is not clear at all, at the very least. The number with xyz.
0 indicates in mathematics that a number is accurate to one d.p., no?
If the number is actually xyz.abc - then we should be aware of that,
especially from something such as IRB where people debug algorithms,
or puts, often also used for algorithms...

This also causes special case behaviour... when you use .to_s we get a
different value completely - i.e. if we write k to a file, then read
it again, to_i will behave differently.. is this a good semantic to
have in place?

Regards,
Samuel