Re: [HACKERS] Regression tests on intel for 6.5.2

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Christof Petig <christof(dot)petig(at)wtal(dot)de>
Cc: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>, 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-30 06:17:00
Message-ID: 37F3005C.3B0514C8@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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(at)alumni(dot)caltech(dot)edu
South Pasadena, California

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zakkr 1999-09-30 08:19:00 Re: [HACKERS] string function
Previous Message Thomas Lockhart 1999-09-30 06:08:18 Re: [HACKERS] string function