Go to the source code of this file.
|
#define | ROUND_UP(X, STEP) (((X) + (STEP) - 1) / (STEP) * (STEP)) |
| Yields X rounded up to the nearest multiple of STEP. More...
|
|
#define | DIV_ROUND_UP(X, STEP) (((X) + (STEP) - 1) / (STEP)) |
| Yields X divided by STEP, rounded up. More...
|
|
#define | ROUND_DOWN(X, STEP) ((X) / (STEP) * (STEP)) |
| Yields X rounded down to the nearest multiple of STEP. More...
|
|
◆ DIV_ROUND_UP
#define DIV_ROUND_UP |
( |
|
X, |
|
|
|
STEP |
|
) |
| (((X) + (STEP) - 1) / (STEP)) |
Yields X divided by STEP, rounded up.
For X >= 0, STEP >= 1 only.
Definition at line 10 of file round.h.
◆ ROUND_DOWN
#define ROUND_DOWN |
( |
|
X, |
|
|
|
STEP |
|
) |
| ((X) / (STEP) * (STEP)) |
Yields X rounded down to the nearest multiple of STEP.
For X >= 0, STEP >= 1 only.
Definition at line 14 of file round.h.
◆ ROUND_UP
#define ROUND_UP |
( |
|
X, |
|
|
|
STEP |
|
) |
| (((X) + (STEP) - 1) / (STEP) * (STEP)) |
Yields X rounded up to the nearest multiple of STEP.
For X >= 0, STEP >= 1 only.
Definition at line 6 of file round.h.