Trait NthRoot

Source
pub trait NthRoot:
    Copy
    + Mul<Output = Self>
    + Ord
    + Shl<usize, Output = Self>
    + Shr<usize, Output = Self>
    + Div<Output = Self>
    + Add<Output = Self>
    + Sub<Output = Self>
    + From<u64>
    + Debug {
    const BITS: usize;
    const MAX: Self;

    // Required methods
    fn checked_mul(self, other: Self) -> Option<Self>;
    fn mul_usize(self, other: usize) -> Self;
    fn div_usize(self, other: usize) -> Self;
    fn bits(self) -> usize;
    fn init_root<N: RootDegree>(self) -> InitRoot<Self>;

    // Provided methods
    fn nth_root<N: RootDegree>(self) -> Self { ... }
    fn truncate(self, next_bits: usize, multiply: usize) -> (Self, usize) { ... }
}

Required Associated Constants§

Source

const BITS: usize

Source

const MAX: Self

Required Methods§

Source

fn checked_mul(self, other: Self) -> Option<Self>

Source

fn mul_usize(self, other: usize) -> Self

Source

fn div_usize(self, other: usize) -> Self

Source

fn bits(self) -> usize

Source

fn init_root<N: RootDegree>(self) -> InitRoot<Self>

Provided Methods§

Source

fn nth_root<N: RootDegree>(self) -> Self

Source

fn truncate(self, next_bits: usize, multiply: usize) -> (Self, usize)

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 NthRoot for u64

Source§

const BITS: usize = 64usize

Source§

const MAX: u64 = 18_446_744_073_709_551_615u64

Source§

fn checked_mul(self, other: Self) -> Option<Self>

Source§

fn mul_usize(self, other: usize) -> Self

Source§

fn div_usize(self, other: usize) -> Self

Source§

fn bits(self) -> usize

Source§

fn init_root<N: RootDegree>(self) -> InitRoot<Self>

Source§

impl NthRoot for u128

Source§

const BITS: usize = 128usize

Source§

const MAX: u128 = 340_282_366_920_938_463_463_374_607_431_768_211_455u128

Source§

fn checked_mul(self, other: Self) -> Option<Self>

Source§

fn mul_usize(self, other: usize) -> Self

Source§

fn div_usize(self, other: usize) -> Self

Source§

fn bits(self) -> usize

Source§

fn init_root<N: RootDegree>(self) -> InitRoot<Self>

Source§

impl NthRoot for U256

Source§

const BITS: usize = 256usize

Source§

const MAX: U256 = U256::MAX

Source§

fn checked_mul(self, other: Self) -> Option<Self>

Source§

fn mul_usize(self, other: usize) -> Self

Source§

fn div_usize(self, other: usize) -> Self

Source§

fn bits(self) -> usize

Source§

fn init_root<N: RootDegree>(self) -> InitRoot<Self>

Source§

impl NthRoot for U512

Source§

const BITS: usize = 512usize

Source§

const MAX: U512 = U512::MAX

Source§

fn checked_mul(self, other: Self) -> Option<Self>

Source§

fn mul_usize(self, other: usize) -> Self

Source§

fn div_usize(self, other: usize) -> Self

Source§

fn bits(self) -> usize

Source§

fn init_root<N: RootDegree>(self) -> InitRoot<Self>

Implementors§