From: Stefan Rusterholz Date: 2007-08-20T04:15:48+09:00 Subject: Re: Float addition problem / Processor bug? Christian Luginbuehl wrote: > However I don't like this Float behaviour of Ruby. Especially that the > String representation of such values looks correct, while testing for > equality says 'false' - like this: That's no "ruby" problem. You have to understand what floats are (and they are that way *everywhere*, not just ruby): approximations. Think of it this way: try to represent 1/3 (0.333...) in a decimal *precisely*. It doesn't work. Or try to represent pi in decimal *precisely*. Doesn't work either. The same way a float can never represent some numbers precisely. Also see http://wiki.rubygarden.org/Ruby/page/show/RubyLangFAQ Maybe do some research of your own on floats, e.g. read a bit about them on wikipedia. Regards Stefan -- Posted via http://www.ruby-forum.com/.