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, bool alwaysOneUp)

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, alwaysOneUp: true);
assert(width2 == 20);

Meta