Trait rust_decimal::MathematicalOps[][src]

pub trait MathematicalOps {
Show methods fn exp(&self) -> Decimal;
fn exp_with_tolerance(&self, tolerance: Decimal) -> Decimal;
fn powi(&self, exp: i64) -> Decimal;
fn checked_powi(&self, exp: i64) -> Option<Decimal>;
fn powu(&self, exp: u64) -> Decimal;
fn checked_powu(&self, exp: u64) -> Option<Decimal>;
fn powf(&self, exp: f64) -> Decimal;
fn checked_powf(&self, exp: f64) -> Option<Decimal>;
fn powd(&self, exp: Decimal) -> Decimal;
fn checked_powd(&self, exp: Decimal) -> Option<Decimal>;
fn sqrt(&self) -> Option<Decimal>;
fn ln(&self) -> Decimal;
fn erf(&self) -> Decimal;
fn norm_cdf(&self) -> Decimal;
fn norm_pdf(&self) -> Decimal;
}

Trait exposing various mathematical operations that can be applied using a Decimal. This is only present when the maths feature has been enabled.

Required methods

fn exp(&self) -> Decimal[src]

The estimated exponential function, ex. Stops calculating when it is within tolerance of roughly 0.0000002.

fn exp_with_tolerance(&self, tolerance: Decimal) -> Decimal[src]

The estimated exponential function, ex using the tolerance provided as a hint as to when to stop calculating. A larger tolerance will cause the number to stop calculating sooner at the potential cost of a slightly less accurate result.

fn powi(&self, exp: i64) -> Decimal[src]

Raise self to the given integer exponent: xy

fn checked_powi(&self, exp: i64) -> Option<Decimal>[src]

Raise self to the given integer exponent xy returning None on overflow.

fn powu(&self, exp: u64) -> Decimal[src]

Raise self to the given unsigned integer exponent: xy

fn checked_powu(&self, exp: u64) -> Option<Decimal>[src]

Raise self to the given unsigned integer exponent xy returning None on overflow.

fn powf(&self, exp: f64) -> Decimal[src]

Raise self to the given floating point exponent: xy

fn checked_powf(&self, exp: f64) -> Option<Decimal>[src]

Raise self to the given floating point exponent xy returning None on overflow.

fn powd(&self, exp: Decimal) -> Decimal[src]

Raise self to the given Decimal exponent: xy. If exp is not whole then the approximation ey*ln(x) of is used.

fn checked_powd(&self, exp: Decimal) -> Option<Decimal>[src]

Raise self to the given Decimal exponent xy returning None on overflow. If exp is not whole then the approximation ey*ln(x) of is used.

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

The square root of a Decimal. Uses a standard Babylonian method.

fn ln(&self) -> Decimal[src]

The natural logarithm for a Decimal. Uses a fast estimation algorithm This is more accurate on larger numbers and less on numbers less than 1.

fn erf(&self) -> Decimal[src]

Abramowitz Approximation of Error Function from wikipedia

fn norm_cdf(&self) -> Decimal[src]

The Cumulative distribution function for a Normal distribution

fn norm_pdf(&self) -> Decimal[src]

The Probability density function for a Normal distribution

Loading content...

Implementors

impl MathematicalOps for Decimal[src]

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

The square root of a Decimal. Uses a standard Babylonian method.

fn ln(&self) -> Decimal[src]

The natural logarithm for a Decimal. Uses a fast estimation algorithm This is more accurate on larger numbers and less on numbers less than 1.

fn erf(&self) -> Decimal[src]

Abramowitz Approximation of Error Function from wikipedia

fn norm_cdf(&self) -> Decimal[src]

The Cumulative distribution function for a Normal distribution

fn norm_pdf(&self) -> Decimal[src]

The Probability density function for a Normal distribution

Loading content...