From: Park Heesob Date: 2003-04-18T15:00:58+09:00 Subject: Re: Roundoff problem with Float and Marshal Hi, ----- Original Message ----- From: To: "ruby-talk ML" Sent: Friday, April 18, 2003 2:32 PM Subject: Re: Roundoff problem with Float and Marshal > Hi, > > At Fri, 18 Apr 2003 12:20:01 +0900, > Yukihiro Matsumoto wrote: > > It's the limitation of base 10 representation of float values that > > Marshal uses. We need to use binary representation like XDR to solve > > this. I'm not sure if it is worth for the cost of its implementation > > and portability. Float tend to be inexact, after all. > > I'd tried C99 style hexadecimal float. I expect this is > portable (except for depending on frexp() and ldexp()), but > could not be loaded by current version. > > But still, strtod() problem remains. > > How about pack unpack method? Not Portable? For Float f, f == [f].pack("G").unpack("G")[0] is always true. Park Heesob