aboutsummaryrefslogtreecommitdiff
path: root/lout
diff options
context:
space:
mode:
Diffstat (limited to 'lout')
-rw-r--r--lout/misc.hh5
1 files changed, 5 insertions, 0 deletions
diff --git a/lout/misc.hh b/lout/misc.hh
index 393bac0c..e78e7576 100644
--- a/lout/misc.hh
+++ b/lout/misc.hh
@@ -38,6 +38,11 @@ inline void assertNotReached ()
abort ();
}
+inline int roundInt(double d)
+{
+ return (int) ((d > 0) ? (d + 0.5) : (d - 0.5));
+}
+
/**
* \brief Instances of a sub class of this interface may be compared (less,
* greater).