Improving Wetware

Because technology is never the issue

Sometimes I forget that I like Ruby

Posted by Pete McBreen Mon, 12 Mar 2007 19:25:37 GMT

Had a fun experience today

irb(main):001:0> 7.7
=> 7.7
irb(main):002:0> 7.8
=> 7.8
irb(main):003:0> 7.7-7.8
=> -0.0999999999999996

Yes I know it is a Float, but everything else just works so I was lulled into a false sense of security, after all the other two bits worked OK

irb(main):006:0> 7.7 + 0.1
=> 7.8
irb(main):007:0> 7.8 - 0.1
=> 7.7

But that 7.8 - 7.7 just did not want to play nice.