Ignore:
Timestamp:
Oct 5, 2007, 11:27:34 PM (14 years ago)
Author:
Peter
Message:

fixing bug when range is one value only

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/utility.h

    r933 r934  
    167167      if (p>=100)
    168168        return *(--last);
     169      // range is one value only is a special case
     170      if (std::distance(first, last)==1)
     171        return *first;
    169172      double j = p/100 * (std::distance(first,last)-1);
    170173      int i = static_cast<int>(j);
Note: See TracChangeset for help on using the changeset viewer.