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.
cbrt
Cube root of Floats and of Rationals.
div
Division of Floats, of Floats by Rationals, and of Rationals by Floats.
exp
Exp and ExpAssign, traits for computing $e^x$ for Floats.
exp_x_minus_1
ExpXMinus1 and ExpXMinus1Assign, traits for computing $e^x-1$ for 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.
pow
Implementations of PowerOf2, a trait for computing a power of 2.
power_of_2
power_of_2_of_float
power_of_2_x_minus_1
Implementations of PowerOf2XMinus1 and PowerOf2XMinus1Assign, traits for computing $2^x-1$.
power_of_10
An implementation of PowerOf2 with a Float exponent, computing $2^x$ for Floats.
power_of_10_x_minus_1
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.
root
root_u_prec_round and related functions, for computing roots 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.