changeset 1055 | 05b34170866b |
parent 877 | 141f9c0db4a3 |
child 1092 | dceba191c00d |
1.1 --- a/lemon/math.h Mon Mar 18 17:41:19 2013 +0100 1.2 +++ b/lemon/math.h Mon Mar 18 18:48:58 2013 +0100 1.3 @@ -65,8 +65,13 @@ 1.4 return v!=v; 1.5 } 1.6 1.7 + ///Round a value to its closest integer 1.8 + inline double round(double r) { 1.9 + return (r > 0.0) ? floor(r + 0.5) : ceil(r - 0.5); 1.10 + } 1.11 + 1.12 /// @} 1.13 1.14 } //namespace lemon 1.15 1.16 -#endif //LEMON_TOLERANCE_H 1.17 +#endif //LEMON_MATH_H