From: Jim Freeze Date: 2003-04-18T10:26:52+09:00 Subject: Re: Roundoff problem with Float and Marshal On Friday, 18 April 2003 at 8:28:05 +0900, Rudi Cilibrasi wrote: > nobu.nokada@softhome.net wrote in message news:<200304171653.h3HGrgHQ002407@sharui.nakada.kanuma.tochigi.jp>... > > Since it was wrong a little, I fixed and committed it. > > Hmmm interesting numerical developments. I continue to test it by > doing > a cvs update (with and without the DBL_DIG patch) and do see perhaps > some further problems: > > 100000.times { > w = rand(111111111) > x = rand(222222223) > y = rand(33333333334) > z = rand(311414313) > a = (x.to_f + y.to_f / z.to_f) * > Math.exp(w.to_f / (x.to_f + y.to_f / z.to_f)) > ma = Marshal.dump(a) > b = Marshal.load(ma) > if a == b > puts "Everything is working fine for #{a}" > else > puts "PROBLEM: a is #{a}, b is #{b}, and ma is #{ma.dump}" > puts "w is #{w}, x is #{x}, y is #{y}, z is #{z}" > end > } > > produces many PROBLEM: lines on my system. I hope your tests are being added to some set of unit tests for ruby. -- Jim Freeze ---------- It is the business of little minds to shrink. -- Carl Sandburg