Re: IEEE 754 conformance on various architectures
On Sat, Sep 15, 2007 at 05:59:06PM -0400, Kamaraju S Kusumanchi wrote:
> I am trying to understand why guile 1.8.2 FTBFS on alpha architecture.
> The corresponding build log is at
> http://buildd.debian.org/fetch.cgi?&pkg=guile-1.8&ver=1.8.2%2B1-2&arch=alpha&stamp=1188100514&file=log
> I looked at the source guile-1.8-1.8.2+1/test-suite/standalone/test-round.c
> and the lines where the build fails is
> /* 2^DBL_MANT_DIG-1
> In the past scm_c_round had incorrectly incremented this value, due
> to the way that x+0.5 would round upwards (in the usual default
> nearest-even mode on most systems). */
> x = ldexp (1.0, DBL_MANT_DIG) - 1.0;
> assert (x == floor (x)); /* should be an integer already */
> assert (scm_c_round (x) == x); /* scm_c_round should return it
> unchanged */
> I do not have access to an alpha machine, so the only way I can debug the
> problem is by looking at the source code. I gather that the above test
> should not fail provided IEEE 745 standard is followed for performing
> floating point arithmetic. What is the status of this on various
> architectures (especially on alpha)?
Here's the problem:
value: 9007199254740991.000000, floor: 9007199254740990.000000
This is evidently a bug in glibc, calculating the floor() value wrong on
alpha.
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
vorlon@debian.org http://www.debian.org/
Reply to: