Module malachite_q::arithmetic
source · Expand description
Traits for arithmetic.
Modules
- Absolute value of
Rational
s. - Addition of
Rational
s. - Implementations of
Approximate
andApproximateAssign
, traits for approximating aRational
by aRational
with a bounded denominator. - Implementations of
Ceiling
andCeilingAssign
, traits for taking the ceiling of a number. - Getting all denominators of
Rational
s that appear in a given closed interval. - Division of
Rational
s. - Implementations of
Floor
andFloorAssign
, traits for taking the floor of a number. - An implementation of
IsPowerOf2
, a trait for determining whether a number is an integer power of 2. - 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.
- Multiplication of
Rational
s. - Negation of
Rational
s. - Implementations of
NextPowerOf2
andNextPowerOf2Assign
, traits for getting the next-highest power of 2. - Implementations of
PowerOf2
, a trait for computing a power of 2. - Implementations of
Reciprocal
andReciprocalAssign
, traits for computing the reciprocal of a number. - Implementations of
CheckedRoot
, a trait for computing the root of a number, if the number is a perfect power. - 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. - Left-shifting a
Rational
(multiplying it by a power of 2). - Right-shifting a
Rational
(dividing it by a power of 2). - An implementation of
Sign
, a trait for determining the sign of a number. - Functions for finding the simplest (lowest-denominator)
Rational
in an interval. - Implementations of
CheckedSqrt
, a trait for computing the root of a number, if the number is a perfect square. - Implementations of
Square
andSquareAssign
, traits for squaring a number. - Subtraction of
Rational
s. - Various traits for performing arithmetic operations on numbers.