Skip to main content

Gamma

Trait Gamma 

Source
pub trait Gamma: Sized {
    type Output;

    // Required methods
    fn gamma(self) -> Self::Output;
    fn ln_gamma(self) -> (Self::Output, i32);
}
Expand description

The gamma function and the natural log of its absolute value.

Implementations for f32/f64 require the libm cargo feature (std’s gamma is still unstable, so there is nothing to delegate to otherwise).

Required Associated Types§

Source

type Output

The (owned) result type.

Required Methods§

Source

fn gamma(self) -> Self::Output

The gamma function Γ(self).

Source

fn ln_gamma(self) -> (Self::Output, i32)

Returns ln(|Γ(self)|) together with the sign of Γ(self), matching std’s ln_gamma (and C’s lgamma_r).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§