[squeak-dev] Re: [ANN] Number comparison, hash, NaN, Point,
and other partially ordered sets
Tim Olson
tim_olson at att.net
Fri Jan 9 04:31:07 UTC 2009
On Jan 8, 2009, at 9:30 AM, Hans-Martin Mosner wrote:
> AFAIK, the Croquet project needs to have exactly reproducible float
> arithmetics on all platforms. Would these rounding effects on the x86
> affect that goal (perhaps with denormal intermediate results)?
Yes.
> Maybe it would be nice to write a unit test which would uncover
> different rounding behaviors between purely-double-precision FP
> hardware
> and extended-precision hardware.
I'd have to play around a bit to get this into a Squeak unit test, but
here's a test vector which shows the effect:
3ff3208a25e04e87 * 000316dd1d02d1ae
x86 result: 0003b16ef930a76e
powerPC result: 0003b16ef930a76f
These are IEEE double-precision floating-point numbers, specified in
hex (big-endian) so that they are bit exact (no conversion error from a
decimal representation). The first number is between 1.0 and 2.0,
while the second number is a denormal value. The product shows an lsb
difference between an x86 platform (extended-precision FPU) and a PPC
platform (double-precision FPU), even when the x86 floating-point
control word is set to use double-precision rounding for all results.
-- Tim Olson
More information about the Squeak-dev
mailing list
|