From: David Garamond Date: 2004-01-13T03:00:06+09:00 Subject: Re: faster integer arithmetics & arbitrary precision floating number Ara.T.Howard@noaa.gov wrote: > in fact, the operations are fast enough that you might simply be able to use > normal ruby objects and ignore the Fixnum/Bignum distinction - which is a very > useful (accurate) abstraction: > > ~ > irb -r narray > irb(main):001:0> (na=NArray.object(1000000))[true] = 1073741823+1073741824 > => 2147483647 > > irb(main):002:0> a=Time.now; p(na.sum); b=Time.now; b.to_f - a.to_f > 2147483647000000 > => 0.882834911346436 > > not bad for summing a million numbers with arbitrary precision eh? Nice! I can surely try clustering the numbers into sizable bites of Narray's before summing them up together. Thanks, -- dave