pub trait NumInt: Num {
type OutI;
Show 114 methods
// Provided methods
fn int_digital_root(self) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_digital_root(&self) -> Result<Self::Out> { ... }
fn int_digital_root_base(self, base: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_digital_root_base(&self, base: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_digits(self) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_digits(&self) -> Result<Self::Out> { ... }
fn int_digits_sign(self) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_digits_sign(&self) -> Result<Self::Out> { ... }
fn int_digits_base(self, base: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_digits_base(&self, base: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_digits_base_sign(self, base: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_digits_base_sign(&self, base: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_abs(self) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_abs(&self) -> Result<Self::Out> { ... }
fn int_is_even(self) -> Result<bool>
where Self: Sized { ... }
fn int_ref_is_even(&self) -> Result<bool> { ... }
fn int_is_odd(self) -> Result<bool>
where Self: Sized { ... }
fn int_ref_is_odd(&self) -> Result<bool> { ... }
fn int_gcd(self, other: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_gcd(&self, other: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_gcd_ext(
self,
other: Self::Rhs,
) -> Result<GcdReturn<Self::Out, Self::OutI>>
where Self: Sized { ... }
fn int_ref_gcd_ext(
&self,
other: &Self::Rhs,
) -> Result<GcdReturn<Self::Out, Self::OutI>> { ... }
fn int_lcm(self, other: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_lcm(&self, other: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_scale(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_scale(
&self,
min: &Self::Rhs,
max: &Self::Rhs,
a: &Self::Rhs,
b: &Self::Rhs,
) -> Result<Self::Out> { ... }
fn int_scale_wrap(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_scale_wrap(
&self,
min: &Self::Rhs,
max: &Self::Rhs,
a: &Self::Rhs,
b: &Self::Rhs,
) -> Result<Self::Out> { ... }
fn int_midpoint(self, other: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_midpoint(&self, other: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_factorial(self) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_factorial(&self) -> Result<Self::Out> { ... }
fn int_subfactorial(self) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_subfactorial(&self) -> Result<Self::Out> { ... }
fn int_combine(self, r: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_combine(&self, r: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_combine_rep(self, r: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_combine_rep(&self, r: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_permute(self, r: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_permute(&self, r: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_permute_rep(self, r: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_permute_rep(&self, r: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_div_rem(self, b: Self::Rhs) -> Result<[Self::Out; 2]>
where Self: Sized { ... }
fn int_ref_div_rem(&self, b: &Self::Rhs) -> Result<[Self::Out; 2]> { ... }
fn int_div_ceil(self, b: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_div_ceil(&self, b: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_div_floor(self, b: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_div_floor(&self, b: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_div_ties_away(self, b: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_div_ties_away(&self, b: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_div_ties_towards(self, b: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_div_ties_towards(&self, b: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_div_ties_even(self, b: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_div_ties_even(&self, b: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_div_ties_odd(self, b: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_div_ties_odd(&self, b: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_factors(self) -> Result<Vec<Self::Out>>
where Self: Sized { ... }
fn int_ref_factors(&self) -> Result<Vec<Self::Out>> { ... }
fn int_factors_proper(self) -> Result<Vec<Self::Out>>
where Self: Sized { ... }
fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>> { ... }
fn int_factors_prime(self) -> Result<Vec<Self::Out>>
where Self: Sized { ... }
fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>> { ... }
fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
where Self: Sized { ... }
fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>> { ... }
fn int_factors_buf(
self,
fbuf: &mut [Self::Out],
upfbuf: &mut [Self::Out],
) -> Result<(usize, usize)>
where Self: Sized { ... }
fn int_ref_factors_buf(
&self,
fbuf: &mut [Self::Out],
upfbuf: &mut [Self::Out],
) -> Result<(usize, usize)> { ... }
fn int_factors_proper_buf(
self,
fbuf: &mut [Self],
upfbuf: &mut [Self],
) -> Result<(usize, usize)>
where Self: Sized { ... }
fn int_ref_factors_proper_buf(
&self,
fbuf: &mut [Self::Out],
upfbuf: &mut [Self::Out],
) -> Result<(usize, usize)> { ... }
fn int_factors_prime_buf(self, buffer: &mut [Self]) -> Result<usize>
where Self: Sized { ... }
fn int_ref_factors_prime_buf(
&self,
buffer: &mut [Self::Out],
) -> Result<usize> { ... }
fn int_factors_prime_unique_buf(self, buffer: &mut [Self]) -> Result<usize>
where Self: Sized { ... }
fn int_ref_factors_prime_unique_buf(
&self,
buffer: &mut [Self::Out],
) -> Result<usize> { ... }
fn int_is_prime(self) -> Result<bool>
where Self: Sized { ... }
fn int_ref_is_prime(&self) -> Result<bool> { ... }
fn int_prime_nth(self) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_prime_nth(&self) -> Result<Self::Out> { ... }
fn int_prime_pi(self) -> Result<usize>
where Self: Sized { ... }
fn int_ref_prime_pi(&self) -> Result<usize> { ... }
fn int_totient(self) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_totient(&self) -> Result<Self::Out> { ... }
fn int_is_square(self) -> Result<bool>
where Self: Sized { ... }
fn int_ref_is_square(&self) -> Result<bool> { ... }
fn int_sqrt_ceil(self) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_sqrt_ceil(&self) -> Result<Self::Out> { ... }
fn int_sqrt_floor(self) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_sqrt_floor(&self) -> Result<Self::Out> { ... }
fn int_sqrt_round(self) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_sqrt_round(&self) -> Result<Self::Out> { ... }
fn int_root_ceil(self, nth: u32) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_root_ceil(&self, nth: u32) -> Result<Self::Out> { ... }
fn int_root_floor(self, nth: u32) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_root_floor(&self, nth: u32) -> Result<Self::Out> { ... }
fn int_modulo(self, modulus: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_modulo(&self, modulus: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_modulo_cycles(
self,
modulus: Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>
where Self: Sized { ... }
fn int_ref_modulo_cycles(
&self,
modulus: &Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>
where Self: Sized { ... }
fn int_modulo_add(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_modulo_add(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<Self::Out> { ... }
fn int_modulo_add_cycles(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>
where Self: Sized { ... }
fn int_ref_modulo_add_cycles(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>
where Self: Sized { ... }
fn int_modulo_add_inv(self, modulus: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_modulo_add_inv(&self, modulus: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_modulo_sub(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_modulo_sub(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<Self::Out> { ... }
fn int_modulo_sub_cycles(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>
where Self: Sized { ... }
fn int_ref_modulo_sub_cycles(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>
where Self: Sized { ... }
fn int_modulo_mul(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_modulo_mul(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<Self::Out> { ... }
fn int_modulo_mul_cycles(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>
where Self: Sized { ... }
fn int_ref_modulo_mul_cycles(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>
where Self: Sized { ... }
fn int_modulo_mul_inv(self, modulus: Self::Rhs) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_modulo_mul_inv(&self, modulus: &Self::Rhs) -> Result<Self::Out> { ... }
fn int_modulo_div(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<Self::Out>
where Self: Sized { ... }
fn int_ref_modulo_div(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<Self::Out> { ... }
}int only.Expand description
⅀ Common trait for integer types.
See also NumRefInt which is automatically implemented for NumInt references.
§Notes
- We use
nto refer to theselfargument in all method descriptions and formulations. - Every method in this trait returns
NotImplementedby default. - Any concrete implementation must define the operations it wants to support.
- Unsupported operations should ideally return
NotSupported. - This trait only includes checked methods, which return a
Resultto handle errors explicitly. - It aims to provide the same methods across all implementations, returning a result when possible.
- Operations are generally supported if they are valid for some input values.
- Most methods come in two variants, distinguished by their prefixes:
int_*methods take arguments by value.int_ref_*methods take arguments by reference.
§Methods
- base:
digital_root,digital_root_base,digits,digits_sign,digits_base,digits_base_sign. - core:
abs,is_even,is_odd,gcd,gcd_ext,lcm,scale.midpoint. - combinatorics:
factorial,subfactorial,permute,permute_rep,combine,combine_rep. - division:
div_rem,div_ceil,div_floor,div_ties_away,div_ties_towardsdiv_ties_even,div_ties_odd. - factors:
factors,factors_proper,factors_prime,factors_prime_unique,factors_buf,factors_proper_buf,factors_prime_buf,factors_prime_unique_buf. - modulo:
modulo,modulo_cycles,modulo_add,modulo_add_cycles,modulo_add_inv,modulo_sub,modulo_sub_cycles,modulo_mul,modulo_mul_cycles,modulo_mul_inv,modulo_div. - primes:
is_prime,prime_nth,prime_pi,totient. - roots:
is_square,sqrt_ceil,sqrt_floor,sqrt_round,root_ceil,root_floor.
Required Associated Types§
Provided Methods§
Sourcefn int_digital_root(self) -> Result<Self::Out>where
Self: Sized,
fn int_digital_root(self) -> Result<Self::Out>where
Self: Sized,
Returns the digital root in base 10.
§Implementations
See an implementation for primitive integers: Int::digital_root.
Sourcefn int_ref_digital_root(&self) -> Result<Self::Out>
fn int_ref_digital_root(&self) -> Result<Self::Out>
Similar to int_digital_root, but operates on references instead of values.
Sourcefn int_digital_root_base(self, base: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_digital_root_base(self, base: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Returns the digital root in the given base.
§Implementations
See an implementation for primitive integers: Int::digital_root_base.
Sourcefn int_ref_digital_root_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_ref_digital_root_base(&self, base: &Self::Rhs) -> Result<Self::Out>
Similar to int_digital_root_base, but operates on references instead of values.
Sourcefn int_digits(self) -> Result<Self::Out>where
Self: Sized,
fn int_digits(self) -> Result<Self::Out>where
Self: Sized,
Returns the number of digits in base 10.
§Implementations
See an implementation for primitive integers: Int::digits.
Sourcefn int_ref_digits(&self) -> Result<Self::Out>
fn int_ref_digits(&self) -> Result<Self::Out>
Similar to int_digits, but operates on references instead of values.
Sourcefn int_digits_sign(self) -> Result<Self::Out>where
Self: Sized,
fn int_digits_sign(self) -> Result<Self::Out>where
Self: Sized,
Returns the number of digits in base 10 including the negative sign.
§Implementations
See an implementation for primitive integers: Int::digits_sign.
Sourcefn int_ref_digits_sign(&self) -> Result<Self::Out>
fn int_ref_digits_sign(&self) -> Result<Self::Out>
Similar to int_digits_sign, but operates on references instead of values.
Sourcefn int_digits_base(self, base: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_digits_base(self, base: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Returns the number of digits in the given base.
§Implementations
See an implementation for primitive integers: Int::digits_base.
Sourcefn int_ref_digits_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base(&self, base: &Self::Rhs) -> Result<Self::Out>
Similar to int_digits_base, but operates on references instead of values.
Sourcefn int_digits_base_sign(self, base: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_digits_base_sign(self, base: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Returns the number of digits in the given base.
§Implementations
See an implementation for primitive integers: Int::digits_base_sign.
Sourcefn int_ref_digits_base_sign(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base_sign(&self, base: &Self::Rhs) -> Result<Self::Out>
Similar to int_digits_base_sign, but operates on references instead of values.
Sourcefn int_ref_abs(&self) -> Result<Self::Out>
fn int_ref_abs(&self) -> Result<Self::Out>
Similar to int_abs, but operates on references instead of values.
Sourcefn int_is_even(self) -> Result<bool>where
Self: Sized,
fn int_is_even(self) -> Result<bool>where
Self: Sized,
Returns true if self is even.
§Implementations
See an implementation for primitive integers: Int::is_even.
Sourcefn int_ref_is_even(&self) -> Result<bool>
fn int_ref_is_even(&self) -> Result<bool>
Similar to int_is_even, but operates on references instead of values.
Sourcefn int_is_odd(self) -> Result<bool>where
Self: Sized,
fn int_is_odd(self) -> Result<bool>where
Self: Sized,
Returns true if self is odd.
§Implementations
See an implementation for primitive integers: Int::is_odd.
Sourcefn int_ref_is_odd(&self) -> Result<bool>
fn int_ref_is_odd(&self) -> Result<bool>
Similar to int_is_odd, but operates on references instead of values.
Sourcefn int_ref_gcd(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_ref_gcd(&self, other: &Self::Rhs) -> Result<Self::Out>
Similar to int_gcd, but operates on references instead of values.
Sourcefn int_gcd_ext(
self,
other: Self::Rhs,
) -> Result<GcdReturn<Self::Out, Self::OutI>>where
Self: Sized,
fn int_gcd_ext(
self,
other: Self::Rhs,
) -> Result<GcdReturn<Self::Out, Self::OutI>>where
Self: Sized,
Returns the GCD and the Bézout coeficients.
§Implementations
See an implementation for primitive integers: Int::gcd_ext.
Sourcefn int_ref_gcd_ext(
&self,
other: &Self::Rhs,
) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_ref_gcd_ext( &self, other: &Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
Similar to int_gcd_ext, but operates on references instead of values.
Sourcefn int_ref_lcm(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_ref_lcm(&self, other: &Self::Rhs) -> Result<Self::Out>
Similar to int_lcm, but operates on references instead of values.
Sourcefn int_scale(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_scale(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
Returns a scaled value in [min..=max] to a new range [a..=b].
If the value lies outside of [min..=max] it will result in extrapolation.
§Errors
Can Overflow for extrapolated values that can’t fit the type,
and for overflowing arithmetic operations in the following formula:
§Formulation
$$ \large v^{\prime} = (b - a) \frac{v - min}{max - min} + a $$
§Implementations
See an implementation for primitive integers: Int::scale.
Sourcefn int_ref_scale(
&self,
min: &Self::Rhs,
max: &Self::Rhs,
a: &Self::Rhs,
b: &Self::Rhs,
) -> Result<Self::Out>
fn int_ref_scale( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
Similar to int_scale, but operates on references instead of values.
Sourcefn int_scale_wrap(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_scale_wrap(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
Returns a scaled value between [min..=max] to a new range [a..=b].
If the value lies outside of [min..=max] it will result in extrapolation, and
if the value doesn’t fit in the type it will wrap around its boundaries.
§Panics
Could panic for very large values on some implementations.
§Formulation
$$ \large v^{\prime} = (b - a) \frac{v - min}{max - min} + a $$
§Implementations
See an implementation for primitive integers: Int::scale_wrap.
Sourcefn int_ref_scale_wrap(
&self,
min: &Self::Rhs,
max: &Self::Rhs,
a: &Self::Rhs,
b: &Self::Rhs,
) -> Result<Self::Out>
fn int_ref_scale_wrap( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
Similar to int_scale_wrap, but operates on references instead of values.
Sourcefn int_midpoint(self, other: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_midpoint(self, other: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Returns the midpoint of self and other.
§Implementations
See an implementation for primitive integers: Int::midpoint.
Sourcefn int_ref_midpoint(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_ref_midpoint(&self, other: &Self::Rhs) -> Result<Self::Out>
Similar to int_midpoint, but operates on references instead of values.
Sourcefn int_factorial(self) -> Result<Self::Out>where
Self: Sized,
fn int_factorial(self) -> Result<Self::Out>where
Self: Sized,
Returns the factorial.
Permutations of n items, ordered, where $n = r$.
§Formulation
$$ n! = 1 \cdot 2 \cdot 3 \cdot \ldots \cdot (n-1) \cdot n $$
These are the maximum numbers whose factorials can fit within standard signed integer types:
- 5 for
i8, 7 fori16, 12 fori32, 20 fori64and 33 fori128. - 5 for
u8, 8 foru16, 12 foru32, 20 foru64and 34 foru128.
§Errors
Returns NonNegativeRequired if $n<0$ and Overflow if the result can’t fit the type.
§Implementations
See an implementation for primitive integers: Int::factorial.
Sourcefn int_ref_factorial(&self) -> Result<Self::Out>
fn int_ref_factorial(&self) -> Result<Self::Out>
Similar to int_factorial, but operates on references instead of values.
Sourcefn int_subfactorial(self) -> Result<Self::Out>where
Self: Sized,
fn int_subfactorial(self) -> Result<Self::Out>where
Self: Sized,
Returns the subfactorial, or the number of derangements.
Permutations of n items which no element appears in its original position.
§Formulation
The subfactorial $!n$ is defined recursively as: $$ !n = (n - 1) * (!(n - 1) + !(n - 2)) $$
These are the maximum numbers whose subfactorials can fit within standard signed integer types:
- 5 for
i8, 8 fori16, 12 fori32, 20 fori64and 35 fori128. - 5 for
u8, 8 foru16, 13 foru32, 20 foru64and 35 foru128.
§Errors
Returns NonNegativeRequired if $n<0$,
and Overflow if the result can’t fit the type.
§Links
- The list of subfactorials is available in https://oeis.org/A000166.
§Implementations
See an implementation for primitive integers: Int::subfactorial.
Sourcefn int_ref_subfactorial(&self) -> Result<Self::Out>
fn int_ref_subfactorial(&self) -> Result<Self::Out>
Similar to int_subfactorial, but operates on references instead of values.
Sourcefn int_combine(self, r: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_combine(self, r: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Returns the number of combinations of n items taken r at a time, unordered.
§Formulation
$$ \large C(n+r-1,r) = {n+k-1 \choose r} = \frac{(n+r-1)!}{(n−1)!r!} $$
§Errors
Returns MismatchedSizes if $r > n$ and Overflow if the result cant’t fit the type.
§Implementations
See an implementation for primitive integers: Int::combine.
Sourcefn int_ref_combine(&self, r: &Self::Rhs) -> Result<Self::Out>
fn int_ref_combine(&self, r: &Self::Rhs) -> Result<Self::Out>
Similar to int_combine, but operates on references instead of values.
Sourcefn int_combine_rep(self, r: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_combine_rep(self, r: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Returns the number of permutations of n items taken r at a time with repetitions,
unordered.
Also known as multichoose.
§Formulation
$$ \large C(n+r-1,r) = {n+k-1 \choose r} = \frac{(n+r-1)!}{(n−1)!r!} $$
§Errors
Returns Overflow if the result cant’t fit the type.
§Implementations
See an implementation for primitive integers: Int::combine_rep.
Sourcefn int_ref_combine_rep(&self, r: &Self::Rhs) -> Result<Self::Out>
fn int_ref_combine_rep(&self, r: &Self::Rhs) -> Result<Self::Out>
Similar to int_combine_rep, but operates on references instead of values.
Sourcefn int_permute(self, r: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_permute(self, r: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Returns the number of permutations of n items taken r at a time, ordered.
When $n=r$ or $n=r-1$ the result is the same as calculating the factorial $n!$.
§Formulation
$$ \large P(n,r) = \frac{n!}{(n−r)!} $$
§Errors
Returns MismatchedSizes if $r > n$ and Overflow if the result cant’t fit the type.
§Implementations
See an implementation for primitive integers: Int::permute.
Sourcefn int_ref_permute(&self, r: &Self::Rhs) -> Result<Self::Out>
fn int_ref_permute(&self, r: &Self::Rhs) -> Result<Self::Out>
Similar to int_permute, but operates on references instead of values.
Sourcefn int_permute_rep(self, r: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_permute_rep(self, r: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Returns the number of permutations of nitems takenr` at a time with repetitions,
ordered.
§Formulation
$$ \large P_\text{rep}(n,r) = n_r $$
§Errors
Returns Overflow if the result cant’t fit the type.
§Implementations
See an implementation for primitive integers: Int::permute_rep.
Sourcefn int_ref_permute_rep(&self, r: &Self::Rhs) -> Result<Self::Out>
fn int_ref_permute_rep(&self, r: &Self::Rhs) -> Result<Self::Out>
Similar to int_permute_rep, but operates on references instead of values.
Sourcefn int_div_rem(self, b: Self::Rhs) -> Result<[Self::Out; 2]>where
Self: Sized,
fn int_div_rem(self, b: Self::Rhs) -> Result<[Self::Out; 2]>where
Self: Sized,
Returns the truncated quotient and the remainder.
§Implementations
See an implementation for primitive integers: Int::div_rem.
Sourcefn int_ref_div_rem(&self, b: &Self::Rhs) -> Result<[Self::Out; 2]>
fn int_ref_div_rem(&self, b: &Self::Rhs) -> Result<[Self::Out; 2]>
Similar to int_div_rem, but operates on references instead of values.
Sourcefn int_div_ceil(self, b: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_div_ceil(self, b: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Returns the quotient, rounding the result towards positive infinity.
§Formulation
$$ \large \left\lceil \frac{x}{y} \right\rceil $$
§Implementations
See an implementation for primitive integers: Int::div_ceil.
Sourcefn int_ref_div_ceil(&self, b: &Self::Rhs) -> Result<Self::Out>
fn int_ref_div_ceil(&self, b: &Self::Rhs) -> Result<Self::Out>
Similar to int_div_ceil, but operates on references instead of values.
Sourcefn int_div_floor(self, b: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_div_floor(self, b: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Returns the quotient, rounding the result towards negative infinity.
$$ \large \left\lfloor \frac{x}{y} \right\rfloor $$
§Implementations
See an implementation for primitive integers: Int::div_floor.
Sourcefn int_ref_div_floor(&self, b: &Self::Rhs) -> Result<Self::Out>
fn int_ref_div_floor(&self, b: &Self::Rhs) -> Result<Self::Out>
Similar to int_div_floor, but operates on references instead of values.
Sourcefn int_div_ties_away(self, b: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_div_ties_away(self, b: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Returns the quotient, rounding ties away from zero.
§Implementations
See an implementation for primitive integers: Int::div_ties_away.
Sourcefn int_ref_div_ties_away(&self, b: &Self::Rhs) -> Result<Self::Out>
fn int_ref_div_ties_away(&self, b: &Self::Rhs) -> Result<Self::Out>
Similar to int_div_ties_away, but operates on references instead of values.
Sourcefn int_div_ties_towards(self, b: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_div_ties_towards(self, b: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Returns the quotient, rounding ties towards from zero.
§Implementations
See an implementation for primitive integers: Int::div_ties_towards.
Sourcefn int_ref_div_ties_towards(&self, b: &Self::Rhs) -> Result<Self::Out>
fn int_ref_div_ties_towards(&self, b: &Self::Rhs) -> Result<Self::Out>
Similar to int_div_ties_towards, but operates on references instead of values.
Sourcefn int_div_ties_even(self, b: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_div_ties_even(self, b: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Returns the quotient, rounding ties to the nearest even number.
§Implementations
See an implementation for primitive integers: Int::div_ties_even.
Sourcefn int_ref_div_ties_even(&self, b: &Self::Rhs) -> Result<Self::Out>
fn int_ref_div_ties_even(&self, b: &Self::Rhs) -> Result<Self::Out>
Similar to int_div_ties_even, but operates on references instead of values.
Sourcefn int_div_ties_odd(self, b: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_div_ties_odd(self, b: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Returns the quotient, rounding ties to the nearest odd number.
§Implementations
See an implementation for primitive integers: Int::div_ties_odd.
Sourcefn int_ref_div_ties_odd(&self, b: &Self::Rhs) -> Result<Self::Out>
fn int_ref_div_ties_odd(&self, b: &Self::Rhs) -> Result<Self::Out>
Similar to int_div_ties_odd, but operates on references instead of values.
Sourcefn int_factors(self) -> Result<Vec<Self::Out>>where
Self: Sized,
Available on crate feature alloc only.
fn int_factors(self) -> Result<Vec<Self::Out>>where
Self: Sized,
alloc only.Returns the factors (including 1 and self).
This is the allocating version of int_factors_buf.
§Examples
assert_eq![24_i64.int_factors(), Ok(vec![1, 2, 3, 4, 6, 8, 12, 24])];
assert_eq![(-24_i64).int_factors(), Ok(vec![1, 2, 3, 4, 6, 8, 12, 24])];
assert_eq![0_i64.int_factors(), Ok(vec![])];
assert_eq![1_i64.int_factors(), Ok(vec![1])];
assert_eq![7_i64.int_factors(), Ok(vec![1, 7])];§Implementations
See an implementation for primitive integers: Int::factors.
Sourcefn int_ref_factors(&self) -> Result<Vec<Self::Out>>
Available on crate feature alloc only.
fn int_ref_factors(&self) -> Result<Vec<Self::Out>>
alloc only.Similar to int_factors, but operates on references instead of values.
Sourcefn int_factors_proper(self) -> Result<Vec<Self::Out>>where
Self: Sized,
Available on crate feature alloc only.
fn int_factors_proper(self) -> Result<Vec<Self::Out>>where
Self: Sized,
alloc only.Returns the proper factors.
This is the allocating version of int_factors_proper_buf.
§Examples
assert_eq![24_i64.int_factors_proper(), Ok(vec![2, 3, 4, 6, 8, 12])];
assert_eq![(-24_i64).int_factors_proper(), Ok(vec![2, 3, 4, 6, 8, 12])];
assert_eq![0_i64.int_factors_proper(), Ok(vec![])];
assert_eq![1_i64.int_factors_proper(), Ok(vec![])];
assert_eq![7_i64.int_factors_proper(), Ok(vec![])];§Implementations
See an implementation for primitive integers: Int::factors_proper.
Sourcefn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
Available on crate feature alloc only.
fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
alloc only.Similar to int_factors_proper, but operates on references instead of values.
Sourcefn int_factors_prime(self) -> Result<Vec<Self::Out>>where
Self: Sized,
Available on crate feature alloc only.
fn int_factors_prime(self) -> Result<Vec<Self::Out>>where
Self: Sized,
alloc only.Returns the prime factors.
This is the allocating version of int_factors_prime_buf.
§Examples
assert_eq![24_i64.int_factors_prime(), Ok(vec![2, 2, 2, 3])];
assert_eq![(-24_i64).int_factors_prime(), Ok(vec![2, 2, 2, 3])];
assert_eq![0_i64.int_factors_prime(), Ok(vec![])];
assert_eq![1_i64.int_factors_prime(), Ok(vec![])];
assert_eq![7_i64.int_factors_prime(), Ok(vec![7])];§Implementations
See an implementation for primitive integers: Int::factors_prime.
Sourcefn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
Available on crate feature alloc only.
fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
alloc only.Similar to int_factors_prime, but operates on references instead of values.
Sourcefn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>where
Self: Sized,
Available on crate feature alloc only.
fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>where
Self: Sized,
alloc only.Returns the unique prime factors.
This is the allocating version of
int_factors_prime_unique_buf.
§Examples
assert_eq![24_i64.int_factors_prime_unique(), Ok(vec![2, 3])];§Implementations
See an implementation for primitive integers: Int::factors_prime_unique.
Sourcefn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
Available on crate feature alloc only.
fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
alloc only.Similar to int_factors_prime_unique, but operates on references instead of values.
Sourcefn int_factors_buf(
self,
fbuf: &mut [Self::Out],
upfbuf: &mut [Self::Out],
) -> Result<(usize, usize)>where
Self: Sized,
fn int_factors_buf(
self,
fbuf: &mut [Self::Out],
upfbuf: &mut [Self::Out],
) -> Result<(usize, usize)>where
Self: Sized,
Writes the factors in fbuf, and the unique prime factors in upfbuf.
This is the non-allocating version of int_factors.
Returns a tuple with the number of factors and unique prime factors found.
§Errors
Returns MismatchedSizes if the total number of factors is greater
than the length of any buffer.
§Examples
let (mut fbuf, mut upbuf) = ([0; 20], [0; 20]);
assert_eq![24_i64.int_factors_buf(&mut fbuf, &mut upbuf), Ok((8, 2))];
assert_eq![fbuf[..8], [1, 2, 3, 4, 6, 8, 12, 24]];
assert_eq![upbuf[..2], [2, 3]];§Implementations
See an implementation for primitive integers: Int::factors_buf.
Sourcefn int_ref_factors_buf(
&self,
fbuf: &mut [Self::Out],
upfbuf: &mut [Self::Out],
) -> Result<(usize, usize)>
fn int_ref_factors_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
Similar to int_factors_buf, but operates on references instead of values.
Sourcefn int_factors_proper_buf(
self,
fbuf: &mut [Self],
upfbuf: &mut [Self],
) -> Result<(usize, usize)>where
Self: Sized,
fn int_factors_proper_buf(
self,
fbuf: &mut [Self],
upfbuf: &mut [Self],
) -> Result<(usize, usize)>where
Self: Sized,
Writes the proper factors in fbuf, and the unique prime factors in upfbuf.
This is the non-allocating version of int_factors_proper.
Returns a tuple with the number of factors and unique prime factors found.
§Errors
Returns MismatchedSizes if the total number of factors is greater
than the length of any buffer.
§Examples
let (mut fbuf, mut upbuf) = ([0; 20], [0; 20]);
assert_eq![24_i64.int_factors_proper_buf(&mut fbuf, &mut upbuf), Ok((6, 2))];
assert_eq![fbuf[..6], [2, 3, 4, 6, 8, 12,]];
assert_eq![upbuf[..2], [2, 3]];§Implementations
See an implementation for primitive integers: Int::factors_proper_buf.
Sourcefn int_ref_factors_proper_buf(
&self,
fbuf: &mut [Self::Out],
upfbuf: &mut [Self::Out],
) -> Result<(usize, usize)>
fn int_ref_factors_proper_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
Similar to int_factors_proper_buf, but operates on references instead of values.
Sourcefn int_factors_prime_buf(self, buffer: &mut [Self]) -> Result<usize>where
Self: Sized,
fn int_factors_prime_buf(self, buffer: &mut [Self]) -> Result<usize>where
Self: Sized,
Writes the prime factors in the given buffer.
This is the non-allocating version of int_factors_prime.
Returns the number of factors found.
§Errors
Returns MismatchedSizes if the total number of factors is greater
than the length of the buffer.
§Examples
let mut buf = [0; 5];
assert_eq![24_i64.int_factors_prime_buf(&mut buf), Ok(4)];
assert_eq![buf[..4], [2, 2, 2, 3]];
assert![(24_i64 * 4).int_factors_prime_buf(&mut buf).is_err()];
assert_eq![buf, [2, 2, 2, 2, 2]]; // the 3 didn't fit
assert_eq![0_i64.int_factors_prime_buf(&mut buf), Ok(0)];
assert_eq![1_i64.int_factors_prime_buf(&mut buf), Ok(0)];
assert_eq![7_i64.int_factors_prime_buf(&mut buf), Ok(1)];
assert_eq![buf[..1], [7]];§Implementations
See an implementation for primitive integers: Int::factors_prime_buf.
Sourcefn int_ref_factors_prime_buf(&self, buffer: &mut [Self::Out]) -> Result<usize>
fn int_ref_factors_prime_buf(&self, buffer: &mut [Self::Out]) -> Result<usize>
Similar to int_factors_prime_buf, but operates on references instead of values.
Sourcefn int_factors_prime_unique_buf(self, buffer: &mut [Self]) -> Result<usize>where
Self: Sized,
fn int_factors_prime_unique_buf(self, buffer: &mut [Self]) -> Result<usize>where
Self: Sized,
Writes the prime factors in the given buffer.
This is the non-allocating version of
int_factors_prime_unique.
The buffer must be large enough to hold all the non-unique factors of n.
In that case the function will return the number of unique factors found.
§Errors
Returns MismatchedSizes if the unique number of factors is greater than the
length of the buffer. In that case the buffer will only contain the non-unique
factors that can fit, like int_factors_prime_buf.
§Examples
let mut uniq = [0; 5];
assert_eq![24_i64.int_factors_prime_unique_buf(&mut uniq), Ok(2)];
assert_eq![uniq, [2, 3, 2, 3, 0]];§Implementations
See an implementation for primitive integers: Int::factors_prime_unique_buf.
Sourcefn int_ref_factors_prime_unique_buf(
&self,
buffer: &mut [Self::Out],
) -> Result<usize>
fn int_ref_factors_prime_unique_buf( &self, buffer: &mut [Self::Out], ) -> Result<usize>
Similar to int_factors_prime_unique_buf, but operates on references instead of values.
Sourcefn int_is_prime(self) -> Result<bool>where
Self: Sized,
fn int_is_prime(self) -> Result<bool>where
Self: Sized,
Returns true if n is prime.
§Implementations
See an implementation for primitive integers: Int::is_prime.
Sourcefn int_ref_is_prime(&self) -> Result<bool>
fn int_ref_is_prime(&self) -> Result<bool>
Similar to int_is_prime, but operates on references instead of values.
Sourcefn int_prime_nth(self) -> Result<Self::Out>where
Self: Sized,
fn int_prime_nth(self) -> Result<Self::Out>where
Self: Sized,
Finds the 0-indexed nth prime number.
Note: If nth is negative, this function should treat it as its absolute value.
§Errors
Returns Overflow if the result can’t fit the type.
§Implementations
See an implementation for primitive integers: Int::prime_nth.
Sourcefn int_ref_prime_nth(&self) -> Result<Self::Out>
fn int_ref_prime_nth(&self) -> Result<Self::Out>
Similar to int_prime_nth, but operates on references instead of values.
Sourcefn int_prime_pi(self) -> Result<usize>where
Self: Sized,
fn int_prime_pi(self) -> Result<usize>where
Self: Sized,
Counts the number of primes upto and including n.
$$ \pi(x) $$
§Implementations
See an implementation for primitive integers: Int::prime_pi.
Sourcefn int_ref_prime_pi(&self) -> Result<usize>
fn int_ref_prime_pi(&self) -> Result<usize>
Similar to int_prime_pi, but operates on references instead of values.
Sourcefn int_totient(self) -> Result<Self::Out>where
Self: Sized,
fn int_totient(self) -> Result<Self::Out>where
Self: Sized,
Counts the number of integers $<|n|$ that are relatively prime to n.
Note: If n is negative, this function should treat it as its absolute value.
§Implementations
See an implementation for primitive integers: Int::totient.
Sourcefn int_ref_totient(&self) -> Result<Self::Out>
fn int_ref_totient(&self) -> Result<Self::Out>
Similar to int_totient, but operates on references instead of values.
Sourcefn int_is_square(self) -> Result<bool>where
Self: Sized,
fn int_is_square(self) -> Result<bool>where
Self: Sized,
Returns true if it’s a perfect square.
Returns false otherwise, which includes all possible negative values.
§Errors
Returns NonNegativeRequired if $n<0$ and Overflow if the result can’t fit the type.
§Formulation
$$ \large \text{is\textunderscore square}(a) = \begin{cases} \text{true} & \text{if } \left(\lfloor \sqrt{a} \rfloor\right)^2 = a \cr \text{false} & \text{if } \left(\lfloor \sqrt{a} \rfloor\right)^2 \neq a \end{cases} $$
§Implementations
See an implementation for primitive integers: Int::is_square.
Sourcefn int_ref_is_square(&self) -> Result<bool>
fn int_ref_is_square(&self) -> Result<bool>
Similar to int_is_square, but operates on references instead of values.
Sourcefn int_sqrt_ceil(self) -> Result<Self::Out>where
Self: Sized,
fn int_sqrt_ceil(self) -> Result<Self::Out>where
Self: Sized,
Returns the ceiled integer square root.
§Errors
Returns NonNegativeRequired if self is negative.
§Formulation
$$ \large \begin{align} \notag \left\lceil \sqrt{a} \thinspace\right\rceil = \begin{cases} n & \text{if } n^2 = a \cr n+1 & \text{if } n^2 < a \end{cases} \cr \notag \normalsize\text{where } n = \lfloor \sqrt{a} \rfloor & \end{align} $$
§Implementations
See an implementation for primitive integers: Int::sqrt_ceil.
Sourcefn int_ref_sqrt_ceil(&self) -> Result<Self::Out>
fn int_ref_sqrt_ceil(&self) -> Result<Self::Out>
Similar to int_sqrt_ceil, but operates on references instead of values.
Sourcefn int_sqrt_floor(self) -> Result<Self::Out>where
Self: Sized,
fn int_sqrt_floor(self) -> Result<Self::Out>where
Self: Sized,
Returns the floored integer square root.
§Errors
Returns NonNegativeRequired if self is negative.
§Formulation
§Algorithm
$$ \large \left\lfloor \sqrt{a} \right\rfloor = n_{k} $$
Where $n_{k}$ is the result of a sequence of estimates that starts with an initial $n_{0} = a/2$ which is updated using Heron’s method:
$$ \large n_{i+1} = n_{i} - ( n_{i}^{2} - a) / 2n_{i}, \quad \small\text{for} \quad i = 0, 1, \ldots, k, $$
Where $n_{i}$ is the current estimate, $n_{i+1}$ is the next estimate, $a$ is self, and $k$ is the number of iterations needed to converge to a solution, on the order of the number of bits of self, about $O(\log_2 b)$, which for e.g. 128 bits would be $ ±7 $ iterations.
Hence, the function continues updating the estimate until
reaching $n_{k}$, which provides the largest integer less than
or equal to the square root of a.
§Implementations
See an implementation for primitive integers: Int::sqrt_floor.
Sourcefn int_ref_sqrt_floor(&self) -> Result<Self::Out>
fn int_ref_sqrt_floor(&self) -> Result<Self::Out>
Similar to int_sqrt_floor, but operates on references instead of values.
Sourcefn int_sqrt_round(self) -> Result<Self::Out>where
Self: Sized,
fn int_sqrt_round(self) -> Result<Self::Out>where
Self: Sized,
Returns the rounded integer square root.
§Formulation
§Algorithm
$$ \begin{align} \notag \left\lfloor\sqrt{a} \thinspace\right\rceil = \begin{cases} n & \text{if } a - n^2 < (n+1)^2 - a \cr n+1 & \text{if } a - n^2 \geq (n+1)^2 - a \end{cases} \cr \notag \normalsize\text{where } n = \lfloor \sqrt{a} \rfloor & \end{align} $$
§Implementations
See an implementation for primitive integers: Int::sqrt_round.
Sourcefn int_ref_sqrt_round(&self) -> Result<Self::Out>
fn int_ref_sqrt_round(&self) -> Result<Self::Out>
Similar to int_sqrt_round, but operates on references instead of values.
Sourcefn int_root_ceil(self, nth: u32) -> Result<Self::Out>where
Self: Sized,
fn int_root_ceil(self, nth: u32) -> Result<Self::Out>where
Self: Sized,
Returns the ceiled integer nth root.
$$ \large \left\lceil |a|^{\frac{1}{n}} \right\rceil \cdot \text{sign}(a) = m $$
§Errors
Returns NonZeroRequired if nth is 0, or
NonNegativeRequired if self is negative and nth is even.
§Implementations
See an implementation for primitive integers: Int::root_ceil.
Sourcefn int_ref_root_ceil(&self, nth: u32) -> Result<Self::Out>
fn int_ref_root_ceil(&self, nth: u32) -> Result<Self::Out>
Similar to int_root_ceil, but operates on references instead of values.
Sourcefn int_root_floor(self, nth: u32) -> Result<Self::Out>where
Self: Sized,
fn int_root_floor(self, nth: u32) -> Result<Self::Out>where
Self: Sized,
Returns the floored integer nth root.
$$ \large \left\lfloor |a|^{\frac{1}{n}} \right\rfloor = m \cdot \text{sign}(a) $$
§Errors
Returns NonZeroRequired if nth is 0, or
NonNegativeRequired if self is negative and nth is even.
§Implementations
See an implementation for primitive integers: Int::root_floor.
Sourcefn int_ref_root_floor(&self, nth: u32) -> Result<Self::Out>
fn int_ref_root_floor(&self, nth: u32) -> Result<Self::Out>
Similar to int_root_floor, but operates on references instead of values.
Sourcefn int_modulo(self, modulus: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_modulo(self, modulus: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Computes the non-negative modulo of self over |modulus|.
The result is non-negative and less than the absolute value of modulus,
i.e., in the range $ [0, |\text{modulus}|) $.
§Errors
Returns NonZeroRequired if modulus == 0,
and it could also return Overflow.
§Implementations
See an implementation for primitive integers: Int::modulo.
Sourcefn int_ref_modulo(&self, modulus: &Self::Rhs) -> Result<Self::Out>
fn int_ref_modulo(&self, modulus: &Self::Rhs) -> Result<Self::Out>
Similar to int_modulo, but operates on references instead of values.
Sourcefn int_modulo_cycles(
self,
modulus: Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
fn int_modulo_cycles(
self,
modulus: Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
Computes the non-negative modulo of self over |modulus|,
and the number of cycles it is reduced.
§Errors
Returns NonZeroRequired if modulus == 0,
and it could also return Overflow.
§Implementations
See an implementation for primitive integers: Int::modulo_cycles.
Sourcefn int_ref_modulo_cycles(
&self,
modulus: &Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
fn int_ref_modulo_cycles(
&self,
modulus: &Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
Similar to int_modulo_cycles, but operates on references instead of values.
Sourcefn int_modulo_add(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_modulo_add(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
Computes the modulo of self + other over |modulus|.
§Errors
Returns NonZeroRequired if modulus == 0,
and it could also return Overflow.
§Implementations
See an implementation for primitive integers: Int::modulo_add.
Sourcefn int_ref_modulo_add(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<Self::Out>
fn int_ref_modulo_add( &self, other: &Self::Rhs, modulus: &Self::Rhs, ) -> Result<Self::Out>
Similar to int_modulo_add, but operates on references instead of values.
Sourcefn int_modulo_add_cycles(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
fn int_modulo_add_cycles(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
Computes the modulo of self + other over |modulus|,
and the number of cycles the result is reduced.
§Errors
Returns NonZeroRequired if modulus == 0,
and it could also return Overflow.
§Implementations
See an implementation for primitive integers: Int::modulo_add_cycles.
Sourcefn int_ref_modulo_add_cycles(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
fn int_ref_modulo_add_cycles(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
Similar to int_modulo_add_cycles, but operates on references instead of values.
Sourcefn int_modulo_add_inv(self, modulus: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_modulo_add_inv(self, modulus: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Calculates the modular additive inverse.
The modular additive inverse of self modulo modulus is an integer b such that $ a+b \equiv 0 (\mod m) $.
The modular multiplicative inverse always exists and is simply
modulus - self if self != 0, or 0 otherwise.
§Errors
Returns NonZeroRequired if modulus == 0.
§Implementations
See an implementation for primitive integers: Int::modulo_add_inv.
Sourcefn int_ref_modulo_add_inv(&self, modulus: &Self::Rhs) -> Result<Self::Out>
fn int_ref_modulo_add_inv(&self, modulus: &Self::Rhs) -> Result<Self::Out>
Similar to int_modulo_add_inv, but operates on references instead of values.
Sourcefn int_modulo_sub(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_modulo_sub(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
Computes the modulo of self - other over |modulus|.
§Errors
Returns NonZeroRequired if modulus == 0,
and Overflow if the result would be a negative value.
§Implementations
See an implementation for primitive integers: Int::modulo_sub.
Sourcefn int_ref_modulo_sub(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<Self::Out>
fn int_ref_modulo_sub( &self, other: &Self::Rhs, modulus: &Self::Rhs, ) -> Result<Self::Out>
Similar to int_modulo_sub, but operates on references instead of values.
Sourcefn int_modulo_sub_cycles(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
fn int_modulo_sub_cycles(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
Computes the modulo of self - other over |modulus|,
and the number of cycles the result is reduced.
§Errors
Returns NonZeroRequired if modulus == 0,
and Overflow if the result would be a negative value.
§Implementations
See an implementation for primitive integers: Int::modulo_sub_cycles.
Sourcefn int_ref_modulo_sub_cycles(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
fn int_ref_modulo_sub_cycles(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
Similar to int_modulo_sub_cycles, but operates on references instead of values.
Sourcefn int_modulo_mul(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_modulo_mul(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
Computes the modulo of self + other over |modulus|.
§Errors
Returns NonZeroRequired if modulus == 0,
and it could also return Overflow.
§Implementations
See an implementation for primitive integers: Int::modulo_mul.
Sourcefn int_ref_modulo_mul(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<Self::Out>
fn int_ref_modulo_mul( &self, other: &Self::Rhs, modulus: &Self::Rhs, ) -> Result<Self::Out>
Similar to int_modulo_mul, but operates on references instead of values.
Sourcefn int_modulo_mul_cycles(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
fn int_modulo_mul_cycles(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
Computes the modulo of self + other over |modulus|,
and the number of cycles the result is reduced.
§Errors
Returns NonZeroRequired if modulus == 0,
and it could also return Overflow.
§Implementations
See an implementation for primitive integers: Int::modulo_mul_cycles.
Sourcefn int_ref_modulo_mul_cycles(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
fn int_ref_modulo_mul_cycles(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<ValueQuant<Self::Out, Self::Out>>where
Self: Sized,
Similar to int_modulo_mul_cycles, but operates on references instead of values.
Sourcefn int_modulo_mul_inv(self, modulus: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
fn int_modulo_mul_inv(self, modulus: Self::Rhs) -> Result<Self::Out>where
Self: Sized,
Calculates the modular multiplicative inverse.
The modular multiplicative inverse of a modulo m is an integer b such that $ ab \equiv 1 (\mod m) $.
The modular multiplicative inverse exists only if self and
modulus are coprime, meaning their greatest common divisor is 1.
§Errors
Returns NonZeroRequired if modulus == 0,
NoInverse if there’s no inverse,
and it could also return Overflow.
§Implementations
See an implementation for primitive integers: Int::modulo_mul_inv.
Sourcefn int_ref_modulo_mul_inv(&self, modulus: &Self::Rhs) -> Result<Self::Out>
fn int_ref_modulo_mul_inv(&self, modulus: &Self::Rhs) -> Result<Self::Out>
Similar to int_modulo_mul_inv, but operates on references instead of values.
Sourcefn int_modulo_div(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_modulo_div(
self,
other: Self::Rhs,
modulus: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
Computes self / other over |modulus|.
$a / b \mod m$ is equivalent to $a * b^{-1} \mod m$, where $b^{-1}$ is the modular multiplicative inverse of $b$ modulo $m$.
§Errors
Returns NonZeroRequired if modulus == 0,
NoInverse if there’s no multiplicative inverse of other,
and it could also return Overflow.
§Implementations
See an implementation for primitive integers: Int::modulo_div.
Sourcefn int_ref_modulo_div(
&self,
other: &Self::Rhs,
modulus: &Self::Rhs,
) -> Result<Self::Out>
fn int_ref_modulo_div( &self, other: &Self::Rhs, modulus: &Self::Rhs, ) -> Result<Self::Out>
Similar to int_modulo_div, but operates on references instead of values.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl NumInt for i8
impl NumInt for i8
type OutI = i8
fn int_digital_root(self) -> Result<Self::Out>
fn int_ref_digital_root(&self) -> Result<Self::Out>
fn int_digital_root_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digital_root_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits(self) -> Result<Self::Out>
fn int_ref_digits(&self) -> Result<Self::Out>
fn int_digits_sign(self) -> Result<Self::Out>
fn int_ref_digits_sign(&self) -> Result<Self::Out>
fn int_digits_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits_base_sign(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base_sign(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_abs(self) -> Result<Self::Out>
fn int_ref_abs(&self) -> Result<Self::Out>
fn int_is_even(self) -> Result<bool>
fn int_ref_is_even(&self) -> Result<bool>
fn int_is_odd(self) -> Result<bool>
fn int_ref_is_odd(&self) -> Result<bool>
fn int_gcd(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_gcd(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_lcm(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_lcm(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_scale(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_scale_wrap(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale_wrap( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_factorial(self) -> Result<Self::Out>
fn int_ref_factorial(&self) -> Result<Self::Out>
fn int_subfactorial(self) -> Result<Self::Out>
fn int_ref_subfactorial(&self) -> Result<Self::Out>
fn int_permute(self, r: Self) -> Result<Self::Out>
fn int_ref_permute(&self, r: &Self) -> Result<Self::Out>
fn int_permute_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_permute_rep(&self, r: &Self) -> Result<Self::Out>
fn int_combine(self, r: Self) -> Result<Self::Out>
fn int_ref_combine(&self, r: &Self) -> Result<Self::Out>
fn int_combine_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_combine_rep(&self, r: &Self) -> Result<Self::Out>
fn int_div_rem(self, b: Self::Rhs) -> Result<[Self::Out; 2]>
fn int_div_ceil(self, b: Self) -> Result<Self::Out>
fn int_div_floor(self, b: Self) -> Result<Self::Out>
fn int_div_ties_away(self, b: Self) -> Result<Self::Out>
fn int_div_ties_towards(self, b: Self) -> Result<Self::Out>
fn int_div_ties_even(self, b: Self) -> Result<Self::Out>
fn int_div_ties_odd(self, b: Self) -> Result<Self::Out>
Source§fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
alloc only.fn int_factors_buf( self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_ref_factors_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_proper_buf( self, fbuf: &mut [Self], upfbuf: &mut [Self], ) -> Result<(usize, usize)>
fn int_ref_factors_proper_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_prime_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_buf(&self, buffer: &mut [Self::Out]) -> Result<usize>
fn int_factors_prime_unique_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_unique_buf( &self, buffer: &mut [Self::Out], ) -> Result<usize>
fn int_modulo(self, modulus: Self) -> Result<Self>
fn int_ref_modulo(&self, modulus: &Self) -> Result<Self>
fn int_modulo_add(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_add_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_add_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_add_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_sub(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_sub(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_sub_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_sub_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_mul(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_mul_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_mul_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_is_prime(self) -> Result<bool>
fn int_ref_is_prime(&self) -> Result<bool>
fn int_prime_nth(self) -> Result<Self::Out>
fn int_ref_prime_nth(&self) -> Result<Self::Out>
fn int_prime_pi(self) -> Result<usize>
fn int_ref_prime_pi(&self) -> Result<usize>
fn int_totient(self) -> Result<Self::Out>
fn int_ref_totient(&self) -> Result<Self::Out>
fn int_is_square(self) -> Result<bool>
fn int_ref_is_square(&self) -> Result<bool>
fn int_root_ceil(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_ceil(&self, nth: u32) -> Result<Self::Out>
fn int_root_floor(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_floor(&self, nth: u32) -> Result<Self::Out>
fn int_gcd_ext( self, other: Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_ref_gcd_ext( &self, other: &Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_midpoint(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_midpoint(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_modulo_mul_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_div(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_div(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_sqrt_ceil(self) -> Result<Self::Out>
fn int_ref_sqrt_ceil(&self) -> Result<Self::Out>
fn int_sqrt_floor(self) -> Result<Self::Out>
fn int_ref_sqrt_floor(&self) -> Result<Self::Out>
fn int_sqrt_round(self) -> Result<Self::Out>
fn int_ref_sqrt_round(&self) -> Result<Self::Out>
Source§impl NumInt for i16
impl NumInt for i16
type OutI = i16
fn int_digital_root(self) -> Result<Self::Out>
fn int_ref_digital_root(&self) -> Result<Self::Out>
fn int_digital_root_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digital_root_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits(self) -> Result<Self::Out>
fn int_ref_digits(&self) -> Result<Self::Out>
fn int_digits_sign(self) -> Result<Self::Out>
fn int_ref_digits_sign(&self) -> Result<Self::Out>
fn int_digits_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits_base_sign(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base_sign(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_abs(self) -> Result<Self::Out>
fn int_ref_abs(&self) -> Result<Self::Out>
fn int_is_even(self) -> Result<bool>
fn int_ref_is_even(&self) -> Result<bool>
fn int_is_odd(self) -> Result<bool>
fn int_ref_is_odd(&self) -> Result<bool>
fn int_gcd(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_gcd(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_lcm(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_lcm(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_scale(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_scale_wrap(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale_wrap( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_factorial(self) -> Result<Self::Out>
fn int_ref_factorial(&self) -> Result<Self::Out>
fn int_subfactorial(self) -> Result<Self::Out>
fn int_ref_subfactorial(&self) -> Result<Self::Out>
fn int_permute(self, r: Self) -> Result<Self::Out>
fn int_ref_permute(&self, r: &Self) -> Result<Self::Out>
fn int_permute_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_permute_rep(&self, r: &Self) -> Result<Self::Out>
fn int_combine(self, r: Self) -> Result<Self::Out>
fn int_ref_combine(&self, r: &Self) -> Result<Self::Out>
fn int_combine_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_combine_rep(&self, r: &Self) -> Result<Self::Out>
fn int_div_rem(self, b: Self::Rhs) -> Result<[Self::Out; 2]>
fn int_div_ceil(self, b: Self) -> Result<Self::Out>
fn int_div_floor(self, b: Self) -> Result<Self::Out>
fn int_div_ties_away(self, b: Self) -> Result<Self::Out>
fn int_div_ties_towards(self, b: Self) -> Result<Self::Out>
fn int_div_ties_even(self, b: Self) -> Result<Self::Out>
fn int_div_ties_odd(self, b: Self) -> Result<Self::Out>
Source§fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
alloc only.fn int_factors_buf( self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_ref_factors_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_proper_buf( self, fbuf: &mut [Self], upfbuf: &mut [Self], ) -> Result<(usize, usize)>
fn int_ref_factors_proper_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_prime_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_buf(&self, buffer: &mut [Self::Out]) -> Result<usize>
fn int_factors_prime_unique_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_unique_buf( &self, buffer: &mut [Self::Out], ) -> Result<usize>
fn int_modulo(self, modulus: Self) -> Result<Self>
fn int_ref_modulo(&self, modulus: &Self) -> Result<Self>
fn int_modulo_add(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_add_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_add_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_add_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_sub(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_sub(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_sub_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_sub_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_mul(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_mul_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_mul_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_is_prime(self) -> Result<bool>
fn int_ref_is_prime(&self) -> Result<bool>
fn int_prime_nth(self) -> Result<Self::Out>
fn int_ref_prime_nth(&self) -> Result<Self::Out>
fn int_prime_pi(self) -> Result<usize>
fn int_ref_prime_pi(&self) -> Result<usize>
fn int_totient(self) -> Result<Self::Out>
fn int_ref_totient(&self) -> Result<Self::Out>
fn int_is_square(self) -> Result<bool>
fn int_ref_is_square(&self) -> Result<bool>
fn int_root_ceil(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_ceil(&self, nth: u32) -> Result<Self::Out>
fn int_root_floor(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_floor(&self, nth: u32) -> Result<Self::Out>
fn int_gcd_ext( self, other: Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_ref_gcd_ext( &self, other: &Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_midpoint(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_midpoint(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_modulo_mul_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_div(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_div(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_sqrt_ceil(self) -> Result<Self::Out>
fn int_ref_sqrt_ceil(&self) -> Result<Self::Out>
fn int_sqrt_floor(self) -> Result<Self::Out>
fn int_ref_sqrt_floor(&self) -> Result<Self::Out>
fn int_sqrt_round(self) -> Result<Self::Out>
fn int_ref_sqrt_round(&self) -> Result<Self::Out>
Source§impl NumInt for i32
impl NumInt for i32
type OutI = i32
fn int_digital_root(self) -> Result<Self::Out>
fn int_ref_digital_root(&self) -> Result<Self::Out>
fn int_digital_root_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digital_root_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits(self) -> Result<Self::Out>
fn int_ref_digits(&self) -> Result<Self::Out>
fn int_digits_sign(self) -> Result<Self::Out>
fn int_ref_digits_sign(&self) -> Result<Self::Out>
fn int_digits_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits_base_sign(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base_sign(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_abs(self) -> Result<Self::Out>
fn int_ref_abs(&self) -> Result<Self::Out>
fn int_is_even(self) -> Result<bool>
fn int_ref_is_even(&self) -> Result<bool>
fn int_is_odd(self) -> Result<bool>
fn int_ref_is_odd(&self) -> Result<bool>
fn int_gcd(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_gcd(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_lcm(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_lcm(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_scale(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_scale_wrap(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale_wrap( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_factorial(self) -> Result<Self::Out>
fn int_ref_factorial(&self) -> Result<Self::Out>
fn int_subfactorial(self) -> Result<Self::Out>
fn int_ref_subfactorial(&self) -> Result<Self::Out>
fn int_permute(self, r: Self) -> Result<Self::Out>
fn int_ref_permute(&self, r: &Self) -> Result<Self::Out>
fn int_permute_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_permute_rep(&self, r: &Self) -> Result<Self::Out>
fn int_combine(self, r: Self) -> Result<Self::Out>
fn int_ref_combine(&self, r: &Self) -> Result<Self::Out>
fn int_combine_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_combine_rep(&self, r: &Self) -> Result<Self::Out>
fn int_div_rem(self, b: Self::Rhs) -> Result<[Self::Out; 2]>
fn int_div_ceil(self, b: Self) -> Result<Self::Out>
fn int_div_floor(self, b: Self) -> Result<Self::Out>
fn int_div_ties_away(self, b: Self) -> Result<Self::Out>
fn int_div_ties_towards(self, b: Self) -> Result<Self::Out>
fn int_div_ties_even(self, b: Self) -> Result<Self::Out>
fn int_div_ties_odd(self, b: Self) -> Result<Self::Out>
Source§fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
alloc only.fn int_factors_buf( self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_ref_factors_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_proper_buf( self, fbuf: &mut [Self], upfbuf: &mut [Self], ) -> Result<(usize, usize)>
fn int_ref_factors_proper_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_prime_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_buf(&self, buffer: &mut [Self::Out]) -> Result<usize>
fn int_factors_prime_unique_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_unique_buf( &self, buffer: &mut [Self::Out], ) -> Result<usize>
fn int_modulo(self, modulus: Self) -> Result<Self>
fn int_ref_modulo(&self, modulus: &Self) -> Result<Self>
fn int_modulo_add(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_add_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_add_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_add_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_sub(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_sub(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_sub_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_sub_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_mul(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_mul_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_mul_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_is_prime(self) -> Result<bool>
fn int_ref_is_prime(&self) -> Result<bool>
fn int_prime_nth(self) -> Result<Self::Out>
fn int_ref_prime_nth(&self) -> Result<Self::Out>
fn int_prime_pi(self) -> Result<usize>
fn int_ref_prime_pi(&self) -> Result<usize>
fn int_totient(self) -> Result<Self::Out>
fn int_ref_totient(&self) -> Result<Self::Out>
fn int_is_square(self) -> Result<bool>
fn int_ref_is_square(&self) -> Result<bool>
fn int_root_ceil(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_ceil(&self, nth: u32) -> Result<Self::Out>
fn int_root_floor(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_floor(&self, nth: u32) -> Result<Self::Out>
fn int_gcd_ext( self, other: Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_ref_gcd_ext( &self, other: &Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_midpoint(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_midpoint(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_modulo_mul_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_div(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_div(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_sqrt_ceil(self) -> Result<Self::Out>
fn int_ref_sqrt_ceil(&self) -> Result<Self::Out>
fn int_sqrt_floor(self) -> Result<Self::Out>
fn int_ref_sqrt_floor(&self) -> Result<Self::Out>
fn int_sqrt_round(self) -> Result<Self::Out>
fn int_ref_sqrt_round(&self) -> Result<Self::Out>
Source§impl NumInt for i64
impl NumInt for i64
type OutI = i64
fn int_digital_root(self) -> Result<Self::Out>
fn int_ref_digital_root(&self) -> Result<Self::Out>
fn int_digital_root_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digital_root_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits(self) -> Result<Self::Out>
fn int_ref_digits(&self) -> Result<Self::Out>
fn int_digits_sign(self) -> Result<Self::Out>
fn int_ref_digits_sign(&self) -> Result<Self::Out>
fn int_digits_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits_base_sign(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base_sign(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_abs(self) -> Result<Self::Out>
fn int_ref_abs(&self) -> Result<Self::Out>
fn int_is_even(self) -> Result<bool>
fn int_ref_is_even(&self) -> Result<bool>
fn int_is_odd(self) -> Result<bool>
fn int_ref_is_odd(&self) -> Result<bool>
fn int_gcd(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_gcd(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_lcm(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_lcm(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_scale(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_scale_wrap(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale_wrap( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_factorial(self) -> Result<Self::Out>
fn int_ref_factorial(&self) -> Result<Self::Out>
fn int_subfactorial(self) -> Result<Self::Out>
fn int_ref_subfactorial(&self) -> Result<Self::Out>
fn int_permute(self, r: Self) -> Result<Self::Out>
fn int_ref_permute(&self, r: &Self) -> Result<Self::Out>
fn int_permute_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_permute_rep(&self, r: &Self) -> Result<Self::Out>
fn int_combine(self, r: Self) -> Result<Self::Out>
fn int_ref_combine(&self, r: &Self) -> Result<Self::Out>
fn int_combine_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_combine_rep(&self, r: &Self) -> Result<Self::Out>
fn int_div_rem(self, b: Self::Rhs) -> Result<[Self::Out; 2]>
fn int_div_ceil(self, b: Self) -> Result<Self::Out>
fn int_div_floor(self, b: Self) -> Result<Self::Out>
fn int_div_ties_away(self, b: Self) -> Result<Self::Out>
fn int_div_ties_towards(self, b: Self) -> Result<Self::Out>
fn int_div_ties_even(self, b: Self) -> Result<Self::Out>
fn int_div_ties_odd(self, b: Self) -> Result<Self::Out>
Source§fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
alloc only.fn int_factors_buf( self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_ref_factors_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_proper_buf( self, fbuf: &mut [Self], upfbuf: &mut [Self], ) -> Result<(usize, usize)>
fn int_ref_factors_proper_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_prime_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_buf(&self, buffer: &mut [Self::Out]) -> Result<usize>
fn int_factors_prime_unique_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_unique_buf( &self, buffer: &mut [Self::Out], ) -> Result<usize>
fn int_modulo(self, modulus: Self) -> Result<Self>
fn int_ref_modulo(&self, modulus: &Self) -> Result<Self>
fn int_modulo_add(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_add_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_add_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_add_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_sub(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_sub(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_sub_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_sub_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_mul(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_mul_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_mul_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_is_prime(self) -> Result<bool>
fn int_ref_is_prime(&self) -> Result<bool>
fn int_prime_nth(self) -> Result<Self::Out>
fn int_ref_prime_nth(&self) -> Result<Self::Out>
fn int_prime_pi(self) -> Result<usize>
fn int_ref_prime_pi(&self) -> Result<usize>
fn int_totient(self) -> Result<Self::Out>
fn int_ref_totient(&self) -> Result<Self::Out>
fn int_is_square(self) -> Result<bool>
fn int_ref_is_square(&self) -> Result<bool>
fn int_root_ceil(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_ceil(&self, nth: u32) -> Result<Self::Out>
fn int_root_floor(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_floor(&self, nth: u32) -> Result<Self::Out>
fn int_gcd_ext( self, other: Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_ref_gcd_ext( &self, other: &Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_midpoint(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_midpoint(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_modulo_mul_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_div(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_div(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_sqrt_ceil(self) -> Result<Self::Out>
fn int_ref_sqrt_ceil(&self) -> Result<Self::Out>
fn int_sqrt_floor(self) -> Result<Self::Out>
fn int_ref_sqrt_floor(&self) -> Result<Self::Out>
fn int_sqrt_round(self) -> Result<Self::Out>
fn int_ref_sqrt_round(&self) -> Result<Self::Out>
Source§impl NumInt for i128
impl NumInt for i128
type OutI = i128
fn int_digital_root(self) -> Result<Self::Out>
fn int_ref_digital_root(&self) -> Result<Self::Out>
fn int_digital_root_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digital_root_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits(self) -> Result<Self::Out>
fn int_ref_digits(&self) -> Result<Self::Out>
fn int_digits_sign(self) -> Result<Self::Out>
fn int_ref_digits_sign(&self) -> Result<Self::Out>
fn int_digits_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits_base_sign(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base_sign(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_abs(self) -> Result<Self::Out>
fn int_ref_abs(&self) -> Result<Self::Out>
fn int_is_even(self) -> Result<bool>
fn int_ref_is_even(&self) -> Result<bool>
fn int_is_odd(self) -> Result<bool>
fn int_ref_is_odd(&self) -> Result<bool>
fn int_gcd(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_gcd(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_lcm(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_lcm(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_scale(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_scale_wrap(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale_wrap( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_factorial(self) -> Result<Self::Out>
fn int_ref_factorial(&self) -> Result<Self::Out>
fn int_subfactorial(self) -> Result<Self::Out>
fn int_ref_subfactorial(&self) -> Result<Self::Out>
fn int_permute(self, r: Self) -> Result<Self::Out>
fn int_ref_permute(&self, r: &Self) -> Result<Self::Out>
fn int_permute_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_permute_rep(&self, r: &Self) -> Result<Self::Out>
fn int_combine(self, r: Self) -> Result<Self::Out>
fn int_ref_combine(&self, r: &Self) -> Result<Self::Out>
fn int_combine_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_combine_rep(&self, r: &Self) -> Result<Self::Out>
fn int_div_rem(self, b: Self::Rhs) -> Result<[Self::Out; 2]>
fn int_div_ceil(self, b: Self) -> Result<Self::Out>
fn int_div_floor(self, b: Self) -> Result<Self::Out>
fn int_div_ties_away(self, b: Self) -> Result<Self::Out>
fn int_div_ties_towards(self, b: Self) -> Result<Self::Out>
fn int_div_ties_even(self, b: Self) -> Result<Self::Out>
fn int_div_ties_odd(self, b: Self) -> Result<Self::Out>
Source§fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
alloc only.fn int_factors_buf( self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_ref_factors_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_proper_buf( self, fbuf: &mut [Self], upfbuf: &mut [Self], ) -> Result<(usize, usize)>
fn int_ref_factors_proper_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_prime_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_buf(&self, buffer: &mut [Self::Out]) -> Result<usize>
fn int_factors_prime_unique_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_unique_buf( &self, buffer: &mut [Self::Out], ) -> Result<usize>
fn int_modulo(self, modulus: Self) -> Result<Self>
fn int_ref_modulo(&self, modulus: &Self) -> Result<Self>
fn int_modulo_add(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_add_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_add_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_add_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_sub(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_sub(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_sub_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_sub_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_mul(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_mul_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_mul_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_is_prime(self) -> Result<bool>
fn int_ref_is_prime(&self) -> Result<bool>
fn int_prime_nth(self) -> Result<Self::Out>
fn int_ref_prime_nth(&self) -> Result<Self::Out>
fn int_prime_pi(self) -> Result<usize>
fn int_ref_prime_pi(&self) -> Result<usize>
fn int_totient(self) -> Result<Self::Out>
fn int_ref_totient(&self) -> Result<Self::Out>
fn int_is_square(self) -> Result<bool>
fn int_ref_is_square(&self) -> Result<bool>
fn int_root_ceil(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_ceil(&self, nth: u32) -> Result<Self::Out>
fn int_root_floor(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_floor(&self, nth: u32) -> Result<Self::Out>
fn int_gcd_ext( self, other: Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_ref_gcd_ext( &self, other: &Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_midpoint(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_midpoint(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_modulo_mul_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_div(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_div(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_sqrt_ceil(self) -> Result<Self::Out>
fn int_ref_sqrt_ceil(&self) -> Result<Self::Out>
fn int_sqrt_floor(self) -> Result<Self::Out>
fn int_ref_sqrt_floor(&self) -> Result<Self::Out>
fn int_sqrt_round(self) -> Result<Self::Out>
fn int_ref_sqrt_round(&self) -> Result<Self::Out>
Source§impl NumInt for isize
impl NumInt for isize
type OutI = isize
fn int_digital_root(self) -> Result<Self::Out>
fn int_ref_digital_root(&self) -> Result<Self::Out>
fn int_digital_root_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digital_root_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits(self) -> Result<Self::Out>
fn int_ref_digits(&self) -> Result<Self::Out>
fn int_digits_sign(self) -> Result<Self::Out>
fn int_ref_digits_sign(&self) -> Result<Self::Out>
fn int_digits_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits_base_sign(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base_sign(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_abs(self) -> Result<Self::Out>
fn int_ref_abs(&self) -> Result<Self::Out>
fn int_is_even(self) -> Result<bool>
fn int_ref_is_even(&self) -> Result<bool>
fn int_is_odd(self) -> Result<bool>
fn int_ref_is_odd(&self) -> Result<bool>
fn int_gcd(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_gcd(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_lcm(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_lcm(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_scale(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_scale_wrap(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale_wrap( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_factorial(self) -> Result<Self::Out>
fn int_ref_factorial(&self) -> Result<Self::Out>
fn int_subfactorial(self) -> Result<Self::Out>
fn int_ref_subfactorial(&self) -> Result<Self::Out>
fn int_permute(self, r: Self) -> Result<Self::Out>
fn int_ref_permute(&self, r: &Self) -> Result<Self::Out>
fn int_permute_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_permute_rep(&self, r: &Self) -> Result<Self::Out>
fn int_combine(self, r: Self) -> Result<Self::Out>
fn int_ref_combine(&self, r: &Self) -> Result<Self::Out>
fn int_combine_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_combine_rep(&self, r: &Self) -> Result<Self::Out>
fn int_div_rem(self, b: Self::Rhs) -> Result<[Self::Out; 2]>
fn int_div_ceil(self, b: Self) -> Result<Self::Out>
fn int_div_floor(self, b: Self) -> Result<Self::Out>
fn int_div_ties_away(self, b: Self) -> Result<Self::Out>
fn int_div_ties_towards(self, b: Self) -> Result<Self::Out>
fn int_div_ties_even(self, b: Self) -> Result<Self::Out>
fn int_div_ties_odd(self, b: Self) -> Result<Self::Out>
Source§fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
alloc only.fn int_factors_buf( self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_ref_factors_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_proper_buf( self, fbuf: &mut [Self], upfbuf: &mut [Self], ) -> Result<(usize, usize)>
fn int_ref_factors_proper_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_prime_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_buf(&self, buffer: &mut [Self::Out]) -> Result<usize>
fn int_factors_prime_unique_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_unique_buf( &self, buffer: &mut [Self::Out], ) -> Result<usize>
fn int_modulo(self, modulus: Self) -> Result<Self>
fn int_ref_modulo(&self, modulus: &Self) -> Result<Self>
fn int_modulo_add(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_add_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_add_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_add_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_sub(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_sub(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_sub_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_sub_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_mul(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_mul_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_mul_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_is_prime(self) -> Result<bool>
fn int_ref_is_prime(&self) -> Result<bool>
fn int_prime_nth(self) -> Result<Self::Out>
fn int_ref_prime_nth(&self) -> Result<Self::Out>
fn int_prime_pi(self) -> Result<usize>
fn int_ref_prime_pi(&self) -> Result<usize>
fn int_totient(self) -> Result<Self::Out>
fn int_ref_totient(&self) -> Result<Self::Out>
fn int_is_square(self) -> Result<bool>
fn int_ref_is_square(&self) -> Result<bool>
fn int_root_ceil(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_ceil(&self, nth: u32) -> Result<Self::Out>
fn int_root_floor(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_floor(&self, nth: u32) -> Result<Self::Out>
fn int_gcd_ext( self, other: Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_ref_gcd_ext( &self, other: &Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_midpoint(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_midpoint(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_modulo_mul_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_div(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_div(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_sqrt_ceil(self) -> Result<Self::Out>
fn int_ref_sqrt_ceil(&self) -> Result<Self::Out>
fn int_sqrt_floor(self) -> Result<Self::Out>
fn int_ref_sqrt_floor(&self) -> Result<Self::Out>
fn int_sqrt_round(self) -> Result<Self::Out>
fn int_ref_sqrt_round(&self) -> Result<Self::Out>
Source§impl NumInt for u8
impl NumInt for u8
type OutI = i16
fn int_digital_root(self) -> Result<Self::Out>
fn int_ref_digital_root(&self) -> Result<Self::Out>
fn int_digital_root_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digital_root_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits(self) -> Result<Self::Out>
fn int_ref_digits(&self) -> Result<Self::Out>
fn int_digits_sign(self) -> Result<Self::Out>
fn int_ref_digits_sign(&self) -> Result<Self::Out>
fn int_digits_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits_base_sign(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base_sign(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_abs(self) -> Result<Self::Out>
fn int_ref_abs(&self) -> Result<Self::Out>
fn int_is_even(self) -> Result<bool>
fn int_ref_is_even(&self) -> Result<bool>
fn int_is_odd(self) -> Result<bool>
fn int_ref_is_odd(&self) -> Result<bool>
fn int_gcd(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_gcd(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_lcm(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_lcm(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_scale(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_scale_wrap(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale_wrap( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_factorial(self) -> Result<Self::Out>
fn int_ref_factorial(&self) -> Result<Self::Out>
fn int_subfactorial(self) -> Result<Self::Out>
fn int_ref_subfactorial(&self) -> Result<Self::Out>
fn int_permute(self, r: Self) -> Result<Self::Out>
fn int_ref_permute(&self, r: &Self) -> Result<Self::Out>
fn int_permute_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_permute_rep(&self, r: &Self) -> Result<Self::Out>
fn int_combine(self, r: Self) -> Result<Self::Out>
fn int_ref_combine(&self, r: &Self) -> Result<Self::Out>
fn int_combine_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_combine_rep(&self, r: &Self) -> Result<Self::Out>
fn int_div_rem(self, b: Self::Rhs) -> Result<[Self::Out; 2]>
fn int_div_ceil(self, b: Self) -> Result<Self::Out>
fn int_div_floor(self, b: Self) -> Result<Self::Out>
fn int_div_ties_away(self, b: Self) -> Result<Self::Out>
fn int_div_ties_towards(self, b: Self) -> Result<Self::Out>
fn int_div_ties_even(self, b: Self) -> Result<Self::Out>
fn int_div_ties_odd(self, b: Self) -> Result<Self::Out>
Source§fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
alloc only.fn int_factors_buf( self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_ref_factors_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_proper_buf( self, fbuf: &mut [Self], upfbuf: &mut [Self], ) -> Result<(usize, usize)>
fn int_ref_factors_proper_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_prime_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_buf(&self, buffer: &mut [Self::Out]) -> Result<usize>
fn int_factors_prime_unique_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_unique_buf( &self, buffer: &mut [Self::Out], ) -> Result<usize>
fn int_modulo(self, modulus: Self) -> Result<Self>
fn int_ref_modulo(&self, modulus: &Self) -> Result<Self>
fn int_modulo_add(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_add_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_add_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_add_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_sub(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_sub(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_sub_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_sub_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_mul(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_mul_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_mul_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_is_prime(self) -> Result<bool>
fn int_ref_is_prime(&self) -> Result<bool>
fn int_prime_nth(self) -> Result<Self::Out>
fn int_ref_prime_nth(&self) -> Result<Self::Out>
fn int_prime_pi(self) -> Result<usize>
fn int_ref_prime_pi(&self) -> Result<usize>
fn int_totient(self) -> Result<Self::Out>
fn int_ref_totient(&self) -> Result<Self::Out>
fn int_is_square(self) -> Result<bool>
fn int_ref_is_square(&self) -> Result<bool>
fn int_root_ceil(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_ceil(&self, nth: u32) -> Result<Self::Out>
fn int_root_floor(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_floor(&self, nth: u32) -> Result<Self::Out>
fn int_gcd_ext( self, other: Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_ref_gcd_ext( &self, other: &Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_midpoint(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_midpoint(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_modulo_mul_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_div(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_div(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_sqrt_ceil(self) -> Result<Self::Out>
fn int_ref_sqrt_ceil(&self) -> Result<Self::Out>
fn int_sqrt_floor(self) -> Result<Self::Out>
fn int_ref_sqrt_floor(&self) -> Result<Self::Out>
fn int_sqrt_round(self) -> Result<Self::Out>
fn int_ref_sqrt_round(&self) -> Result<Self::Out>
Source§impl NumInt for u16
impl NumInt for u16
type OutI = i32
fn int_digital_root(self) -> Result<Self::Out>
fn int_ref_digital_root(&self) -> Result<Self::Out>
fn int_digital_root_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digital_root_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits(self) -> Result<Self::Out>
fn int_ref_digits(&self) -> Result<Self::Out>
fn int_digits_sign(self) -> Result<Self::Out>
fn int_ref_digits_sign(&self) -> Result<Self::Out>
fn int_digits_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits_base_sign(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base_sign(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_abs(self) -> Result<Self::Out>
fn int_ref_abs(&self) -> Result<Self::Out>
fn int_is_even(self) -> Result<bool>
fn int_ref_is_even(&self) -> Result<bool>
fn int_is_odd(self) -> Result<bool>
fn int_ref_is_odd(&self) -> Result<bool>
fn int_gcd(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_gcd(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_lcm(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_lcm(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_scale(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_scale_wrap(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale_wrap( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_factorial(self) -> Result<Self::Out>
fn int_ref_factorial(&self) -> Result<Self::Out>
fn int_subfactorial(self) -> Result<Self::Out>
fn int_ref_subfactorial(&self) -> Result<Self::Out>
fn int_permute(self, r: Self) -> Result<Self::Out>
fn int_ref_permute(&self, r: &Self) -> Result<Self::Out>
fn int_permute_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_permute_rep(&self, r: &Self) -> Result<Self::Out>
fn int_combine(self, r: Self) -> Result<Self::Out>
fn int_ref_combine(&self, r: &Self) -> Result<Self::Out>
fn int_combine_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_combine_rep(&self, r: &Self) -> Result<Self::Out>
fn int_div_rem(self, b: Self::Rhs) -> Result<[Self::Out; 2]>
fn int_div_ceil(self, b: Self) -> Result<Self::Out>
fn int_div_floor(self, b: Self) -> Result<Self::Out>
fn int_div_ties_away(self, b: Self) -> Result<Self::Out>
fn int_div_ties_towards(self, b: Self) -> Result<Self::Out>
fn int_div_ties_even(self, b: Self) -> Result<Self::Out>
fn int_div_ties_odd(self, b: Self) -> Result<Self::Out>
Source§fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
alloc only.fn int_factors_buf( self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_ref_factors_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_proper_buf( self, fbuf: &mut [Self], upfbuf: &mut [Self], ) -> Result<(usize, usize)>
fn int_ref_factors_proper_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_prime_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_buf(&self, buffer: &mut [Self::Out]) -> Result<usize>
fn int_factors_prime_unique_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_unique_buf( &self, buffer: &mut [Self::Out], ) -> Result<usize>
fn int_modulo(self, modulus: Self) -> Result<Self>
fn int_ref_modulo(&self, modulus: &Self) -> Result<Self>
fn int_modulo_add(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_add_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_add_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_add_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_sub(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_sub(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_sub_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_sub_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_mul(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_mul_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_mul_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_is_prime(self) -> Result<bool>
fn int_ref_is_prime(&self) -> Result<bool>
fn int_prime_nth(self) -> Result<Self::Out>
fn int_ref_prime_nth(&self) -> Result<Self::Out>
fn int_prime_pi(self) -> Result<usize>
fn int_ref_prime_pi(&self) -> Result<usize>
fn int_totient(self) -> Result<Self::Out>
fn int_ref_totient(&self) -> Result<Self::Out>
fn int_is_square(self) -> Result<bool>
fn int_ref_is_square(&self) -> Result<bool>
fn int_root_ceil(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_ceil(&self, nth: u32) -> Result<Self::Out>
fn int_root_floor(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_floor(&self, nth: u32) -> Result<Self::Out>
fn int_gcd_ext( self, other: Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_ref_gcd_ext( &self, other: &Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_midpoint(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_midpoint(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_modulo_mul_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_div(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_div(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_sqrt_ceil(self) -> Result<Self::Out>
fn int_ref_sqrt_ceil(&self) -> Result<Self::Out>
fn int_sqrt_floor(self) -> Result<Self::Out>
fn int_ref_sqrt_floor(&self) -> Result<Self::Out>
fn int_sqrt_round(self) -> Result<Self::Out>
fn int_ref_sqrt_round(&self) -> Result<Self::Out>
Source§impl NumInt for u32
impl NumInt for u32
type OutI = i64
fn int_digital_root(self) -> Result<Self::Out>
fn int_ref_digital_root(&self) -> Result<Self::Out>
fn int_digital_root_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digital_root_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits(self) -> Result<Self::Out>
fn int_ref_digits(&self) -> Result<Self::Out>
fn int_digits_sign(self) -> Result<Self::Out>
fn int_ref_digits_sign(&self) -> Result<Self::Out>
fn int_digits_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits_base_sign(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base_sign(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_abs(self) -> Result<Self::Out>
fn int_ref_abs(&self) -> Result<Self::Out>
fn int_is_even(self) -> Result<bool>
fn int_ref_is_even(&self) -> Result<bool>
fn int_is_odd(self) -> Result<bool>
fn int_ref_is_odd(&self) -> Result<bool>
fn int_gcd(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_gcd(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_lcm(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_lcm(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_scale(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_scale_wrap(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale_wrap( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_factorial(self) -> Result<Self::Out>
fn int_ref_factorial(&self) -> Result<Self::Out>
fn int_subfactorial(self) -> Result<Self::Out>
fn int_ref_subfactorial(&self) -> Result<Self::Out>
fn int_permute(self, r: Self) -> Result<Self::Out>
fn int_ref_permute(&self, r: &Self) -> Result<Self::Out>
fn int_permute_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_permute_rep(&self, r: &Self) -> Result<Self::Out>
fn int_combine(self, r: Self) -> Result<Self::Out>
fn int_ref_combine(&self, r: &Self) -> Result<Self::Out>
fn int_combine_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_combine_rep(&self, r: &Self) -> Result<Self::Out>
fn int_div_rem(self, b: Self::Rhs) -> Result<[Self::Out; 2]>
fn int_div_ceil(self, b: Self) -> Result<Self::Out>
fn int_div_floor(self, b: Self) -> Result<Self::Out>
fn int_div_ties_away(self, b: Self) -> Result<Self::Out>
fn int_div_ties_towards(self, b: Self) -> Result<Self::Out>
fn int_div_ties_even(self, b: Self) -> Result<Self::Out>
fn int_div_ties_odd(self, b: Self) -> Result<Self::Out>
Source§fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
alloc only.fn int_factors_buf( self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_ref_factors_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_proper_buf( self, fbuf: &mut [Self], upfbuf: &mut [Self], ) -> Result<(usize, usize)>
fn int_ref_factors_proper_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_prime_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_buf(&self, buffer: &mut [Self::Out]) -> Result<usize>
fn int_factors_prime_unique_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_unique_buf( &self, buffer: &mut [Self::Out], ) -> Result<usize>
fn int_modulo(self, modulus: Self) -> Result<Self>
fn int_ref_modulo(&self, modulus: &Self) -> Result<Self>
fn int_modulo_add(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_add_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_add_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_add_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_sub(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_sub(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_sub_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_sub_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_mul(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_mul_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_mul_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_is_prime(self) -> Result<bool>
fn int_ref_is_prime(&self) -> Result<bool>
fn int_prime_nth(self) -> Result<Self::Out>
fn int_ref_prime_nth(&self) -> Result<Self::Out>
fn int_prime_pi(self) -> Result<usize>
fn int_ref_prime_pi(&self) -> Result<usize>
fn int_totient(self) -> Result<Self::Out>
fn int_ref_totient(&self) -> Result<Self::Out>
fn int_is_square(self) -> Result<bool>
fn int_ref_is_square(&self) -> Result<bool>
fn int_root_ceil(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_ceil(&self, nth: u32) -> Result<Self::Out>
fn int_root_floor(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_floor(&self, nth: u32) -> Result<Self::Out>
fn int_gcd_ext( self, other: Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_ref_gcd_ext( &self, other: &Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_midpoint(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_midpoint(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_modulo_mul_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_div(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_div(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_sqrt_ceil(self) -> Result<Self::Out>
fn int_ref_sqrt_ceil(&self) -> Result<Self::Out>
fn int_sqrt_floor(self) -> Result<Self::Out>
fn int_ref_sqrt_floor(&self) -> Result<Self::Out>
fn int_sqrt_round(self) -> Result<Self::Out>
fn int_ref_sqrt_round(&self) -> Result<Self::Out>
Source§impl NumInt for u64
impl NumInt for u64
type OutI = i128
fn int_digital_root(self) -> Result<Self::Out>
fn int_ref_digital_root(&self) -> Result<Self::Out>
fn int_digital_root_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digital_root_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits(self) -> Result<Self::Out>
fn int_ref_digits(&self) -> Result<Self::Out>
fn int_digits_sign(self) -> Result<Self::Out>
fn int_ref_digits_sign(&self) -> Result<Self::Out>
fn int_digits_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits_base_sign(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base_sign(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_abs(self) -> Result<Self::Out>
fn int_ref_abs(&self) -> Result<Self::Out>
fn int_is_even(self) -> Result<bool>
fn int_ref_is_even(&self) -> Result<bool>
fn int_is_odd(self) -> Result<bool>
fn int_ref_is_odd(&self) -> Result<bool>
fn int_gcd(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_gcd(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_lcm(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_lcm(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_scale(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_scale_wrap(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale_wrap( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_factorial(self) -> Result<Self::Out>
fn int_ref_factorial(&self) -> Result<Self::Out>
fn int_subfactorial(self) -> Result<Self::Out>
fn int_ref_subfactorial(&self) -> Result<Self::Out>
fn int_permute(self, r: Self) -> Result<Self::Out>
fn int_ref_permute(&self, r: &Self) -> Result<Self::Out>
fn int_permute_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_permute_rep(&self, r: &Self) -> Result<Self::Out>
fn int_combine(self, r: Self) -> Result<Self::Out>
fn int_ref_combine(&self, r: &Self) -> Result<Self::Out>
fn int_combine_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_combine_rep(&self, r: &Self) -> Result<Self::Out>
fn int_div_rem(self, b: Self::Rhs) -> Result<[Self::Out; 2]>
fn int_div_ceil(self, b: Self) -> Result<Self::Out>
fn int_div_floor(self, b: Self) -> Result<Self::Out>
fn int_div_ties_away(self, b: Self) -> Result<Self::Out>
fn int_div_ties_towards(self, b: Self) -> Result<Self::Out>
fn int_div_ties_even(self, b: Self) -> Result<Self::Out>
fn int_div_ties_odd(self, b: Self) -> Result<Self::Out>
Source§fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
alloc only.fn int_factors_buf( self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_ref_factors_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_proper_buf( self, fbuf: &mut [Self], upfbuf: &mut [Self], ) -> Result<(usize, usize)>
fn int_ref_factors_proper_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_prime_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_buf(&self, buffer: &mut [Self::Out]) -> Result<usize>
fn int_factors_prime_unique_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_unique_buf( &self, buffer: &mut [Self::Out], ) -> Result<usize>
fn int_modulo(self, modulus: Self) -> Result<Self>
fn int_ref_modulo(&self, modulus: &Self) -> Result<Self>
fn int_modulo_add(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_add_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_add_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_add_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_sub(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_sub(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_sub_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_sub_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_mul(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_mul_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_mul_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_is_prime(self) -> Result<bool>
fn int_ref_is_prime(&self) -> Result<bool>
fn int_prime_nth(self) -> Result<Self::Out>
fn int_ref_prime_nth(&self) -> Result<Self::Out>
fn int_prime_pi(self) -> Result<usize>
fn int_ref_prime_pi(&self) -> Result<usize>
fn int_totient(self) -> Result<Self::Out>
fn int_ref_totient(&self) -> Result<Self::Out>
fn int_is_square(self) -> Result<bool>
fn int_ref_is_square(&self) -> Result<bool>
fn int_root_ceil(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_ceil(&self, nth: u32) -> Result<Self::Out>
fn int_root_floor(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_floor(&self, nth: u32) -> Result<Self::Out>
fn int_gcd_ext( self, other: Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_ref_gcd_ext( &self, other: &Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_midpoint(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_midpoint(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_modulo_mul_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_div(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_div(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_sqrt_ceil(self) -> Result<Self::Out>
fn int_ref_sqrt_ceil(&self) -> Result<Self::Out>
fn int_sqrt_floor(self) -> Result<Self::Out>
fn int_ref_sqrt_floor(&self) -> Result<Self::Out>
fn int_sqrt_round(self) -> Result<Self::Out>
fn int_ref_sqrt_round(&self) -> Result<Self::Out>
Source§impl NumInt for u128
impl NumInt for u128
type OutI = i128
fn int_digital_root(self) -> Result<Self::Out>
fn int_ref_digital_root(&self) -> Result<Self::Out>
fn int_digital_root_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digital_root_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits(self) -> Result<Self::Out>
fn int_ref_digits(&self) -> Result<Self::Out>
fn int_digits_sign(self) -> Result<Self::Out>
fn int_ref_digits_sign(&self) -> Result<Self::Out>
fn int_digits_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits_base_sign(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base_sign(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_abs(self) -> Result<Self::Out>
fn int_ref_abs(&self) -> Result<Self::Out>
fn int_is_even(self) -> Result<bool>
fn int_ref_is_even(&self) -> Result<bool>
fn int_is_odd(self) -> Result<bool>
fn int_ref_is_odd(&self) -> Result<bool>
fn int_gcd(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_gcd(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_lcm(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_lcm(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_scale(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_scale_wrap(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale_wrap( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_factorial(self) -> Result<Self::Out>
fn int_ref_factorial(&self) -> Result<Self::Out>
fn int_subfactorial(self) -> Result<Self::Out>
fn int_ref_subfactorial(&self) -> Result<Self::Out>
fn int_permute(self, r: Self) -> Result<Self::Out>
fn int_ref_permute(&self, r: &Self) -> Result<Self::Out>
fn int_permute_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_permute_rep(&self, r: &Self) -> Result<Self::Out>
fn int_combine(self, r: Self) -> Result<Self::Out>
fn int_ref_combine(&self, r: &Self) -> Result<Self::Out>
fn int_combine_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_combine_rep(&self, r: &Self) -> Result<Self::Out>
fn int_div_rem(self, b: Self::Rhs) -> Result<[Self::Out; 2]>
fn int_div_ceil(self, b: Self) -> Result<Self::Out>
fn int_div_floor(self, b: Self) -> Result<Self::Out>
fn int_div_ties_away(self, b: Self) -> Result<Self::Out>
fn int_div_ties_towards(self, b: Self) -> Result<Self::Out>
fn int_div_ties_even(self, b: Self) -> Result<Self::Out>
fn int_div_ties_odd(self, b: Self) -> Result<Self::Out>
Source§fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
alloc only.fn int_factors_buf( self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_ref_factors_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_proper_buf( self, fbuf: &mut [Self], upfbuf: &mut [Self], ) -> Result<(usize, usize)>
fn int_ref_factors_proper_buf( &self, fbuf: &mut [Self::Out], upfbuf: &mut [Self::Out], ) -> Result<(usize, usize)>
fn int_factors_prime_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_buf(&self, buffer: &mut [Self::Out]) -> Result<usize>
fn int_factors_prime_unique_buf(self, buffer: &mut [Self]) -> Result<usize>
fn int_ref_factors_prime_unique_buf( &self, buffer: &mut [Self::Out], ) -> Result<usize>
fn int_modulo(self, modulus: Self) -> Result<Self>
fn int_ref_modulo(&self, modulus: &Self) -> Result<Self>
fn int_modulo_add(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_add_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_add_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_add_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_add_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_sub(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_sub(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_sub_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_sub_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_modulo_mul(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_modulo_mul_cycles( self, other: Self, modulus: Self, ) -> Result<ValueQuant<Self, Self>>
fn int_ref_modulo_mul_cycles( &self, other: &Self, modulus: &Self, ) -> Result<ValueQuant<Self, Self>>
fn int_is_prime(self) -> Result<bool>
fn int_ref_is_prime(&self) -> Result<bool>
fn int_prime_nth(self) -> Result<Self::Out>
fn int_ref_prime_nth(&self) -> Result<Self::Out>
fn int_prime_pi(self) -> Result<usize>
fn int_ref_prime_pi(&self) -> Result<usize>
fn int_totient(self) -> Result<Self::Out>
fn int_ref_totient(&self) -> Result<Self::Out>
fn int_is_square(self) -> Result<bool>
fn int_ref_is_square(&self) -> Result<bool>
fn int_root_ceil(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_ceil(&self, nth: u32) -> Result<Self::Out>
fn int_root_floor(self, nth: u32) -> Result<Self::Out>
fn int_ref_root_floor(&self, nth: u32) -> Result<Self::Out>
fn int_gcd_ext( self, other: Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_ref_gcd_ext( &self, other: &Self::Rhs, ) -> Result<GcdReturn<Self::Out, Self::OutI>>
fn int_midpoint(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_midpoint(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_modulo_mul_inv(self, modulus: Self) -> Result<Self>
fn int_ref_modulo_mul_inv(&self, modulus: &Self) -> Result<Self>
fn int_modulo_div(self, other: Self, modulus: Self) -> Result<Self>
fn int_ref_modulo_div(&self, other: &Self, modulus: &Self) -> Result<Self>
fn int_sqrt_ceil(self) -> Result<Self::Out>
fn int_ref_sqrt_ceil(&self) -> Result<Self::Out>
fn int_sqrt_floor(self) -> Result<Self::Out>
fn int_ref_sqrt_floor(&self) -> Result<Self::Out>
fn int_sqrt_round(self) -> Result<Self::Out>
fn int_ref_sqrt_round(&self) -> Result<Self::Out>
Source§impl NumInt for usize
impl NumInt for usize
type OutI = i128
fn int_digital_root(self) -> Result<Self::Out>
fn int_ref_digital_root(&self) -> Result<Self::Out>
fn int_digital_root_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digital_root_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits(self) -> Result<Self::Out>
fn int_ref_digits(&self) -> Result<Self::Out>
fn int_digits_sign(self) -> Result<Self::Out>
fn int_ref_digits_sign(&self) -> Result<Self::Out>
fn int_digits_base(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_digits_base_sign(self, base: Self::Rhs) -> Result<Self::Out>
fn int_ref_digits_base_sign(&self, base: &Self::Rhs) -> Result<Self::Out>
fn int_abs(self) -> Result<Self::Out>
fn int_ref_abs(&self) -> Result<Self::Out>
fn int_is_even(self) -> Result<bool>
fn int_ref_is_even(&self) -> Result<bool>
fn int_is_odd(self) -> Result<bool>
fn int_ref_is_odd(&self) -> Result<bool>
fn int_gcd(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_gcd(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_lcm(self, other: Self::Rhs) -> Result<Self::Out>
fn int_ref_lcm(&self, other: &Self::Rhs) -> Result<Self::Out>
fn int_scale(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_scale_wrap(
self,
min: Self::Rhs,
max: Self::Rhs,
a: Self::Rhs,
b: Self::Rhs,
) -> Result<Self::Out>where
Self: Sized,
fn int_ref_scale_wrap( &self, min: &Self::Rhs, max: &Self::Rhs, a: &Self::Rhs, b: &Self::Rhs, ) -> Result<Self::Out>
fn int_factorial(self) -> Result<Self::Out>
fn int_ref_factorial(&self) -> Result<Self::Out>
fn int_subfactorial(self) -> Result<Self::Out>
fn int_ref_subfactorial(&self) -> Result<Self::Out>
fn int_permute(self, r: Self) -> Result<Self::Out>
fn int_ref_permute(&self, r: &Self) -> Result<Self::Out>
fn int_permute_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_permute_rep(&self, r: &Self) -> Result<Self::Out>
fn int_combine(self, r: Self) -> Result<Self::Out>
fn int_ref_combine(&self, r: &Self) -> Result<Self::Out>
fn int_combine_rep(self, r: Self) -> Result<Self::Out>
fn int_ref_combine_rep(&self, r: &Self) -> Result<Self::Out>
fn int_div_rem(self, b: Self::Rhs) -> Result<[Self::Out; 2]>
fn int_div_ceil(self, b: Self) -> Result<Self::Out>
fn int_div_floor(self, b: Self) -> Result<Self::Out>
fn int_div_ties_away(self, b: Self) -> Result<Self::Out>
fn int_div_ties_towards(self, b: Self) -> Result<Self::Out>
fn int_div_ties_even(self, b: Self) -> Result<Self::Out>
fn int_div_ties_odd(self, b: Self) -> Result<Self::Out>
Source§fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_proper(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime(&self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
fn int_factors_prime_unique(self) -> Result<Vec<Self::Out>>
alloc only.Source§fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
fn int_ref_factors_prime_unique(&self) -> Result<Vec<Self::Out>>
alloc only.