Enum rink_core::numeric::Numeric[][src]

pub enum Numeric {
    Rational(BigRat),
    Float(f64),
}

Number type.

Variants

Rational(BigRat)

Arbitrary-precision rational fraction.

Float(f64)

Machine floats.

Implementations

impl Numeric[src]

pub fn one() -> Numeric[src]

pub fn zero() -> Numeric[src]

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

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

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

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

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

pub fn to_string(&self, base: u8, digits: Digits) -> (bool, String)[src]

Returns (is_exact, repr).

pub fn string_repr(
    &self,
    base: u8,
    digits: Digits
) -> (Option<String>, Option<String>)
[src]

Trait Implementations

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

type Output = Numeric

The resulting type after applying the + operator.

impl Clone for Numeric[src]

impl Debug for Numeric[src]

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

type Output = Numeric

The resulting type after applying the / operator.

impl From<BigInt> for Numeric[src]

impl From<BigRat> for Numeric[src]

impl From<i64> for Numeric[src]

impl Into<NumericParts> for Numeric[src]

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

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

type Output = Numeric

The resulting type after applying the * operator.

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

type Output = Numeric

The resulting type after applying the - operator.

impl PartialEq<Numeric> for Numeric[src]

impl PartialOrd<Numeric> for Numeric[src]

impl Serialize for Numeric[src]

impl StructuralPartialEq for Numeric[src]

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

type Output = Numeric

The resulting type after applying the - operator.

Auto Trait Implementations

impl RefUnwindSafe for Numeric

impl Send for Numeric

impl Sync for Numeric

impl Unpin for Numeric

impl UnwindSafe for Numeric

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.