T-TEST: Avoid NaN in paired-sample correlation significance calcuation.
authorBen Pfaff <blp@gnu.org>
Fri, 4 Sep 2009 03:09:36 +0000 (20:09 -0700)
committerBen Pfaff <blp@gnu.org>
Fri, 4 Sep 2009 03:09:36 +0000 (20:09 -0700)
Sometimes the correlation comes out just above 1.0 due to inaccuracy of
machine calculation, which causes sqrt(1-corr**2) to yield NaN.  This
commit forces the correlation into the valid range, fixing the problem.

Thanks to Matej Cepl <mcepl@redhat.com> for reporting the problem.
Thanks to John Darrington for suggesting the fix.


No differences found