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. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers