Expand description
Integer trait and functions.
§Compatibility
The num-integer
crate is tested for rustc 1.31 and greater.
Structs§
- Extended
Gcd - Greatest common divisor and Bézout coefficients
- Iter
Binomial - An iterator over binomial coefficients.
Traits§
- Average
- Provides methods to compute the average of two integers, without overflows.
- Integer
- Roots
- Provides methods to compute an integer’s square root, cube root,
and arbitrary
n
th root.
Functions§
- average_
ceil - Returns the ceiling value of the average of
x
andy
– see Average::average_ceil. - average_
floor - Returns the floor value of the average of
x
andy
– see Average::average_floor. - binomial
- Calculate the binomial coefficient.
- cbrt
- Returns the truncated principal cube root of an integer – see Roots::cbrt.
- div_
ceil - Ceiled integer division
- div_
floor - Floored integer division
- div_
mod_ floor - Simultaneous floored integer division and modulus
- div_rem
- Simultaneous integer division and modulus
- gcd
- Calculates the Greatest Common Divisor (GCD) of the number and
other
. The result is always non-negative. - gcd_lcm
- Calculates the Greatest Common Divisor (GCD) and
Lowest Common Multiple (LCM) of the number and
other
. - lcm
- Calculates the Lowest Common Multiple (LCM) of the number and
other
. - mod_
floor - Floored integer modulus
- multinomial
- Calculate the multinomial coefficient.
- nth_
root - Returns the truncated principal
n
th root of an integer – see Roots::nth_root. - sqrt
- Returns the truncated principal square root of an integer – see Roots::sqrt.