Trait malachite_base::num::arithmetic::traits::OverflowingAddMul
source · [−]pub trait OverflowingAddMul<Y = Self, Z = Self> {
type Output;
fn overflowing_add_mul(self, y: Y, z: Z) -> (Self::Output, bool);
}
Expand description
Adds a number and 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_add_mul(self, y: Y, z: Z) -> (Self::Output, bool)
Implementations on Foreign Types
sourceimpl OverflowingAddMul<u8, u8> for u8
impl OverflowingAddMul<u8, u8> for u8
sourcefn overflowing_add_mul(self, y: u8, z: u8) -> (u8, bool)
fn overflowing_add_mul(self, y: u8, z: u8) -> (u8, bool)
Adds a number and the product of two other numbers.
Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow occured. If an overflow occurred, then the wrapped value is returned.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u8
sourceimpl OverflowingAddMul<u16, u16> for u16
impl OverflowingAddMul<u16, u16> for u16
sourcefn overflowing_add_mul(self, y: u16, z: u16) -> (u16, bool)
fn overflowing_add_mul(self, y: u16, z: u16) -> (u16, bool)
Adds a number and the product of two other numbers.
Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow occured. If an overflow occurred, then the wrapped value is returned.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u16
sourceimpl OverflowingAddMul<u32, u32> for u32
impl OverflowingAddMul<u32, u32> for u32
sourcefn overflowing_add_mul(self, y: u32, z: u32) -> (u32, bool)
fn overflowing_add_mul(self, y: u32, z: u32) -> (u32, bool)
Adds a number and the product of two other numbers.
Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow occured. If an overflow occurred, then the wrapped value is returned.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u32
sourceimpl OverflowingAddMul<u64, u64> for u64
impl OverflowingAddMul<u64, u64> for u64
sourcefn overflowing_add_mul(self, y: u64, z: u64) -> (u64, bool)
fn overflowing_add_mul(self, y: u64, z: u64) -> (u64, bool)
Adds a number and the product of two other numbers.
Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow occured. If an overflow occurred, then the wrapped value is returned.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u64
sourceimpl OverflowingAddMul<u128, u128> for u128
impl OverflowingAddMul<u128, u128> for u128
sourcefn overflowing_add_mul(self, y: u128, z: u128) -> (u128, bool)
fn overflowing_add_mul(self, y: u128, z: u128) -> (u128, bool)
Adds a number and the product of two other numbers.
Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow occured. If an overflow occurred, then the wrapped value is returned.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u128
sourceimpl OverflowingAddMul<usize, usize> for usize
impl OverflowingAddMul<usize, usize> for usize
sourcefn overflowing_add_mul(self, y: usize, z: usize) -> (usize, bool)
fn overflowing_add_mul(self, y: usize, z: usize) -> (usize, bool)
Adds a number and the product of two other numbers.
Returns a tuple containing the result and a boolean indicating whether an arithmetic overflow occured. If an overflow occurred, then the wrapped value is returned.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = usize
sourceimpl OverflowingAddMul<i8, i8> for i8
impl OverflowingAddMul<i8, i8> for i8
sourcefn overflowing_add_mul(self, y: i8, z: i8) -> (i8, bool)
fn overflowing_add_mul(self, y: i8, z: i8) -> (i8, bool)
Adds a number and 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 OverflowingAddMul<i16, i16> for i16
impl OverflowingAddMul<i16, i16> for i16
sourcefn overflowing_add_mul(self, y: i16, z: i16) -> (i16, bool)
fn overflowing_add_mul(self, y: i16, z: i16) -> (i16, bool)
Adds a number and 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 OverflowingAddMul<i32, i32> for i32
impl OverflowingAddMul<i32, i32> for i32
sourcefn overflowing_add_mul(self, y: i32, z: i32) -> (i32, bool)
fn overflowing_add_mul(self, y: i32, z: i32) -> (i32, bool)
Adds a number and 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 OverflowingAddMul<i64, i64> for i64
impl OverflowingAddMul<i64, i64> for i64
sourcefn overflowing_add_mul(self, y: i64, z: i64) -> (i64, bool)
fn overflowing_add_mul(self, y: i64, z: i64) -> (i64, bool)
Adds a number and 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 OverflowingAddMul<i128, i128> for i128
impl OverflowingAddMul<i128, i128> for i128
sourcefn overflowing_add_mul(self, y: i128, z: i128) -> (i128, bool)
fn overflowing_add_mul(self, y: i128, z: i128) -> (i128, bool)
Adds a number and 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 OverflowingAddMul<isize, isize> for isize
impl OverflowingAddMul<isize, isize> for isize
sourcefn overflowing_add_mul(self, y: isize, z: isize) -> (isize, bool)
fn overflowing_add_mul(self, y: isize, z: isize) -> (isize, bool)
Adds a number and 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.