From: Marnen Laibow-Koser Date: 2009-11-23T01:13:47+09:00 Subject: Re: really crazy about this (do/while) David Masover wrote: [...] > So my compromise is, when I want to work with some fraction of a number, > and I > want it to be as precise as possible (with no regard for performance), I > make > it a Rational as long as I can get away with. I can always call to_f on > the > end result. > > I might be Doing It Wrong, though. Maybe BigDecimal is the way to go? I think it is. Rational makes sense if you're starting from an integer division. But the OP is starting from a float (98.3), so BigDecimal is probably the way to go. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen@marnen.org -- Posted via http://www.ruby-forum.com/.