Trouble with exp() on S/Linux?

From: Keith Parks <emkxp01(at)mtcc(dot)demon(dot)co(dot)uk>
To: sparclinux(at)vger(dot)rutgers(dot)edu
Subject: Trouble with exp() on S/Linux?
Date: 1998-01-09 15:53:57
Message-ID: 199801091553.PAA03075@mtcc.demon.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I have built and installed the latest version of the PostgreSQL RDBMS
on S/Linux but am having problems with the regression tests.

Many of the failures come from floating point exceptions.

I've written a small c prog to demonstrate the problem which seems to
show that using exp() on a number less than 1.0e-150 gives an FPE.

Can anyone tell me what's broken, if anything.

I'm really not sure whether it is...

cpu : Fujitsu or Weitek Power-UP
fpu : Fujitsu or Weitek on-chip FPU
kernel : sparclinux-2.0-980106
libc/m : libc.so.5.3.12/libm.so.5.0.6
gcc : gcc version 2.7.2.1

Something else???
Expected behaviour???

The machine is a SPARCstation IPX running Red Hat 4.2.

Thanks for any help,
Keith.

[emkxp01(at)sparclinux ~]$ cat mxdb.c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>

main()
{
double dbval;

dbval = atof("1.0e-150");
printf("dbl1 = %e\n", dbval);
printf("Exp dbl1 = %e\n", exp(dbval));
dbval = atof("1.0e-151");
printf("dbl2 = %e\n", dbval);
printf("Exp dbl2 = %e\n", exp(dbval));
}
[emkxp01(at)sparclinux ~]$ gcc mxdb.c -lm
[emkxp01(at)sparclinux ~]$ ./a.out
dbl1 = 1.000000e-150
Exp dbl1 = 1.000000e+00
dbl2 = 1.000000e-151
Floating exception (core dumped)

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-01-09 15:58:59 Re: [HACKERS] varchar/char size
Previous Message Darren King 1998-01-09 15:43:27 Re: [HACKERS] Disk block size issues.