From: Alexandru Toma Date: 2006-03-10T01:57:44+09:00 Subject: ruby float calculations Could someone please explain to me why the following happens: irb(main):001:0> 0.29 - 0.38 + 0.1 => 0.00999999999999998 irb(main):002:0> 0.29 + (-0.38 + 0.1) => 0.00999999999999995 irb(main):003:0> 0.29 + 0.1 - 0.38 => 0.01 How can I prevent something like this from happening, or at the very least how can I work around such errors? Many thanks in advance. -- Posted via http://www.ruby-forum.com/.