Skip to main content

ConstDivCeil

Trait ConstDivCeil 

Source
pub trait ConstDivCeil:
    Sized
    + ConstZero
    + ConstOne
    + ConstCheckedAdd {
    // Required methods
    fn div_ceil(self, rhs: Self) -> Self;
    fn checked_div_ceil(self, rhs: Self) -> Option<Self>;
}
Expand description

Const-compatible ceiling division.

Returns the smallest integer greater than or equal to the exact quotient.

Required Methods§

Source

fn div_ceil(self, rhs: Self) -> Self

Calculates the quotient of self and rhs, rounding up.

§Panics

Panics if rhs is zero.

Source

fn checked_div_ceil(self, rhs: Self) -> Option<Self>

Calculates the quotient of self and rhs, rounding up.

Returns None if rhs is zero.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ConstDivCeil for u8

Source§

fn div_ceil(self, rhs: Self) -> Self

Source§

fn checked_div_ceil(self, rhs: Self) -> Option<Self>

Source§

impl ConstDivCeil for u16

Source§

fn div_ceil(self, rhs: Self) -> Self

Source§

fn checked_div_ceil(self, rhs: Self) -> Option<Self>

Source§

impl ConstDivCeil for u32

Source§

fn div_ceil(self, rhs: Self) -> Self

Source§

fn checked_div_ceil(self, rhs: Self) -> Option<Self>

Source§

impl ConstDivCeil for u64

Source§

fn div_ceil(self, rhs: Self) -> Self

Source§

fn checked_div_ceil(self, rhs: Self) -> Option<Self>

Source§

impl ConstDivCeil for u128

Source§

fn div_ceil(self, rhs: Self) -> Self

Source§

fn checked_div_ceil(self, rhs: Self) -> Option<Self>

Implementors§

Source§

impl<T: ConstMachineWord + MachineWord, const N: usize> ConstDivCeil for FixedUInt<T, N>