Trait UncheckedLn

Source
pub trait UncheckedLn {
    // Required method
    const fn unchecked_ln(self) -> Self;
}
Expand description

Returns the natural logarithm of self.

§Panics

Panics if self is zero or negative.

Required Methods§

Source

const fn unchecked_ln(self) -> Self

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 UncheckedLn for Dec19x19

§Tests

let trunc = |t: Dec19x19| t.trunc_to(17);
check!( [|t| trunc(Dec19x19::unchecked_ln(t)), |t| Dec19x19::checked_ln(t).map(trunc)] {
    (Dec19x19::MAX) =>  trunc(Dec19x19!(44.280_575_164_226_186_298_3)),
    (Dec19x19!(10)) =>  trunc(Dec19x19!(2.302_585_092_994_045_684_0)),
    (Dec19x19!(100)) => trunc(Dec19x19!(4.605_170_185_988_091_367_8)),
    (Dec19x19!(0.1)) => trunc(Dec19x19!(-2.302_585_092_994_045_683_7)),
    (Dec19x19!(2.718281828459045239)) => Dec19x19!(1),
    (-Dec19x19::SMALLEST_STEP) => FAIL,
});