From: Raphael Clancy Date: 2009-02-23T08:28:22+09:00 Subject: Re: floating point rounding error? Robert Klemme wrote: > I would not go as far. IMHO the take home should be awareness of the > fact that mathematical numbers do not blend well with any computerized > representation and that you always have to be careful when dealing with > them. Floats are perfectly ok for a large number of applications so > generally avoiding them seems a too harsh rule. Btw, if that were true > then we could throw them out of the language without loss but I am > pretty sure if you suggest that there would be vigorous objection. :-) > > Kind regards > > robert I totally agree with you, I guess what I was trying to say is that due to rounding error floats aren't appropriate for low precision computations or areas where you are likely to have to convert to int. It's better to use BigDecimal or to handle the decimal portion in some other way. R. -- Posted via http://www.ruby-forum.com/.