Changeset 2577


Ignore:
Timestamp:
Apr 6, 2009 4:41:54 PM (10 years ago)
Author:
nanang
Message:

Ticket #772 (misc fix): Updated floating point version of math statistic to return the rounded mean value.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/include/pj/math.h

    r2394 r2577  
    141141    delta = val - stat->fmean_; 
    142142    stat->fmean_ += delta/stat->n; 
    143     stat->mean = (int) stat->fmean_; 
     143     
     144    /* Return mean value with 'rounding' */ 
     145    stat->mean = (int) (stat->fmean_ + 0.5); 
    144146 
    145147    stat->m2_ += (int)(delta * (val-stat->fmean_)); 
Note: See TracChangeset for help on using the changeset viewer.