From: Ryan Davis Date: 2005-05-31T18:17:19+09:00 Subject: Re: Weird problem. On May 31, 2005, at 2:10 AM, Erik Terpstra wrote: > Why is the last expression false? > ... > p part.height == 58.2 #-> false !!?? Same reason in pretty much every other language. Floating point arithmetic is imprecise. p part.height - 58.2 #-> -1.4210854715202e-14 If you look in test/unit/assertions.rb you'll find assert_in_delta (f1, f2, d) for exactly this reason. -- ryand-ruby@zenspider.com - Seattle.rb - http://www.zenspider.com/ seattle.rb http://blog.zenspider.com/ - http://rubyforge.org/projects/ruby2c