lemon/math.h
changeset 1222 c40a9d94442d
parent 956 141f9c0db4a3
child 1270 dceba191c00d
equal deleted inserted replaced
5:453968b5fa48 7: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