From: ptkwt@... (Phil Tomson) Date: 2005-02-09T23:00:08+09:00 Subject: Re: math changes from 1.8.1 to 1.8.2?(G4's fault?) In article <20050209114012.F3646D50.ocean@m2.ccsnet.ne.jp>, H.Yamamoto wrote: >Hello. > >ptkwt@aracnet.com (Phil Tomson) wrote: >(2005/02/08 19:00) > >>>fp = FixedPt.new(Math.exp(-5),18,18) >>> >>>Which defines an 18bit register with the binary point at bit 18 and stuffs >>>the result of Math.exp(-5) into it (shifting the result to the left 18 >>>times). >>> >>>fp.to_f #=> 0.00673675537109375 >>>fp.raw #=> 1766 >>>fp.to_i #=> 0 > >>I loaded up 1.8.2 on my powerbook last night and had the same problem >>(which doesn't exist on the Pentium IV). I suspect it's a difference in >>the FPU between the G4 and PIV. I'm doing lots of summations and >>conversions between floating point and fixed point, so I suspect it's the >>fault of the G4's FPU..... unless someone else has any other theories. > >Interesting. Can I see the code of FixedPt? To see the problem, I suspect you'll need more than the FixedPt class. You'll probably also need the entire application. It's a support vector machine implementation (kind of like a neural network). I could send it to you in a tar file if you wish. Phil