From: Nuralanur@... Date: 2005-06-09T20:29:29+09:00 Subject: Re: Newb math question -------------------------------1118316561 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Dear Brian, you can avoid floating point problems altogether if you use fractions in your calculations. To do this, you can use the programme "rational.rb" which is part of ruby1.8.2 like this: require "rational.rb" my_result=9-Rational(89,10) gives my_result=Rational(1,10) (i.e. 1/10). There is documentation on the methods available on _http://www.ruby-doc.org/stdlib/libdoc/rational/rdoc/files/rational_rb.html_ (http://www.ruby-doc.org/stdlib/libdoc/rational/rdoc/files/rational_rb.html) Best regards, Axel -------------------------------1118316561--