lemon/math.h
changeset 1075 218171dc022d
parent 877 141f9c0db4a3
child 1092 dceba191c00d
equal deleted inserted replaced
5:453968b5fa48 6:b32e9be948a3
    63   inline bool isNaN(double v)
    63   inline bool isNaN(double v)
    64     {
    64     {
    65       return v!=v;
    65       return v!=v;
    66     }
    66     }
    67 
    67 
       
    68   ///Round a value to its closest integer
       
    69   inline double round(double r) {
       
    70     return (r > 0.0) ? floor(r + 0.5) : ceil(r - 0.5);
       
    71   }
       
    72 
    68   /// @}
    73   /// @}
    69 
    74 
    70 } //namespace lemon
    75 } //namespace lemon
    71 
    76 
    72 #endif //LEMON_TOLERANCE_H
    77 #endif //LEMON_MATH_H