Re: unsafe floats

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: unsafe floats
Date: 2004-03-10 22:47:43
Message-ID: 13606.1078958863@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Conway <neilc(at)samurai(dot)com> writes:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-03-10 22:56:07 fsync with sync, and Win32 unlink
Previous Message Bruce Momjian 2004-03-10 22:39:07 Re: selective statement logging