Prevent corr() from returning the wrong results for negative correlation
Neil Conway <neilc@samurai.com>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/float.c | modified | +2 −3 |