Trait relp_num::Signed

source ·
pub trait Signed {
    // Required method
    fn signum(&self) -> Sign;

    // Provided methods
    fn is_positive(&self) -> bool { ... }
    fn is_negative(&self) -> bool { ... }
}
Expand description

§Signed numbers

A number that is positive, negative or zero.

Required Methods§

source

fn signum(&self) -> Sign

Returns the sign of the number.

Provided Methods§

source

fn is_positive(&self) -> bool

Whether the number is (strictly) greater than zero.

source

fn is_negative(&self) -> bool

Whether the number is (strictly) smaller than zero.

Implementations on Foreign Types§

source§

impl Signed for i8

source§

fn signum(&self) -> Sign

source§

impl Signed for i16

source§

fn signum(&self) -> Sign

source§

impl Signed for i32

source§

fn signum(&self) -> Sign

source§

impl Signed for i64

source§

fn signum(&self) -> Sign

source§

impl Signed for i128

source§

fn signum(&self) -> Sign

source§

impl Signed for isize

source§

fn signum(&self) -> Sign

source§

impl Signed for u8

source§

fn signum(&self) -> Sign

source§

impl Signed for u16

source§

fn signum(&self) -> Sign

source§

impl Signed for u32

source§

fn signum(&self) -> Sign

source§

impl Signed for u64

source§

fn signum(&self) -> Sign

source§

impl Signed for u128

source§

fn signum(&self) -> Sign

source§

impl Signed for usize

source§

fn signum(&self) -> Sign

source§

impl Signed for NonZeroI8

source§

fn signum(&self) -> Sign

source§

impl Signed for NonZeroI16

source§

fn signum(&self) -> Sign

source§

impl Signed for NonZeroI32

source§

fn signum(&self) -> Sign

source§

impl Signed for NonZeroI64

source§

fn signum(&self) -> Sign

source§

impl Signed for NonZeroI128

source§

fn signum(&self) -> Sign

source§

impl Signed for NonZeroIsize

source§

fn signum(&self) -> Sign

source§

impl Signed for NonZeroU8

source§

fn signum(&self) -> Sign

source§

impl Signed for NonZeroU16

source§

fn signum(&self) -> Sign

source§

impl Signed for NonZeroU32

source§

fn signum(&self) -> Sign

source§

impl Signed for NonZeroU64

source§

fn signum(&self) -> Sign

source§

impl Signed for NonZeroU128

source§

fn signum(&self) -> Sign

source§

impl Signed for NonZeroUsize

source§

fn signum(&self) -> Sign

Implementors§

source§

impl Signed for NonZeroSign

source§

impl Signed for Sign

source§

impl Signed for Zero

source§

impl<const S: usize> Signed for NonZeroUbig<S>

source§

impl<const S: usize> Signed for Ubig<S>