On Sun, Aug 23, 2009 at 4:54 AM, Paul Matthews<p...@netspace.net.au> wrote: > > The hypot() function has been part of the C standard since C99 (ie 10 > years ago)
Postgres targets C89. The date of the standard is when the standard came out, it takes years before it's widely available and then years again before the systems with the old compiler are no longer interesting. If there's a performance advantage then we could add a configure test and define the macro to call hypot(). You said it existed before C99 though, how widespread was it? If it's in all the platforms we support it might be reasonable to just go with it. > The function is designed not to fail where the current naive macro would > result in overflow. The code seems to be blissfully unaware of overflow dangers :( Even if hypot() avoids spurious overflows it's always possible for there to be a legitimate overflow which we ought to detect and handle properly. -- greg http://mit.edu/~gsstark/resume.pdf -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers