Thread: pgsql/src/backend/utils/adt float.c

pgsql/src/backend/utils/adt float.c

From
Tom Lane
Date:
CVSROOT:    /home/projects/pgsql/cvsroot
Module name:    pgsql
Changes by:    tgl@hub.org    01/06/02 16:18:30

Modified files:
    src/backend/utils/adt: float.c

Log message:
    Accept and output '-Infinity' as well as 'Infinity', per long-ago
    suggestion from Ross Reedstrom.  Still needs work to make those symbols
    convert to actual IEEE infinities (on machines where such things exist).


Re: pgsql/src/backend/utils/adt float.c

From
Peter Eisentraut
Date:
Tom Lane writes:

>     Accept and output '-Infinity' as well as 'Infinity', per long-ago
>     suggestion from Ross Reedstrom.  Still needs work to make those symbols
>     convert to actual IEEE infinities (on machines where such things exist).

#ifdef INFINITY
    val = INFINITY;
#else
    elog?
#endif

Those who don't have INFINITY can define it in their port.h, like NAN.
1.0/0.0 should suffice.

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Re: pgsql/src/backend/utils/adt float.c

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> Tom Lane writes:
>> Accept and output '-Infinity' as well as 'Infinity', per long-ago
>> suggestion from Ross Reedstrom.  Still needs work to make those symbols
>> convert to actual IEEE infinities (on machines where such things exist).

> #ifdef INFINITY
>     val = INFINITY;
> #else
>     elog?
> #endif

Else use HUGE_VAL, as the code does now, I would think.  But I just
sent a message to Ross Reedstrom and pghackers to reopen that
discussion; let's pick it up there.

            regards, tom lane