Divisors

Trait Divisors 

Source
pub trait Divisors: Sized {
    // Required method
    fn divisors(self) -> Vec<Self>;
}
Expand description

非負整数の約数全体です。

Required Methods§

Source

fn divisors(self) -> Vec<Self>

非負整数の約数を昇順で返します。0 に対しては空のベクタ vec![] を返します。

§Examples
use divisors::Divisors;

assert_eq!(24_u32.divisors(), vec![1, 2, 3, 4, 6, 8, 12, 24]);

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.

Implementations on Foreign Types§

Source§

impl Divisors for u32

Source§

fn divisors(self) -> Vec<Self>

Source§

impl Divisors for u64

Source§

fn divisors(self) -> Vec<Self>

Source§

impl Divisors for usize

Source§

fn divisors(self) -> Vec<Self>

Implementors§