pub trait RealInstance: PartialEq + PartialOrd + Sized {
    const ONE: Self;
    const ZERO: Self;

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

Defines common operations on real (i.e. not Complex) numbers.

Required Associated Constants§

source

const ONE: Self

source

const ZERO: Self

Provided Methods§

source

fn is_positive(&self) -> bool

Return true if this is zero or a positive number.

source

fn is_negative(&self) -> bool

Return true if this is a negative number.

source

fn is_zero(&self) -> bool

Return true if this is zero.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl RealInstance for Float

source§

const ONE: Self = _

source§

const ZERO: Self = _

source§

impl RealInstance for Int

source§

const ONE: Self = _

source§

const ZERO: Self = _

source§

impl RealInstance for UInt

source§

const ONE: Self = _

source§

const ZERO: Self = _

source§

impl RealInstance for Boolean

source§

const ONE: Self = _

source§

const ZERO: Self = _