From: Roger Pack Date: 2009-02-22T07:08:18+09:00 Subject: Re: floating point rounding error? > 1. existing code might be broken True > 2. efficiency (Float is faster than BigDecimal) Can't disagree with that. > 3. standards (AFAIK the Float implementation is backed by an ISO > standard while I am not sure whether this is the case for BigDecimal). True. > 4. limited use: while your particular example will work as you expect, > BigDecimal is still not a real number (in math terms) but still a > rational number => rounding errors for other numbers will be introduced > when switching from Float to BigDecimal by default. The only real benefit of it is that it won't bite "as often," for better or worse. This is a learning curve that could hit you at the edges [adding extremely small and extremely large numbers, for example] and not during normal day use :) One "almost good" answer would be to have ruby output float to strings by default with enough precision to be able to recreate the original. Thoughts? -=r -- Posted via http://www.ruby-forum.com/.