Trait malachite_base::num::arithmetic::traits::OverflowingAdd

source ·
pub trait OverflowingAdd<RHS = Self> {
    type Output;

    // Required method
    fn overflowing_add(self, other: RHS) -> (Self::Output, bool);
}
Expand description

Adds two numbers.

Returns a tuple of the sum 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_add(self, other: RHS) -> (Self::Output, bool)

Implementations on Foreign Types§

source§

impl OverflowingAdd for i8

source§

fn overflowing_add(self, other: i8) -> (i8, bool)

This is a wrapper over the overflowing_add functions in the standard library, for example this one.

§

type Output = i8

source§

impl OverflowingAdd for i16

source§

fn overflowing_add(self, other: i16) -> (i16, bool)

This is a wrapper over the overflowing_add functions in the standard library, for example this one.

§

type Output = i16

source§

impl OverflowingAdd for i32

source§

fn overflowing_add(self, other: i32) -> (i32, bool)

This is a wrapper over the overflowing_add functions in the standard library, for example this one.

§

type Output = i32

source§

impl OverflowingAdd for i64

source§

fn overflowing_add(self, other: i64) -> (i64, bool)

This is a wrapper over the overflowing_add functions in the standard library, for example this one.

§

type Output = i64

source§

impl OverflowingAdd for i128

source§

fn overflowing_add(self, other: i128) -> (i128, bool)

This is a wrapper over the overflowing_add functions in the standard library, for example this one.

§

type Output = i128

source§

impl OverflowingAdd for isize

source§

fn overflowing_add(self, other: isize) -> (isize, bool)

This is a wrapper over the overflowing_add functions in the standard library, for example this one.

§

type Output = isize

source§

impl OverflowingAdd for u8

source§

fn overflowing_add(self, other: u8) -> (u8, bool)

This is a wrapper over the overflowing_add functions in the standard library, for example this one.

§

type Output = u8

source§

impl OverflowingAdd for u16

source§

fn overflowing_add(self, other: u16) -> (u16, bool)

This is a wrapper over the overflowing_add functions in the standard library, for example this one.

§

type Output = u16

source§

impl OverflowingAdd for u32

source§

fn overflowing_add(self, other: u32) -> (u32, bool)

This is a wrapper over the overflowing_add functions in the standard library, for example this one.

§

type Output = u32

source§

impl OverflowingAdd for u64

source§

fn overflowing_add(self, other: u64) -> (u64, bool)

This is a wrapper over the overflowing_add functions in the standard library, for example this one.

§

type Output = u64

source§

impl OverflowingAdd for u128

source§

fn overflowing_add(self, other: u128) -> (u128, bool)

This is a wrapper over the overflowing_add functions in the standard library, for example this one.

§

type Output = u128

source§

impl OverflowingAdd for usize

source§

fn overflowing_add(self, other: usize) -> (usize, bool)

This is a wrapper over the overflowing_add functions in the standard library, for example this one.

§

type Output = usize

Implementors§