diff --git a/kernel/inc/utils/math.h b/kernel/inc/utils/math.h index ababdf2..42523da 100644 --- a/kernel/inc/utils/math.h +++ b/kernel/inc/utils/math.h @@ -20,7 +20,7 @@ #define MAX(a, b) (a > b ? a : b) #define MIN(a, b) (a > b ? b : a) -#define CEIL_TO(a, b) (a + b - (a % b)) +#define CEIL_TO(a, b) (a % b ? a + b - (a % b) : a) #define FLOOR_TO(a, b) (a - (a % b)) uint64_t pow(uint64_t base, uint64_t exp);