Changeset 17167 for trunk/FACT++/src


Ignore:
Timestamp:
09/16/13 18:39:16 (11 years ago)
Author:
tbretz
Message:
Added sanity check for rms calculation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/ratecontrol.cc

    r17026 r17167  
    482482        avg /= fCurrentsMed.size();
    483483        rms /= fCurrentsMed.size();
    484         rms = sqrt(rms-avg*avg);
     484        rms -= avg*avg;
     485        rms = rms<0 ? 0 : sqrt(rms);
    485486
    486487        double avg_dev = 0;
Note: See TracChangeset for help on using the changeset viewer.