Prevent corr() from returning the wrong results for negative correlation
authorNeil Conway <[email protected]>
Wed, 19 Sep 2007 22:31:51 +0000 (22:31 +0000)
committerNeil Conway <[email protected]>
Wed, 19 Sep 2007 22:31:51 +0000 (22:31 +0000)
commit5b380b8d7804efb3853a8f261233bf29779180c7
tree23df391a74769159d753dedd0a582c0dd548b681
parent3209fbdffbf08c5c0f2615327ef429e9f2ab89c8
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