Re: [HACKERS] Regression tests on intel for 6.5.2

Thomas Lockhart <lockhart@alumni.caltech.edu>

From: Thomas Lockhart <lockhart@alumni.caltech.edu>
To: Christof Petig <christof.petig@wtal.de>
Cc: Lamar Owen <lamar.owen@wgcr.org>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@postgresql.org
Date: 1999-09-30T06:17:00Z
Lists: pgsql-hackers
> > > 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...
> So both methods seem to work. (finite is a function on glibc-2.1 systems)

And that is the problem. I didn't have enough platforms to test on, so
when I improved the code I did so in a way that I would get a better
result on at least my platform (probably RH4.2 or earlier) without
breaking the behavior on other platforms.

So, I test locally for finite() being defined as a macro! But on newer
glibc systems it is a real function, so you are seeing the old
behavior.

A better thing to do would be to define HAVE_FINITE, and to have a
./configure test for it. That should be easy enough; do you have time
to look at it? Then code like

#ifndef finite
    if (errno == ERANGE)
#else
    /* infinity implies overflow, zero implies underflow */
    if (!finite(*result) || *result == 0.0)
#endif

Could become

...
#if HAVE_FINITE
...

                        - Thomas

-- 
Thomas Lockhart				lockhart@alumni.caltech.edu
South Pasadena, California