RealInstance

Trait RealInstance 

Source
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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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