[Kst] [Bug 121566] rms scalar is wrong

George Staikos staikos at kde.org
Wed Feb 8 05:50:29 CET 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=121566         
staikos kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From staikos kde org  2006-02-08 05:50 -------
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