Re: unsafe floats - Mailing list pgsql-hackers

From Tom Lane
Subject Re: unsafe floats
Date
Msg-id 13606.1078958863@sss.pgh.pa.us
Whole thread Raw
In response to Re: unsafe floats  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> So I'd vote for ripping out the range check, or at least reversing
>> the default state of UNSAFE_FLOATS.

> This would surely be wrong. Defining UNSAFE_FLOATS will make
> float4in() not check that its input fits into a 'float', rather than a
> 'double'.

Possibly the appropriate test involves using isfinite() (apparently
spelled finite() some places, but the C99 spec says isfinite).  If
that returns false, take the value as good without checking range.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: selective statement logging
Next
From: Bruce Momjian
Date:
Subject: fsync with sync, and Win32 unlink