Expand description

Integer trait and functions.

Compatibility

The num-integer crate is tested for rustc 1.8 and greater.

Structs

Greatest common divisor and Bézout coefficients

An iterator over binomial coefficients.

Traits

Provides methods to compute the average of two integers, without overflows.

Provides methods to compute an integer’s square root, cube root, and arbitrary nth root.

Functions

Returns the ceiling value of the average of x and y – see Average::average_ceil.

Returns the floor value of the average of x and y – see Average::average_floor.

Calculate the binomial coefficient.

Returns the truncated principal cube root of an integer – see Roots::cbrt.

Ceiled integer division

Floored integer division

Simultaneous floored integer division and modulus

Simultaneous integer division and modulus

Calculates the Greatest Common Divisor (GCD) of the number and other. The result is always positive.

Calculates the Greatest Common Divisor (GCD) and Lowest Common Multiple (LCM) of the number and other.

Calculates the Lowest Common Multiple (LCM) of the number and other.

Floored integer modulus

Calculate the multinomial coefficient.

Returns the truncated principal nth root of an integer – see Roots::nth_root.

Returns the truncated principal square root of an integer – see Roots::sqrt.