jak-project/common/util/math_util.h

9 lines
170 B
C
Raw Normal View History

#pragma once
2020-08-26 01:21:33 -04:00
template <typename T>
2020-08-24 00:06:07 -04:00
T align(T current, T alignment, T offset = 0) {
2020-08-26 01:21:33 -04:00
while ((current % alignment) != 0) {
2020-08-24 00:06:07 -04:00
current++;
}
return current + offset;
}