Thursday, January 22, 2009

Its just one of those days.

irb(main):017:0> 100 == 100 * 1.0000000000000001
=> true
irb(main):018:0> 100 == 100 * 1.000000000000001
=> false

2 comments:

Nick Black said...

dude! you can't use freakin' == with floating-point!! go read this right now:

http://docs.sun.com/source/806-3568/ncg_goldberg.html

Michael Economy said...

How FP Arithmetic is supposed to work != how FP arihmetic works in ruby