[][src]Trait bigbit::DivRemAssign

pub trait DivRemAssign<Rhs = Self> {
    type Remainder;
    fn div_rem_assign(&mut self, rhs: Rhs) -> Self::Remainder;
}

Division in place combined with retreiving the remainder.

This serves the same purpose as the DivRem trait, but the division is performed in place (the variable/field containing the dividend is replaced by the quotient), and the only value returned is the remainder.

Associated Types

type Remainder

The type for the remainder.

Loading content...

Required methods

fn div_rem_assign(&mut self, rhs: Rhs) -> Self::Remainder

Performs combined quotient and remainder calculation, returning the remainder and setting the left operand to the quotient.

Loading content...

Implementors

impl DivRemAssign<LBNum> for LBNum[src]

type Remainder = Self

fn div_rem_assign(&mut self, rhs: Self) -> Self[src]

Performs in-place integer division combined with returning the remainder.

Panics

Dividing by 0 triggers an immediate panic.

impl DivRemAssign<u8> for LBNum[src]

type Remainder = Self

The remainder type.

The reason why this is Self instead of the type of the divisor is that the remainder as available when the division is finished is still of type LBNum: it's never converted to the divisor type. As a result, the remainder is returned as-is to avoid situations when the remainder is required to be an LBNum yet has been converted to the divisor type, which would require converting it back into LBNum, which would require another allocation and performing the conversion process itself and would also waste the previous buffer.

impl DivRemAssign<u16> for LBNum[src]

type Remainder = Self

The remainder type.

The reason why this is Self instead of the type of the divisor is that the remainder as available when the division is finished is still of type LBNum: it's never converted to the divisor type. As a result, the remainder is returned as-is to avoid situations when the remainder is required to be an LBNum yet has been converted to the divisor type, which would require converting it back into LBNum, which would require another allocation and performing the conversion process itself and would also waste the previous buffer.

impl DivRemAssign<u32> for LBNum[src]

type Remainder = Self

The remainder type.

The reason why this is Self instead of the type of the divisor is that the remainder as available when the division is finished is still of type LBNum: it's never converted to the divisor type. As a result, the remainder is returned as-is to avoid situations when the remainder is required to be an LBNum yet has been converted to the divisor type, which would require converting it back into LBNum, which would require another allocation and performing the conversion process itself and would also waste the previous buffer.

impl DivRemAssign<u64> for LBNum[src]

type Remainder = Self

The remainder type.

The reason why this is Self instead of the type of the divisor is that the remainder as available when the division is finished is still of type LBNum: it's never converted to the divisor type. As a result, the remainder is returned as-is to avoid situations when the remainder is required to be an LBNum yet has been converted to the divisor type, which would require converting it back into LBNum, which would require another allocation and performing the conversion process itself and would also waste the previous buffer.

impl DivRemAssign<u128> for LBNum[src]

type Remainder = Self

The remainder type.

The reason why this is Self instead of the type of the divisor is that the remainder as available when the division is finished is still of type LBNum: it's never converted to the divisor type. As a result, the remainder is returned as-is to avoid situations when the remainder is required to be an LBNum yet has been converted to the divisor type, which would require converting it back into LBNum, which would require another allocation and performing the conversion process itself and would also waste the previous buffer.

impl DivRemAssign<usize> for LBNum[src]

type Remainder = Self

The remainder type.

The reason why this is Self instead of the type of the divisor is that the remainder as available when the division is finished is still of type LBNum: it's never converted to the divisor type. As a result, the remainder is returned as-is to avoid situations when the remainder is required to be an LBNum yet has been converted to the divisor type, which would require converting it back into LBNum, which would require another allocation and performing the conversion process itself and would also waste the previous buffer.

impl<'_> DivRemAssign<&'_ LBNum> for LBNum[src]

type Remainder = Self

fn div_rem_assign(&mut self, rhs: &Self) -> Self[src]

Performs in-place integer division combined with returning the remainder.

Panics

Dividing by 0 triggers an immediate panic.

Loading content...