summaryrefslogtreecommitdiff
path: root/BitKeeper
diff options
context:
space:
mode:
authorcmiller@zippy.cornsilk.net <>2006-12-22 15:37:37 -0500
committercmiller@zippy.cornsilk.net <>2006-12-22 15:37:37 -0500
commit50726b2322edac8e93489fcb5ef75a5634222d44 (patch)
tree1192dea3a5bbb9777291296b2e70e43c87d40abd /BitKeeper
parent7aa1e7190d133dd9bbd9ed7e8ef2923497de1167 (diff)
downloadmariadb-git-50726b2322edac8e93489fcb5ef75a5634222d44.tar.gz
Bug#22555: STDDEV yields positive result for groups with only one row
When only one row was present, the subtraction of nearly the same number resulted in catastropic cancellation, introducing an error in the VARIANCE calculation near 1e-15. That was sqrt()ed to get STDDEV, the error was escallated to near 1e-8. The simple fix of testing for a row count of 1 and forcing that to yield 0.0 is insufficient, as two rows of the same value should also have a variance of 0.0, yet the error would be about the same. So, this patch changes the formula that computes the VARIANCE to be one that is not subject to catastrophic cancellation. In addition, it now uses only (faster-than-decimal) floating point numbers to calculate, and renders that to other types on demand.
Diffstat (limited to 'BitKeeper')
-rw-r--r--BitKeeper/etc/collapsed1
1 files changed, 1 insertions, 0 deletions
diff --git a/BitKeeper/etc/collapsed b/BitKeeper/etc/collapsed
index ddaafba882c..837a8997495 100644
--- a/BitKeeper/etc/collapsed
+++ b/BitKeeper/etc/collapsed
@@ -19,3 +19,4 @@
454f8960jsVT_kMKJtZ9OCgXoba0xQ
4554a95d7txO1DuO9G3nAizI3SkFAA
4554b3722d71SbPiI2Gx-RhbZjmuIQ
+45771031yRCoM_ZfONdYchPvVEgLRg