Trait num::traits::ops::checked::CheckedAdd
[−]
[src]
pub trait CheckedAdd: Add<Self, Output=Self> { fn checked_add(&self, v: &Self) -> Option<Self>; }
Performs addition that returns None
instead of wrapping around on
overflow.
Required Methods
fn checked_add(&self, v: &Self) -> Option<Self>
Adds two numbers, checking for overflow. If overflow happens, None
is
returned.
Implementors
impl CheckedAdd for BigInt
impl CheckedAdd for BigUint
impl CheckedAdd for isize
impl CheckedAdd for i64
impl CheckedAdd for i32
impl CheckedAdd for i16
impl CheckedAdd for i8
impl CheckedAdd for usize
impl CheckedAdd for u64
impl CheckedAdd for u32
impl CheckedAdd for u16
impl CheckedAdd for u8