unstandard ~master (2017-05-26T08:42:45Z)
Dub
Repo
alignUp
unstd
math
Aligns
n
up or down.
Preconditions:
alignment
must be power of 2.
size_t
alignUp
(size_t alignment, size_t n)
size_t
alignUp
(size_t n)
@
safe
pure nothrow @
nogc
size_t
alignUp
(
size_t
alignment
)
(
in
size_t
n
)
if
(
isPowerOf2
(
alignment
)
)
size_t
alignDown
(size_t alignment, size_t n)
size_t
alignDown
(size_t n)
Meta
Source
See Implementation
unstd
math
functions
alignDown
alignUp
isAligned
isPowerOf2
log2RoundedDown
log2RoundedUp
roundDownToPowerOf2
roundUpToPowerOf2
Aligns n up or down.
Preconditions: alignment must be power of 2.