PKUOS - Pintos
Pintos source browser for PKU Operating System course
Macros
round.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#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...
 

Macro Definition Documentation

◆ 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.