Trait malachite_base::num::arithmetic::traits::CheckedNeg

source ·
pub trait CheckedNeg {
    type Output;

    // Required method
    fn checked_neg(self) -> Option<Self::Output>;
}
Expand description

Negates a number, returning None if the result is not representable.

Required Associated Types§

Required Methods§

source

fn checked_neg(self) -> Option<Self::Output>

Implementations on Foreign Types§

source§

impl CheckedNeg for i8

source§

fn checked_neg(self) -> Option<i8>

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

source§

type Output = i8

source§

impl CheckedNeg for i16

source§

fn checked_neg(self) -> Option<i16>

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

source§

type Output = i16

source§

impl CheckedNeg for i32

source§

fn checked_neg(self) -> Option<i32>

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

source§

type Output = i32

source§

impl CheckedNeg for i64

source§

fn checked_neg(self) -> Option<i64>

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

source§

type Output = i64

source§

impl CheckedNeg for i128

source§

fn checked_neg(self) -> Option<i128>

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

source§

type Output = i128

source§

impl CheckedNeg for isize

source§

fn checked_neg(self) -> Option<isize>

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

source§

type Output = isize

source§

impl CheckedNeg for u8

source§

fn checked_neg(self) -> Option<u8>

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

source§

type Output = u8

source§

impl CheckedNeg for u16

source§

fn checked_neg(self) -> Option<u16>

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

source§

type Output = u16

source§

impl CheckedNeg for u32

source§

fn checked_neg(self) -> Option<u32>

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

source§

type Output = u32

source§

impl CheckedNeg for u64

source§

fn checked_neg(self) -> Option<u64>

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

source§

type Output = u64

source§

impl CheckedNeg for u128

source§

fn checked_neg(self) -> Option<u128>

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

source§

type Output = u128

source§

impl CheckedNeg for usize

source§

fn checked_neg(self) -> Option<usize>

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

source§

type Output = usize

Implementors§