From: Hank Gong Date: 2007-08-11T10:25:01+09:00 Subject: Re: Quick Float question This is because the 3.33333333333333 is not the exact value you got from 10.0/3.0. Ruby store more information you can't not see. So if you want to compare the float, you can write it as (10.0/3.0 - 3.3333333333).abs <= 0.0001 On Aug 11, 10:10 am, Cliff Rowley wrote: > I'm doing some math with Ruby and I'd really like to know why: > > irb(main):002:0> 10.0 / 3.0 > => 3.33333333333333 > > but > > irb(main):003:0> (10.0 / 3.0) == 3.33333333333333 > > is > > => false > > Thanks :-) > > Cliff