Heikki Linnakangas <hlinn...@iki.fi> writes: > Unfortunately, sqrt(x) isn't very cheap.
You'd be surprised: sqrt is built-in on most modern hardware. On my three-year-old workstation, sqrt(x) seems to take about 2.6ns. For comparison, the pack_float version posted in <cajeawvgdb92e-xkfmln3cxm2bwbba3rrffzdzg8ki1h5iqe...@mail.gmail.com> takes 3.9ns (and draws multiple compiler warnings, too). regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers