[][src]Enum rink::num::Num

pub enum Num {
    Mpq(Mpq),
    Float(f64),
}

Number type.

Variants

Mpq(Mpq)

Arbitrary-precision rational fraction.

Float(f64)

Machine floats.

Methods

impl Num
[src]

pub fn one() -> Num
[src]

pub fn zero() -> Num
[src]

pub fn abs(&self) -> Num
[src]

pub fn div_rem(&self, other: &Num) -> (Num, Num)
[src]

pub fn to_rational(&self) -> (Int, Int)
[src]

pub fn to_int(&self) -> Option<i64>
[src]

pub fn to_f64(&self) -> f64
[src]

Trait Implementations

impl From<Mpq> for Num
[src]

impl From<Mpz> for Num
[src]

impl From<i64> for Num
[src]

impl<'a> Into<f64> for &'a Num
[src]

impl PartialOrd<Num> for Num
[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialEq<Num> for Num
[src]

impl Clone for Num
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Num
[src]

impl<'a, 'b> Add<&'b Num> for &'a Num
[src]

type Output = Num

The resulting type after applying the + operator.

impl<'a, 'b> Sub<&'b Num> for &'a Num
[src]

type Output = Num

The resulting type after applying the - operator.

impl<'a, 'b> Mul<&'b Num> for &'a Num
[src]

type Output = Num

The resulting type after applying the * operator.

impl<'a, 'b> Div<&'b Num> for &'a Num
[src]

type Output = Num

The resulting type after applying the / operator.

impl<'a> Neg for &'a Num
[src]

type Output = Num

The resulting type after applying the - operator.

Auto Trait Implementations

impl Send for Num

impl Sync for Num

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.