ona/src/math.zig

7 lines
221 B
Zig
Raw Normal View History

///
/// Rounds the `Number` `value` up to the nearest `multiple`.
///
pub fn roundUp(comptime Number: type, value: Number, multiple: Number) Number {
return value + @mod(@mod(multiple - value, multiple), multiple);
}