pub trait CheckedDiv: Sized + Div<Self> {
// Required method
fn checked_div(self, v: Self) -> Option<<Self as Div<Self>>::Output>;
}Expand description
Performs division, returning None on division by zero or if overflow
occurred.
Required Methods§
Sourcefn checked_div(self, v: Self) -> Option<<Self as Div<Self>>::Output>
fn checked_div(self, v: Self) -> Option<<Self as Div<Self>>::Output>
Divides two numbers, checking for overflow and division by
zero. If any of that happens, None is returned.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".