Expand description

Traits for arithmetic.

Modules

Absolute value of Integers, including implementations of UnsignedAbs.

Addition of Integers.

Implementations of AddMul and AddMulAssign, traits for adding a number and the product of two other numbers.

Division of Integers.

Implementations of DivExact and DivExactAssign, traits for dividing two numbers when it’s known that the division is exact.

Implementations of raits for simultaneously finding the quotient and remainder of two numbers, subject to various rounding rules.

Implementations of DivRound and DivExactAssign, traits for dividing two numbers according to a specified RoundingMode.

Implementations of DivisibleBy, a trait for determining whether one number is divisible by another.

Implementations of DivisibleByPowerOf2, a trait for determining whether a number is divisible by $2^k$.

Implementations of EqMod, a trait for determining whether one number is equal by another modulo a third.

Implementations of EqModPowerOf2, a trait for determining whether one number is equal to another modulo $2^k$.

Implementations of ExtendedGcd, a trait for computing the extended GCD of two numbers.

Implementations of LegendreSymbol, JacobiSymbol, and KroneckerSymbol, traits for computing the Legendre, Jacobi, and Kronecker symbols of two numbers.

Implementations of traits for finding the remainder of two numbers, subject to various rounding rules.

Implementations of traits for finding the remainder of a number divided by $2^k$, subject to various rounding rules.

Multiplication of Integers.

Negation of an Integer.

Implementations of Parity, a trait for determining whether a number is even or odd.

Implementations of Pow and PowAssign, traits for raising a number to a power.

Implementations of PowerOf2, a trait for computing a power of 2.

Implementations of traits for taking the $n$th root of a number.

Implementations of RoundToMultiple and RoundToMultipleAssign, traits for rounding a number to a multiple of another number.

Implementations of RoundToMultipleOfPowerOf2 and RoundToMultipleOfPowerOf2Assign, traits for rounding a number to a multiple of a power of 2.

Left-shifting an Integer (multiplying it by a power of 2).

Implementations of ShlRound and ShlRoundAssign, traits for multiplying a number by a power of 2 and rounding according to a specified RoundingMode.

Right-shifting an Integer (dividing it by a power of 2).

Implementations of ShrRound and ShrRoundAssign, traits for dividing a number by a power of 2 and rounding according to a specified RoundingMode.

Implementations of Sign, a trait for determining the sign of a number.

Implementations of traits for taking the square root of a number.

Implementations of Square and SquareAssign, traits for squaring a number.

Subtraction of Integers.

Implementations of SubMul and SubMulAssign, traits for subtracting the product of two numbers from a number.