Skip to main content

Module arithmetic

Module arithmetic 

Source
Expand description

Traits for arithmetic.

Modulesยง

abs
Absolute value of Floats.
add
Addition of Floats, and of Floats with Rationals.
agm
Taking the AGM (arithmetic-geometric mean) of two Floats, and of Floats with Rationals.
div
Division of Floats, of Floats by Rationals, and of Rationals by Floats.
is_power_of_2
An implementation of IsPowerOf2, a trait for determining whether a number is an integer power of 2.
ln
Ln and LnAssign, traits for computing the natural logarithm of Floats.
ln_1_plus_x
Ln1PlusX and Ln1PlusXAssign, traits for computing $\ln(1+x)$ for Floats.
log_base
LogBase and LogBaseAssign, traits for computing the base-$b$ logarithm of Floats for an arbitrary integer base $b>1$.
log_base_2
LogBase2 and LogBase2Assign, traits for computing the base-2 logarithm of Floats.
log_base_1_plus_x
LogBaseOf1PlusX and LogBaseOf1PlusXAssign, traits for computing $\log_b(1+x)$ of Floats for an arbitrary integer base $b>1$.
log_base_2_1_plus_x
LogBase2Of1PlusX and LogBase2Of1PlusXAssign, traits for computing $\log_2(1+x)$ for Floats.
log_base_10
LogBase10 and LogBase10Assign, traits for computing the base-10 logarithm of Floats.
log_base_10_1_plus_x
LogBase10Of1PlusX and LogBase10Of1PlusXAssign, traits for computing $\log_{10}(1+x)$ of Floats.
log_base_float_base
LogBase and LogBaseAssign, implemented for a Float base, for computing $\log_b x$ of a Float with an arbitrary Float base.
log_base_float_base_1_plus_x
LogBaseOf1PlusX and LogBaseOf1PlusXAssign, implemented for a Float base, for computing $\log_b(1+x)$ of a Float with an arbitrary Float base.
log_base_power_of_2
LogBasePowerOf2 and LogBasePowerOf2Assign, traits for computing $\log_{2^k} x$ for Floats.
log_base_power_of_2_1_plus_x
LogBasePowerOf2Of1PlusX and LogBasePowerOf2Of1PlusXAssign, traits for computing $\log_{2^k}(1+x)$ for Floats.
log_base_rational_base
LogBase and LogBaseAssign, implemented for a Rational base, for computing $\log_b x$ of a Float with an arbitrary rational base $b>1$.
log_base_rational_base_1_plus_x
LogBaseOf1PlusX and LogBaseOf1PlusXAssign, implemented for a Rational base, for computing $\log_b(1+x)$ of a Float with an arbitrary rational base $b>1$.
log_base_rational_float_base
Functions for computing $\log_b x$ of a Rational $x$ with an arbitrary Float base, returning a Float.
log_base_rational_rational_base
Functions for computing $\log_b x$ of a Rational $x$ with an arbitrary Rational base $b>1$, returning a Float.
mul
Multiplication of Floats, and of Floats with Rationals.
neg
Negation of Floats.
power_of_2
Implementations of PowerOf2, a trait for computing a power of 2.
reciprocal
Implementations of Reciprocal and ReciprocalAssign, traits for computing the reciprocal of a number.
reciprocal_sqrt
ReciprocalSqrt and ReciprocalSqrtAssign, traits for computing the reciprocal of the square root of Floats.
shl
Left-shifting a Float (multiplying it by a power of 2).
shl_round
Implementations of ShlRound and ShlRoundAssign, traits for multiplying a number by a power of 2 and rounding according to a specified RoundingMode. For Floats, rounding is only necessary in the cases of overflow and underflow.
shr
Right-shifting a Float (dividing it by a power of 2).
shr_round
Implementations of ShlRound and ShrRoundAssign, traits for dividing a number by a power of 2 and rounding according to a specified RoundingMode. For Floats, rounding is only necessary in the cases of overflow and underflow.
sign
An implementation of Sign, a trait for determining the sign of a number.
sqrt
Sqrt and SqrtAssign, traits for computing the square root of Floats.
square
Squaring of Floats.
sub
Subtraction of Floats, of Floats by Rationals, and of Rationals by Floats.