Add missing math.rs

This commit is contained in:
Ming-Hung Tsai 2021-04-26 12:47:05 +08:00
parent 040e3bfc2d
commit e9899ac610

7
src/math.rs Normal file
View File

@ -0,0 +1,7 @@
pub fn div_up(v: usize, divisor: usize) -> usize {
v / divisor + (v % divisor != 0) as usize
}
pub fn div_down(v: usize, divisor: usize) -> usize {
v / divisor
}