From: "Michael W. Ryder" <_mwryder@...> Date: 2007-06-22T09:45:06+09:00 Subject: Re: Ruby doesn't know how to multiply Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Ruby doesn't know how to multiply" > on Fri, 22 Jun 2007 05:57:48 +0900, Lloyd Linklater writes: > > |I tried this in Delphi, smalltalk and oracle SQL and got the correct > |result. > > Interesting. There are a few ways to get the "correct" result. > > * fixed point number > * base 10 floating numbers > * comparison with epsilon > > Does anyone know how these languages get the correct result? > > matz. > A simple way to get the correct figure is to do what is used often with currency to prevent these types of errors. If I enter 'puts 1495.0*6.0/1000.0' I get 8.97. The only thing necessary is to keep track of the number of decimal points.