Trait num_prime::ExactRoots

source ·
pub trait ExactRoots: Roots + Pow<u32, Output = Self> + Clone {
    // Provided methods
    fn nth_root_exact(&self, n: u32) -> Option<Self> { ... }
    fn sqrt_exact(&self) -> Option<Self> { ... }
    fn cbrt_exact(&self) -> Option<Self> { ... }
    fn is_nth_power(&self, n: u32) -> bool { ... }
    fn is_square(&self) -> bool { ... }
    fn is_cubic(&self) -> bool { ... }
}
Expand description

Extension on num_integer::Roots to support perfect power check on integers

Provided Methods§

source

fn nth_root_exact(&self, n: u32) -> Option<Self>

source

fn sqrt_exact(&self) -> Option<Self>

source

fn cbrt_exact(&self) -> Option<Self>

source

fn is_nth_power(&self, n: u32) -> bool

source

fn is_square(&self) -> bool

source

fn is_cubic(&self) -> bool

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ExactRoots for i8

source§

fn sqrt_exact(&self) -> Option<Self>

source§

impl ExactRoots for i16

source§

fn sqrt_exact(&self) -> Option<Self>

source§

impl ExactRoots for i32

source§

fn sqrt_exact(&self) -> Option<Self>

source§

impl ExactRoots for i64

source§

fn sqrt_exact(&self) -> Option<Self>

source§

impl ExactRoots for i128

source§

fn sqrt_exact(&self) -> Option<Self>

source§

impl ExactRoots for isize

source§

fn sqrt_exact(&self) -> Option<Self>

source§

impl ExactRoots for u8

source§

fn sqrt_exact(&self) -> Option<Self>

source§

impl ExactRoots for u16

source§

fn sqrt_exact(&self) -> Option<Self>

source§

impl ExactRoots for u32

source§

fn sqrt_exact(&self) -> Option<Self>

source§

impl ExactRoots for u64

source§

fn sqrt_exact(&self) -> Option<Self>

source§

impl ExactRoots for u128

source§

fn sqrt_exact(&self) -> Option<Self>

source§

impl ExactRoots for usize

source§

fn sqrt_exact(&self) -> Option<Self>

source§

impl ExactRoots for BigInt

source§

fn sqrt_exact(&self) -> Option<Self>

source§

fn cbrt_exact(&self) -> Option<Self>

source§

impl ExactRoots for BigUint

source§

fn sqrt_exact(&self) -> Option<Self>

source§

fn cbrt_exact(&self) -> Option<Self>

Implementors§

source§

impl<T: Integer + Clone + ExactRoots, R: Reducer<T> + Clone> ExactRoots for Mint<T, R>