Expand description

Traits for arithmetic.

Modules

Absolute value of Rationals.

Addition of Rationals.

Implementations of Approximate and ApproximateAssign, traits for approximating a Rational by a Rational with a bounded denominator.

Implementations of Ceiling and CeilingAssign, traits for taking the ceiling of a number.

Division of Rationals.

Implementations of Floor and FloorAssign, traits for taking the floor of a number.

Implementations 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 Rationals.

Negation of a Rational.

Implementations of NextPowerOf2 and NextPowerOf2Assign, traits for getting the next-highest power of 2.

Implementations of Pow and PowAssign, traits for raising a number to a power.

Implementations of PowerOf2, a trait for computing a power of 2.

Implementations of Reciprocal and ReciprocalAssign, 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 and RoundToMultipleAssign, traits for rounding a number to a multiple of another number.

Implementations of RoundToMultipleOfPowerOf2 and RoundToMultipleOfPowerOf2Assign, 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).

Implementations 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 and SquareAssign, traits for squaring a number.

Subtraction of Rationals.

Various traits for performing arithmetic operations on numbers.