Expand description
Traits for arithmetic.
Modules§
- abs
- Absolute value of
Floats. - abs_
squared - Implementations of
AbsSquaredandAbsSquaredAssign, traits for computing the squared absolute value of a number. For real types this is the same as squaring. - acos
- Implementations of
AcosandAcosAssign, traits for computing the arccosine ofFloats. - acot
- acsc
- add
- Addition of
Floats, and ofFloats withRationals. - add_mul
AddMulandAddMulAssign, traits for adding aFloatand the product of two otherFloats — or of aFloatand aRational— with a single rounding (fused multiply-add), and the associated precision- and rounding-mode-aware functions.- agm
- Taking the AGM (arithmetic-geometric mean) of two
Floats, and ofFloats withRationals. - asec
- Implementations of
AsecandAsecAssign, traits for computing the arcsecant ofFloats. - asin
- Implementations of
AsinandAsinAssign, traits for computing the arcsine ofFloats. - atan
- Implementations of
AtanandAtanAssign, traits for computing the arctangent ofFloats. - atan2
- Implementations of
Atan2andAtan2Assign, traits for computing the angle of a point given by twoFloatcoordinates. - average
AverageandAverageAssign, traits for computing the average (arithmetic mean) of two numbers, and the associated precision- and rounding-mode-aware functions.- canonical_
unit_ i_ pow - An implementation of
CanonicalUnitIPow, a trait for finding the power of $i$ that brings a number into canonical unit form. - canonicalize_
unit - Implementations of
CanonicalizeUnitandCanonicalizeUnitAssign, traits for bringing a number into canonical unit form. - cbrt
- Cube root of
Floats and ofRationals. - compound
CompoundandCompoundAssign, traits for computing the compound function $(1+x)^n$ forFloats.- conjugate
- Implementations of
ConjugateandConjugateAssign, traits for computing the complex conjugate of a number. A real number is its own conjugate. - cos
- Implementations of
CosandCosAssign, traits for computing the cosine ofFloats. - cot
- Implementations of
CotandCotAssign, traits for computing the cotangent ofFloats. - csc
- Implementations of
CscandCscAssign, traits for computing the cosecant ofFloats. - div
- Division of
Floats, ofFloats byRationals, and ofRationals byFloats. - dot
- Correctly-rounded dot products of
Floatslices, with the products computed exactly and a single rounding at the end, so that intermediate overflow and underflow cannot occur. - exp
ExpandExpAssign, traits for computing $e^x$ forFloats.- exp_
x_ minus_ 1 ExpXMinus1andExpXMinus1Assign, traits for computing $e^x-1$ forFloats.- factorial
factorial_prec_roundandfactorial_prec, for computing correctly-rounded factorials.- fractional_
part - Fractional parts of
Floats: thefractional_partandinteger_and_fractional_partsfamilies. - hypot
HypotandHypotAssign, traits for computing the hypotenuse of two numbers, $\sqrt{x^2+y^2}$.- is_
power_ of_ 2 - An implementation of
IsPowerOf2, a trait for determining whether a number is an integer power of 2. - is_unit
- An implementation of
IsUnit, a trait for determining whether a number is a unit of its ring. - ln
LnandLnAssign, traits for computing the natural logarithm ofFloats.- ln_
1_ plus_ x Ln1PlusXandLn1PlusXAssign, traits for computing $\ln(1+x)$ forFloats.- log_
base LogBaseandLogBaseAssign, traits for computing the base-$b$ logarithm ofFloats for an arbitrary integer base $b>1$.- log_
base_ 2 LogBase2andLogBase2Assign, traits for computing the base-2 logarithm ofFloats.- log_
base_ 1_ plus_ x LogBaseOf1PlusXandLogBaseOf1PlusXAssign, traits for computing $\log_b(1+x)$ ofFloats for an arbitrary integer base $b>1$.- log_
base_ 2_ 1_ plus_ x LogBase2Of1PlusXandLogBase2Of1PlusXAssign, traits for computing $\log_2(1+x)$ forFloats.- log_
base_ 10 LogBase10andLogBase10Assign, traits for computing the base-10 logarithm ofFloats.- log_
base_ 10_ 1_ plus_ x LogBase10Of1PlusXandLogBase10Of1PlusXAssign, traits for computing $\log_{10}(1+x)$ ofFloats.- log_
base_ float_ base LogBaseandLogBaseAssign, implemented for aFloatbase, for computing $\log_b x$ of aFloatwith an arbitraryFloatbase.- log_
base_ float_ base_ 1_ plus_ x LogBaseOf1PlusXandLogBaseOf1PlusXAssign, implemented for aFloatbase, for computing $\log_b(1+x)$ of aFloatwith an arbitraryFloatbase.- log_
base_ power_ of_ 2 LogBasePowerOf2andLogBasePowerOf2Assign, traits for computing $\log_{2^k} x$ forFloats.- log_
base_ power_ of_ 2_ 1_ plus_ x LogBasePowerOf2Of1PlusXandLogBasePowerOf2Of1PlusXAssign, traits for computing $\log_{2^k}(1+x)$ forFloats.- log_
base_ rational_ base LogBaseandLogBaseAssign, implemented for aRationalbase, for computing $\log_b x$ of aFloatwith an arbitrary rational base $b>1$.- log_
base_ rational_ base_ 1_ plus_ x LogBaseOf1PlusXandLogBaseOf1PlusXAssign, implemented for aRationalbase, for computing $\log_b(1+x)$ of aFloatwith an arbitrary rational base $b>1$.- log_
base_ rational_ float_ base - Functions for computing $\log_b x$ of a
Rational$x$ with an arbitraryFloatbase, returning aFloat. - log_
base_ rational_ rational_ base - Functions for computing $\log_b x$ of a
Rational$x$ with an arbitraryRationalbase $b>1$, returning aFloat. - mul
- Multiplication of
Floats, and ofFloats withRationals. - mul_
add_ mul MulAddMulandMulAddMulAssign, traits for adding the products of two pairs ofFloats with a single rounding, and the associated precision- and rounding-mode-aware functions.- mul_
sub_ mul MulSubMulandMulSubMulAssign, traits for subtracting the product of one pair ofFloats from the product of another pair with a single rounding, and the associated precision- and rounding-mode-aware functions.- neg
- Negation of
Floats. - positive_
difference positive_difference_prec_roundand related functions, for computing positive differences ofFloats.- 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
PowerOf2XMinus1andPowerOf2XMinus1Assign, traits for computing $2^x-1$. - power_
of_ 10 - An implementation of
PowerOf2with aFloatexponent, computing $2^x$ forFloats. - power_
of_ 10_ x_ minus_ 1 - product
- Correctly-rounded multiplication of any number of
Floats: functions computing a slice’s product with a single rounding at the end, and theProductimplementations built on them. - reciprocal
- Implementations of
ReciprocalandReciprocalAssign, traits for computing the reciprocal of a number. - reciprocal_
sqrt ReciprocalSqrtandReciprocalSqrtAssign, traits for computing the reciprocal of the square root ofFloats.- rem
rem_prec_roundand related functions, for computing floating-point remainders ofFloats.- root
root_u_prec_roundand related functions, for computing roots ofFloats.- round_
to_ integer - sec
- Implementations of
SecandSecAssign, traits for computing the secant ofFloats. - shl
- Left-shifting a
Float(multiplying it by a power of 2). - shl_
round - Implementations of
ShlRoundandShlRoundAssign, traits for multiplying a number by a power of 2 and rounding according to a specifiedRoundingMode. ForFloats, 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
ShlRoundandShrRoundAssign, traits for dividing a number by a power of 2 and rounding according to a specifiedRoundingMode. ForFloats, 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. - sin
- Implementations of
SinandSinAssign, traits for computing the sine ofFloats. - sin_cos
- Implementations of
SinCosandSinCosAssign, traits for computing the sine and cosine ofFloats together. - sqrt
SqrtandSqrtAssign, traits for computing the square root ofFloats.- square
- Squaring of
Floats. - sub
- Subtraction of
Floats, ofFloats byRationals, and ofRationals byFloats. - sub_mul
SubMulandSubMulAssign, traits for subtracting the product of twoFloats — or of aFloatand aRational— from anotherFloatwith a single rounding (fused multiply-subtract), and the associated precision- and rounding-mode-aware functions.- sum
- Correctly-rounded summation of any number of
Floats: functions computing a slice’s sum with a single rounding at the end, and theSumimplementations built on them. - tan