Re: Slaying the HYPOTamus - Mailing list pgsql-hackers

From Paul Matthews
Subject Re: Slaying the HYPOTamus
Date
Msg-id 4A93164E.7010706@netspace.net.au
Whole thread Raw
In response to Re: Slaying the HYPOTamus  (Greg Stark <gsstark@mit.edu>)
Responses Re: Slaying the HYPOTamus  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Greg Stark wrote:
> Also, the question arises what should be returned for hypot(Inf,NaN)
> which your code returns Inf for. Empirically, it seems the normal
> floating point behaviour is to return NaN so I think the NaN test
> should be first.
>
>   
See http://www.opengroup.org/onlinepubs/000095399/functions/hypot.html
   If /x/ or /y/ is ±Inf, +Inf shall be returned (even if one of /x/ or
/y/ is NaN).   If /x/ or /y/ is NaN, and the other is not ±Inf, a NaN shall be
returned.

Just trying to implement correct C99 behaviour here.


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: alpha1 bundled -- please verify
Next
From: Tom Lane
Date:
Subject: Re: Bug in date arithmetic