pub trait OverflowingSubMul<Y = Self, Z = Self> {
    type Output;

    // Required method
    fn overflowing_sub_mul(self, y: Y, z: Z) -> (Self::Output, bool);
}
Expand description

Subtracts a number by the product of two other numbers.

Returns a tuple of the result along with a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped number is returned.

Required Associated Types§

Required Methods§

source

fn overflowing_sub_mul(self, y: Y, z: Z) -> (Self::Output, bool)

Implementations on Foreign Types§

source§

impl OverflowingSubMul for i8

source§

fn overflowing_sub_mul(self, y: i8, z: i8) -> (i8, bool)

Subtracts a number by the product of two other numbers.

Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is returned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

§

type Output = i8

source§

impl OverflowingSubMul for i16

source§

fn overflowing_sub_mul(self, y: i16, z: i16) -> (i16, bool)

Subtracts a number by the product of two other numbers.

Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is returned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

§

type Output = i16

source§

impl OverflowingSubMul for i32

source§

fn overflowing_sub_mul(self, y: i32, z: i32) -> (i32, bool)

Subtracts a number by the product of two other numbers.

Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is returned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

§

type Output = i32

source§

impl OverflowingSubMul for i64

source§

fn overflowing_sub_mul(self, y: i64, z: i64) -> (i64, bool)

Subtracts a number by the product of two other numbers.

Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is returned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

§

type Output = i64

source§

impl OverflowingSubMul for i128

source§

fn overflowing_sub_mul(self, y: i128, z: i128) -> (i128, bool)

Subtracts a number by the product of two other numbers.

Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is returned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

§

type Output = i128

source§

impl OverflowingSubMul for isize

source§

fn overflowing_sub_mul(self, y: isize, z: isize) -> (isize, bool)

Subtracts a number by the product of two other numbers.

Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is returned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

§

type Output = isize

source§

impl OverflowingSubMul for u8

source§

fn overflowing_sub_mul(self, y: u8, z: u8) -> (u8, bool)

Subtracts a number by the product of two other numbers.

Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred, then the wrapped value is returned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

§

type Output = u8

source§

impl OverflowingSubMul for u16

source§

fn overflowing_sub_mul(self, y: u16, z: u16) -> (u16, bool)

Subtracts a number by the product of two other numbers.

Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred, then the wrapped value is returned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

§

type Output = u16

source§

impl OverflowingSubMul for u32

source§

fn overflowing_sub_mul(self, y: u32, z: u32) -> (u32, bool)

Subtracts a number by the product of two other numbers.

Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred, then the wrapped value is returned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

§

type Output = u32

source§

impl OverflowingSubMul for u64

source§

fn overflowing_sub_mul(self, y: u64, z: u64) -> (u64, bool)

Subtracts a number by the product of two other numbers.

Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred, then the wrapped value is returned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

§

type Output = u64

source§

impl OverflowingSubMul for u128

source§

fn overflowing_sub_mul(self, y: u128, z: u128) -> (u128, bool)

Subtracts a number by the product of two other numbers.

Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred, then the wrapped value is returned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

§

type Output = u128

source§

impl OverflowingSubMul for usize

source§

fn overflowing_sub_mul(self, y: usize, z: usize) -> (usize, bool)

Subtracts a number by the product of two other numbers.

Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred, then the wrapped value is returned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

§

type Output = usize

Implementors§