diff --git a/src/utilities.c b/src/utilities.c index f1b7fb7..1e22422 100644 --- a/src/utilities.c +++ b/src/utilities.c @@ -15,7 +15,11 @@ * @return the smallest short c such that c >= a / b */ short ceil_div_short(short a, short b) { - return (a + (b - 1)) / b; + if (a % b) { + return (a / b) + 1; + } else { + return a / b; + } } /**