tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

floating point problems on amd64?

I ran 'make check' on guile on NetBSD-current on amd64, and got a

guile> (version)
guile> (eqv? 0.0 (exp -inf.0))
guile> (exp -inf.0)

On i386 and sparc64 this passes.  I ran paranoia and that passed (with
not even flaws).

POSIX says that exp(-Inf) is +0:

This program produces "e -inf z 0.000000" on NetBSD on i386 (older, with
no EM64T), i386 core duo, an i386PAE domU on amd64 (on same dom0 as the
problem), sparc and sparc64.  Also on Mac OS X 10.5.3 with Core 2 Duo.

But, on NetBSD-current amd64, I get:  "e -inf z nan".

#include <math.h>
#include <stdio.h>

  double e;
  double z;
  e = -INFINITY;
  z = exp(e);

  printf("e %f z %f\n", e, z);


Home | Main Index | Thread Index | Old Index