Module malachite_nz::natural::arithmetic
source · Expand description
Traits for arithmetic.
Modules§
- Addition of
Natural
s. - Implementations of
AddMul
andAddMulAssign
, traits for adding a number and the product of two other numbers. - Implementations of
BinomialCoefficient
, a trait for computing the binomial coefficient of two numbers. - Implementations of
CheckedSub
, a trait for subtracting two numbers and checking whether the result is representable. - Implementations of
CheckedSubMul
, a trait for subtracting the product of two numbers from another number, and checking whether the result is representable. - Implementations of
CoprimeWith
, a trait for determining whether two numbers are coprime. - Division of
Natural
s. - Implementations of
DivExact
andDivExactAssign
, 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
andDivExactAssign
, traits for dividing two numbers according to a specifiedRoundingMode
. - 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
IsPowerOf2
, a trait for determining whether a number is an integer power of 2. - Implementations of
LegendreSymbol
,JacobiSymbol
, andKroneckerSymbol
, traits for computing the Legendre, Jacobi, and Kronecker symbols of two numbers. - Implementations of
Lcm
,LcmAssign
, andCheckedLcm
, traits for computing the LCM (least common multiple) of two numbers. - Implementations of traits for taking the base-$b$ logarithm of a number.
- Implementations of traits for taking the base-2 logarithm of a number.
- Implementations of traits for taking the base-$2^k$ logarithm of a number.
- Implementations of
ModAdd
andModAddAssign
, traits for adding two numbers modulo another number. - Implementations of
ModInverse
, a trait for finding the multiplicative inverse of a number modulo another number. - Implementations of
ModIsReduced
, a trait for checking whether a number is reduced modulo another number. - Implementations of traits for multiplying two numbers modulo another number.
- Implementations of
ModNeg
andModNegAssign
, traits for negating a number modulo another number. - Implementations of traits for finding the remainder of two numbers, subject to various rounding rules.
- Implementations of traits for raising a number to a power modulo another number.
- Implementations of traits for finding the remainder of a number divided by $2^k$, subject to various rounding rules.
- Implementations of
ModPowerOf2Add
andModPowerOf2AddAssign
, traits for adding two numbers modulo $2^k$. - Implementations of
ModPowerOf2Inverse
, a trait for finding the multiplicative inverse of a number modulo $2^k$. - Implementations of
ModPowerOf2IsReduced
, a trait for checking whether a number is reduced modulo $2^k$. - Implementations of
ModPowerOf2Mul
andModPowerOf2MulAssign
, traits for multiplying two numbers modulo $2^k$. - Implementations of
ModPowerOf2Neg
andModPowerOf2NegAssign
, traits for negating a number modulo $2^k$. - Implementations of
ModPowerOf2Pow
andModPowerOf2PowAssign
, traits for raising a number to a power modulo $2^k$. - Implementations of
ModPowerOf2Shl
andModPowerOf2ShlAssign
, traits for left-shifting a number modulo $2^k$. - Implementations of
ModPowerOf2Shr
andModPowerOf2ShrAssign
, traits for right-shifting a number modulo $2^k$. - Implementations of
ModPowerOf2Square
](malachite_base::num::arithmetic::traits::ModPowerOf2Square) andModPowerOf2SquareAssign
, traits for squaring a number modulo $2^k$. - Implementations of
ModPowerOf2Sub
andModPowerOf2SubAssign
, traits for subtracting one number by another modulo $2^k$. - Implementations of
ModShl
andModShlAssign
, traits for left-shifting a number modulo another number. - Implementations of
ModShr
andModShrAssign
, traits for right-shifting a number modulo another number. - Implementations of traits for squaring a number modulo another number.
- Implementations of
ModSub
andModSubAssign
, traits for subtracting two numbers modulo another number. - Multiplication of
Natural
s. - Implementations of
NextPowerOf2
andNextPowerOf2Assign
, traits for getting the next-highest power of 2. - Implementations of
Parity
, a trait for determining whether a number is even or odd. - Implementations of
PowerOf2
, a trait for computing a power of 2. - An implementation of
Primorial
, a trait for computing the primorial of a number. - Implementations of traits for taking the $n$th root of a number.
- Implementations of
RoundToMultiple
andRoundToMultipleAssign
, traits for rounding a number to a multiple of another number. - Implementations of
RoundToMultipleOfPowerOf2
andRoundToMultipleOfPowerOf2Assign
, traits for rounding a number to a multiple of a power of 2. - Implementations of
SaturatingSub
andSaturatingSubAssign
, traits for subtracting two numbers and saturating at numeric bounds instead of overflowing. - Implementations of
SaturatingSubMul
andSaturatingSubMulAssign
, traits for subtracting a number by the product of two numbers and saturating at numeric bounds instead of overflowing. - Left-shifting a
Natural
(multiplying it by a power of 2). - Implementations of
ShlRound
andShlRoundAssign
, traits for multiplying a number by a power of 2 and rounding according to a specifiedRoundingMode
. - Right-shifting a
Natural
(dividing it by a power of 2). - Implementations of
ShrRound
andShrRoundAssign
, traits for dividing a number by a power of 2 and rounding according to a specifiedRoundingMode
. - 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
andSquareAssign
, traits for squaring a number. - Subtraction of
Natural
s. - Implementations of
SubMul
andSubMulAssign
, traits for subtracting the product of two numbers from a number.