diff -r 1c978b5bcc65 -r 05b34170866b lemon/math.h --- a/lemon/math.h Mon Mar 18 17:41:19 2013 +0100 +++ b/lemon/math.h Mon Mar 18 18:48:58 2013 +0100 @@ -65,8 +65,13 @@ return v!=v; } + ///Round a value to its closest integer + inline double round(double r) { + return (r > 0.0) ? floor(r + 0.5) : ceil(r - 0.5); + } + /// @} } //namespace lemon -#endif //LEMON_TOLERANCE_H +#endif //LEMON_MATH_H