lu.numeric

Functions and templates that do numeric calculations or other manipulation, in some way or another.

Members

Functions

getMultipleOf
auto getMultipleOf(Number num, int n, Flag!"alwaysOneUp" oneUp)

Given a number, calculate the largest multiple of n needed to reach that number.

Examples

immutable width = 15.getMultipleOf(4);
assert(width == 16);
immutable width2 = 16.getMultipleOf(4, Yes.alwaysOneUp);
assert(width2 == 20);

Meta