Prevent corr() from returning the wrong results for negative correlation
authorNeil Conway <neilc@samurai.com>
Wed, 19 Sep 2007 22:31:51 +0000 (22:31 +0000)
committerNeil Conway <neilc@samurai.com>
Wed, 19 Sep 2007 22:31:51 +0000 (22:31 +0000)
commitcd575976f6f8a43e209991633b9cfe3656fbba7e
tree47420c3a9951700fb680169e4126d3e371fa500e
parenta3d3b40a107348ee90fa5487e5c3855b565cf89f
Prevent corr() from returning the wrong results for negative correlation
values. The previous coding essentially assumed that x = sqrt(x*x), which
does not hold for x < 0.

Thanks to Jie Zhang at Greenplum and Gavin Sherry for reporting this
issue.
src/backend/utils/adt/float.c