Re: [HACKERS] Regression tests on intel for 6.5.2
Christof Petig <christof.petig@wtal.de>
From: Christof Petig <christof.petig@wtal.de>
To: Lamar Owen <lamar.owen@wgcr.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@postgreSQL.org
Date: 1999-09-29T15:05:34Z
Lists: pgsql-hackers
Lamar Owen wrote:
> On Mon, 27 Sep 1999, Tom Lane wrote:
> > which is evidently doing the wrong thing on your platform. What does
> > your man page for exp() say about error return conventions?
>
I checked it twice, I can't find any error in the current sources. I even wrote a test program:
#include <math.h>
#include <stdio.h>
#include <errno.h>
int main()
{ double e;
errno=0;
e=pow(100,200);
if (errno) perror("pow");
if (!finite(e)) puts("!finite\n");
else printf("%f\n",e);
}
Output:
pow: Numerical result out of range
!finite
So both methods seem to work. (finite is a function on glibc-2.1 systems)
Perhaps (strange thoughts come in to my mind ...) the compiler optimizes the function call into a
machine instruction ...
/tmp> cc -O2 -o test test.c -lm
/tmp> ./test
!finite
Looks like this is the case. So (I use gcc-2.95) what to do? Complain about a compiler/library bug
(doesn't set errno)? I would propose another autoconf test. (I could easily do it.)
Christof
PS: I found the offending inline routines in /usr/include/bits/mathinline.h