[][src]Trait numerics::SignedAndUnsigned

pub trait SignedAndUnsigned: Sized {
    const MINIMUM: Self;

    fn abs(&self) -> Option<Self>;
fn is_negative(&self) -> bool; }

Signed number operations implemented for both signed and unsigned numbers.

Associated Constants

const MINIMUM: Self

Minimum value for the type.

Loading content...

Required methods

fn abs(&self) -> Option<Self>

The absolute value of a number. If the number is signed and equal to ::MIN, this operation would normally panic at overflow in debug or return ::MIN in release. This is undesired behavior, so we return None instead.

fn is_negative(&self) -> bool

Reports whether the number is negative.

Loading content...

Implementations on Foreign Types

impl SignedAndUnsigned for usize[src]

impl SignedAndUnsigned for u8[src]

impl SignedAndUnsigned for u16[src]

impl SignedAndUnsigned for u32[src]

impl SignedAndUnsigned for u64[src]

impl SignedAndUnsigned for isize[src]

impl SignedAndUnsigned for i8[src]

impl SignedAndUnsigned for i16[src]

impl SignedAndUnsigned for i32[src]

impl SignedAndUnsigned for i64[src]

Loading content...

Implementors

Loading content...