pub trait DivCeil: Sized + Div<Self> {
// Required method
fn div_ceil(self, rhs: Self) -> <Self as Div<Self>>::Output;
}Expand description
Performs division, rounding the quotient towards positive infinity.
Required Methods§
Sourcefn div_ceil(self, rhs: Self) -> <Self as Div<Self>>::Output
fn div_ceil(self, rhs: Self) -> <Self as Div<Self>>::Output
Calculates the quotient of self and rhs, rounding the result
towards positive infinity.
§Panics
Panics if rhs is zero, or — with overflow checks enabled — on
MIN / -1 for signed types.
use const_num_traits::DivCeil;
assert_eq!(DivCeil::div_ceil(7u8, 2), 4);
assert_eq!(DivCeil::div_ceil(7i8, -2), -3);
assert_eq!(DivCeil::div_ceil(-7i8, 2), -3);Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".