From: Robert Klemme Date: 2008-09-16T19:48:24+09:00 Subject: Re: float precision 2008/9/13 thomas peklak : > You are right, multiplying with 0.01 is even fast, see the benchmarks: > > require 'benchmark' > user system total real > SPf : 5.590000 0.050000 5.640000 ( 5.720373) > *100 : 3.760000 0.040000 3.800000 ( 3.829771) > *.01 : 1.770000 0.010000 1.780000 ( 1.811917) It's even more efficient to calculate with the full precision and round only on output. :-) Cheers robert -- use.inject do |as, often| as.you_can - without end