Trait malachite_base::num::arithmetic::traits::OverflowingSubMul
source · [−]pub trait OverflowingSubMul<Y = Self, Z = Self> {
type Output;
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
fn overflowing_sub_mul(self, y: Y, z: Z) -> (Self::Output, bool)
Implementations on Foreign Types
sourceimpl OverflowingSubMul<u8, u8> for u8
impl OverflowingSubMul<u8, u8> for u8
sourcefn overflowing_sub_mul(self, y: u8, z: u8) -> (u8, bool)
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
sourceimpl OverflowingSubMul<u16, u16> for u16
impl OverflowingSubMul<u16, u16> for u16
sourcefn overflowing_sub_mul(self, y: u16, z: u16) -> (u16, bool)
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
sourceimpl OverflowingSubMul<u32, u32> for u32
impl OverflowingSubMul<u32, u32> for u32
sourcefn overflowing_sub_mul(self, y: u32, z: u32) -> (u32, bool)
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
sourceimpl OverflowingSubMul<u64, u64> for u64
impl OverflowingSubMul<u64, u64> for u64
sourcefn overflowing_sub_mul(self, y: u64, z: u64) -> (u64, bool)
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
sourceimpl OverflowingSubMul<u128, u128> for u128
impl OverflowingSubMul<u128, u128> for u128
sourcefn overflowing_sub_mul(self, y: u128, z: u128) -> (u128, bool)
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
sourceimpl OverflowingSubMul<usize, usize> for usize
impl OverflowingSubMul<usize, usize> for usize
sourcefn overflowing_sub_mul(self, y: usize, z: usize) -> (usize, bool)
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
sourceimpl OverflowingSubMul<i8, i8> for i8
impl OverflowingSubMul<i8, i8> for i8
sourcefn overflowing_sub_mul(self, y: i8, z: i8) -> (i8, bool)
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
sourceimpl OverflowingSubMul<i16, i16> for i16
impl OverflowingSubMul<i16, i16> for i16
sourcefn overflowing_sub_mul(self, y: i16, z: i16) -> (i16, bool)
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
sourceimpl OverflowingSubMul<i32, i32> for i32
impl OverflowingSubMul<i32, i32> for i32
sourcefn overflowing_sub_mul(self, y: i32, z: i32) -> (i32, bool)
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
sourceimpl OverflowingSubMul<i64, i64> for i64
impl OverflowingSubMul<i64, i64> for i64
sourcefn overflowing_sub_mul(self, y: i64, z: i64) -> (i64, bool)
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
sourceimpl OverflowingSubMul<i128, i128> for i128
impl OverflowingSubMul<i128, i128> for i128
sourcefn overflowing_sub_mul(self, y: i128, z: i128) -> (i128, bool)
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
sourceimpl OverflowingSubMul<isize, isize> for isize
impl OverflowingSubMul<isize, isize> for isize
sourcefn overflowing_sub_mul(self, y: isize, z: isize) -> (isize, bool)
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.