thin-provisioning-tools/src/math.rs

8 lines
171 B
Rust
Raw Normal View History

2021-04-26 10:17:05 +05:30
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
}