pub trait PrimeFactorization: Sized {
// Required method
fn prime_factorization(self) -> Vec<(Self, Self)>;
}Expand description
非負整数を素因数分解です。
Required Methods§
Sourcefn prime_factorization(self) -> Vec<(Self, Self)>
fn prime_factorization(self) -> Vec<(Self, Self)>
(素因数, べき) のベクタを返します。
§Examples
use prime_factorization::PrimeFactorization;
assert_eq!(2_u32.prime_factorization(), vec![(2, 1)]);
// 90 = 2 * 3 * 3 * 5
assert_eq!(90_u32.prime_factorization(), vec![(2, 1), (3, 2), (5, 1)]);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.