# mathtools¶

Abjad `mathtools` package.

Dependencies:

The `mathtools` package imports no other Abjad modules. Do not add modules to mathtools with intrapackage imports.

## Classes¶

 `BoundedObject` Bounded object mix-in. `Infinity` Object-oriented infinity. `NegativeInfinity` Object-oriented negative infinity. `NonreducedFraction` Initializes with an integer numerator and integer denominator: `NonreducedRatio` Nonreduced ratio. `Ratio` Ratio.

## Functions¶

 `all_are_equal` Is true when expr is a sequence and all elements in expr are equal: `all_are_integer_equivalent_exprs` Is true when expr is a sequence and all elements in expr are integer-equivalent expressions. `all_are_integer_equivalent_numbers` Is true when expr is a sequence and all elements in expr are integer-equivalent numbers. `all_are_nonnegative_integer_equivalent_numbers` True expr is a sequence and when all elements in expr are nonnegative integer-equivalent numbers. `all_are_nonnegative_integer_powers_of_two` Is true when expr is a sequence and all elements in expr are nonnegative integer powers of two. `all_are_nonnegative_integers` Is true when expr is a sequence and all elements in expr are nonnegative integers. `all_are_numbers` Is true when expr is a sequence and all elements in expr `all_are_pairs` Is true when expr is a sequence whose members are all sequences of length 2. `all_are_pairs_of_types` Is true when expr is a sequence whose members are all sequences of length 2, and where the first member of each pair is an instance of first_type and where the second member of each pair is an instance of second_type. `all_are_positive_integer_equivalent_numbers` Is true when expr is a sequence and all elements in expr are positive integer-equivalent numbers. `all_are_positive_integer_powers_of_two` Is true when expr is a sequence and all elements in expr are positive integer powers of two. `all_are_positive_integers` Is true when expr is a sequence and all elements in expr are positive integers. `all_are_unequal` Is true when expr is a sequence all elements in expr are unequal. `are_relatively_prime` Is true when numbers_ is a sequence comprising zero or more numbers, all of which are relatively prime. `arithmetic_mean` Arithmetic means of sequence as an exact integer. `binomial_coefficient` Binomial coefficient of n choose k. `cumulative_products` Cumulative products of sequence. `cumulative_signed_weights` Cumulative signed weights of sequence. `cumulative_sums` Cumulative sums of sequence. `cumulative_sums_pairwise` Lists pairwise cumulative sums of sequence from `0`. `difference_series` Gets difference series of sequence. `divide_number_by_ratio` Divides integer by ratio. `divisors` Positive divisors of integer n in increasing order. `factors` Prime factors less than or equal to positive integer n in increasing order. `fraction_to_proper_fraction` Changes rational to proper fraction. `get_shared_numeric_sign` Gets shared numeric sign of elements in sequence. `greatest_common_divisor` Calculates greatest common divisor of integers. `greatest_multiple_less_equal` Greatest integer multiple of m less than or equal to n. `greatest_power_of_two_less_equal` Greatest integer power of two less than or equal to positive n. `integer_equivalent_number_to_integer` Integer-equivalent number to integer. `integer_to_base_k_tuple` Nonnegative integer n to base-k tuple. `integer_to_binary_string` Positive integer n to binary string. `is_assignable_integer` Is true when expr is equivalent to an integer and can be written without recourse to ties. `is_dotted_integer` Is true when expr is equivalent to a positive integer and can be written with zero or more dots. `is_fraction_equivalent_pair` Is true when expr is an integer-equivalent pair of numbers excluding `0` as the second term. `is_integer_equivalent_expr` Is true when expr is an integer-equivalent number. `is_integer_equivalent_n_tuple` Is true when expr is a tuple of n integer-equivalent expressions. `is_integer_equivalent_number` Is true when expr is a number and expr is equivalent to an integer. `is_integer_equivalent_pair` Is true when expr is a pair of integer-equivalent expressions. `is_integer_equivalent_singleton` Is true when expr is a singleton of integer-equivalent expressions. `is_integer_n_tuple` Is true when expr is an integer tuple of length n. `is_integer_pair` Is true when expr is an integer tuple of length `2`. `is_integer_singleton` Is true when expr is an integer tuple of of length `1`. `is_n_tuple` Is true when expr is a tuple of length n. `is_negative_integer` Is true when expr equals a negative integer. `is_nonnegative_integer` Is true when expr equals a nonnegative integer. `is_nonnegative_integer_equivalent_number` Is true when expr is a nonnegative integer-equivalent number. `is_nonnegative_integer_power_of_two` Is true when expr is a nonnegative integer power of `2`. `is_null_tuple` Is true when expr is a tuple of length `0`. `is_pair` Is true when expr is a tuple of length `2`. `is_positive_integer` Is true when expr equals a positive integer. `is_positive_integer_equivalent_number` Is true when expr is a positive integer-equivalent number. `is_positive_integer_power_of_two` Is true when expr is a positive integer power of `2`. `is_singleton` Is true when expr is a tuple of length `1`. `least_common_multiple` Least common multiple of positive integers. `least_multiple_greater_equal` Returns the least integer multiple of m greater than or equal to n. `least_power_of_two_greater_equal` Returns least integer power of two greater than or equal to positive n. `next_integer_partition` Next integer partition following integer_partition in descending lex order. `partition_integer_by_ratio` Partitions positive integer-equivalent n by ratio. `partition_integer_into_canonic_parts` Partitions integer n into canonic parts. `partition_integer_into_halves` Writes positive integer n as the pair `t = (left, right)` such that `n == left + right`. `partition_integer_into_parts_less_than_double` Partitions integer n into parts less than double integer m. `partition_integer_into_units` Partitions positive integer into units: `remove_powers_of_two` Removes powers of `2` from the factors of positive integer n: `sign` Returns `-1` on negative n: `weight` Sum of the absolute value of the elements in sequence: `yield_all_compositions_of_integer` Yields all compositions of positive integer n `yield_all_partitions_of_integer` Yields all partitions of positive integer n in descending lex order: `yield_nonreduced_fractions` Yields positive nonreduced fractions in Cantor diagonalized order: