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.
div
Division of Floats, of Floats by Rationals, and of Rationals by Floats.
is_power_of_2
An implementations of IsPowerOf2, a trait for determining whether a number is an integer power of 2.
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.
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.
square
Squaring of Floats.
sub
Subtraction of Floats, of Floats by Rationals, and of Rationals by Floats.