pgsql: Remove the special cases to prevent minus-zero results in float4

Started by Tom Lanealmost 18 years ago3 messageshackerscommitters
Jump to latest
#1Tom Lane
tgl@postgresql.org
hackerscommitters

Log Message:
-----------
Remove the special cases to prevent minus-zero results in float4 and float8
unary minus operators. We weren't attempting to prevent minus zero anywhere
else; in view of our gradual trend to make the float datatypes more IEEE
standard compliant, we should allow minus zero here rather than disallow it
elsewhere.

We don't, however, expect that all platforms will produce minus zero, so
we need to adjust the one affected regression test to allow both results.

Per discussion of bug #4660.

(In passing, clean up a couple other minor infelicities in float.c.)

Modified Files:
--------------
pgsql/src/backend/utils/adt:
float.c (r1.159 -> r1.160)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/float.c?r1=1.159&r2=1.160)
pgsql/src/test/regress/expected:
numerology.out (r1.5 -> r1.6)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/numerology.out?r1=1.5&r2=1.6)

Added Files:
-----------
pgsql/src/test/regress/expected:
numerology_1.out (r1.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/numerology_1.out?rev=1.1&content-type=text/x-cvsweb-markup)

#2Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Tom Lane (#1)
hackerscommitters
Re: [COMMITTERS] pgsql: Remove the special cases to prevent minus-zero results in float4

Tom Lane wrote:

We don't, however, expect that all platforms will produce minus zero, so
we need to adjust the one affected regression test to allow both results.

Do we know if and what platforms wouldn't produce minus zero? It would
be interesting to not have the alternative expected output for a few
days and see which buildfarm animals break.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Heikki Linnakangas (#2)
hackerscommitters
Re: Re: [COMMITTERS] pgsql: Remove the special cases to prevent minus-zero results in float4

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:

Tom Lane wrote:

We don't, however, expect that all platforms will produce minus zero, so
we need to adjust the one affected regression test to allow both results.

Do we know if and what platforms wouldn't produce minus zero? It would
be interesting to not have the alternative expected output for a few
days and see which buildfarm animals break.

Well, my old HPUX box definitely doesn't print minus zeroes here.

What I'm really more interested in is whether there are any third
or fourth opinions among the buildfarm members ...

regards, tom lane