summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/mathutils.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils/mathutils.h b/src/utils/mathutils.h
index 9f6818146..8ccd71e79 100644
--- a/src/utils/mathutils.h
+++ b/src/utils/mathutils.h
@@ -112,4 +112,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