Trait cosmwasm_std::Fraction[][src]

pub trait Fraction<T>: Sized {
    fn numerator(&self) -> T;
fn denominator(&self) -> T;
fn inv(&self) -> Option<Self>; }

A fraction p/q with integers p and q.

p is called the numerator and q is called the denominator.

Required methods

fn numerator(&self) -> T[src]

Returns the numerator p

fn denominator(&self) -> T[src]

Returns the denominator q

fn inv(&self) -> Option<Self>[src]

Returns the multiplicative inverse q/p for fraction p/q.

If p is zero, None is returned.

Loading content...

Implementors

impl Fraction<u128> for Decimal[src]

fn inv(&self) -> Option<Decimal>[src]

Returns the multiplicative inverse 1/d for decimal d.

If d is zero, none is returned.

Loading content...