[Kst] extragear/graphics/kst/kst

George Staikos staikos at kde.org
Wed Feb 8 05:46:11 CET 2006


SVN commit 506998 by staikos:

fix RMS computation
BUG: 121566


 M  +2 -2      kstvector.cpp  


--- trunk/extragear/graphics/kst/kst/kstvector.cpp #506997:506998
@@ -195,9 +195,9 @@
 
     if (_nsum >= 2) {
       double sum = _scalars["sum"]->value();
-      double sumsq;
+      double sumsq = _scalars["sumsquared"]->value();
       _scalars["mean"]->setValue(_mean = sum/double(_nsum));
-      _scalars["sigma"]->setValue(sumsq = sqrt((_scalars["sumsquared"]->value() - sum * sum / double(_nsum)) / double(_nsum-1)));
+      _scalars["sigma"]->setValue(sqrt((sumsq - sum * sum / double(_nsum)) / double(_nsum-1)));
       _scalars["rms"]->setValue(sqrt(sumsq/double(_nsum)));
     } else {
       _scalars["sigma"]->setValue(_max - _min);


More information about the Kst mailing list