pub trait ScientificInteger: ScientificNumber + Eq {
// Required methods
fn gcd(self, other: Self) -> Self;
fn lcm(self, other: Self) -> Self;
fn is_prime(self) -> bool;
fn is_even(self) -> bool;
fn is_odd(self) -> bool;
fn mod_pow(self, exp: Self, modulus: Self) -> Self;
fn factorial(self) -> CoreResult<Self>;
fn binomial(self, k: Self) -> Self;
}
Expand description
A trait for integers that can be used in scientific calculations
Required Methods§
Sourcefn mod_pow(self, exp: Self, modulus: Self) -> Self
fn mod_pow(self, exp: Self, modulus: Self) -> Self
Modular exponentiation (self^exp mod modulus)
Sourcefn factorial(self) -> CoreResult<Self>
fn factorial(self) -> CoreResult<Self>
Factorial
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.