4 /* Yields X rounded up to the nearest multiple of STEP.
5 For X >= 0, STEP >= 1 only. */
6 #define ROUND_UP(X, STEP) (((X) + (STEP) - 1) / (STEP) * (STEP))
8 /* Yields X divided by STEP, rounded up.
9 For X >= 0, STEP >= 1 only. */
10 #define DIV_ROUND_UP(X, STEP) (((X) + (STEP) - 1) / (STEP))
12 /* Yields X rounded down to the nearest multiple of STEP.
13 For X >= 0, STEP >= 1 only. */
14 #define ROUND_DOWN(X, STEP) ((X) / (STEP) * (STEP))
16 /* There is no DIV_ROUND_DOWN. It would be simply X / STEP. */
18 #endif /* lib/round.h */