Alignment helpers
-
ALIGN_UP
ALIGN_UP (x, a)
Align value up
Parameters
xvalue to be aligned
aalignment
Description
Alignment must be a power of two.
Return
Aligned value
-
ALIGN_DOWN
ALIGN_DOWN (x, a)
Align value down
Parameters
xvalue to be aligned
aalignment
Description
Alignment must be a power of two.
Return
Aligned value
-
ALIGNED
ALIGNED (x, a)
Check if value is aligned
Parameters
xvalue to be checked
aalignment
Description
Alignment must be a power of two.
Return
Boolean
-
ROUND_DOWN
ROUND_DOWN (x, m)
Round down to mutiple
Parameters
xvalue to be rounded
mmultiple
Description
Round value down to multiple. Safe when m is not a power of 2.
Return
Rounded value
-
ROUND_UP
ROUND_UP (x, m)
Round up to mutiple
Parameters
xvalue to be rounded
mmultiple
Description
Round value up to multiple. Safe when m is not a power of 2.
Return
Rounded value
-
ROUND
ROUND (x, m)
Round to mutiple
Parameters
xvalue to be rounded
mmultiple
Description
Round value to multiple (half to even). Safe when m is not a power of 2.
Return
Rounded value