Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Regression tests on intel for 6.5.2

From: Christof Petig <christof(dot)petig(at)wtal(dot)de>
To: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Regression tests on intel for 6.5.2
Date: 1999-09-29 15:05:34
Message-ID: 37F22ABD.50997341@wtal.de (view raw or flat)
Thread:
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



In response to

Responses

pgsql-hackers by date

Next:From: Thomas LockhartDate: 1999-09-29 15:07:53
Subject: Re: New notices?
Previous:From: Tom LaneDate: 1999-09-29 15:04:52
Subject: Re: [HACKERS] Planner drops unreferenced tables --- bug, no?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group