diff options
Diffstat (limited to 'src/utils/mathutils.h')
-rw-r--r-- | src/utils/mathutils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/utils/mathutils.h b/src/utils/mathutils.h index 9f6818146..6d5a8339d 100644 --- a/src/utils/mathutils.h +++ b/src/utils/mathutils.h @@ -23,7 +23,9 @@ #ifndef UTILS_MATHUTILS_H #define UTILS_MATHUTILS_H +#include <string> #include <stdint.h> +#include <cstring> static uint16_t crc_table[256] = { @@ -112,4 +114,9 @@ inline float weightedAverage(float n1, float n2, float w) return w * n2 + (1.0f - w) * n1; } +inline int roundDouble(double v) +{ + return (v > 0.0) ? (v + 0.5) : (v - 0.5); +} + #endif // UTILS_MATHUTILS_H |