On Wed, Dec 14, 2011 at 12:36 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> AFAICS it's really impractical to do that. The code Andrew is having
> problems with is essentially
>
> double a,b,c;
> ...
> a = b * c;
> if (isinf(a)) throw error;
>
> and the problem is that the multiplication result overflows in double
> precision, but not in the wider-than-double register precision.
> Therefore, if a is in a register and the isinf() primitive inspects the
> register, it will return false, even though when the value gets stored
> to memory it will become an infinity.
Uh, wow. That really is pretty insane. How is anyone supposed to
write sensible code around that non-API?
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company