diff --git a/libs/geom/include/psemek/geom/math.hpp b/libs/geom/include/psemek/geom/math.hpp index 71b559b1..56aab707 100644 --- a/libs/geom/include/psemek/geom/math.hpp +++ b/libs/geom/include/psemek/geom/math.hpp @@ -165,4 +165,10 @@ namespace psemek::geom return x - m * idiv(x, m); } + template + T div_ceil(T x, T y) + { + return (x / y) + ((x % y) == 0 ? 0 : 1); + } + }