# mathtools¶

Tools for math.

Classes

 `Infinity` Infinity. `NegativeInfinity` Negative infinity. `NonreducedFraction` Nonreduced fraction. `NonreducedRatio` Nonreduced ratio. `Ratio` Ratio.

Functions

 `all_are_equal` Is true when `argument` is an iterable collection of equal items. `all_are_integer_equivalent` Is true when `argument` is an iterable collection with integer-equivalent items. `all_are_integer_equivalent_numbers` Is true when `argument` is an iterable collection with integer-equivalent items. `all_are_nonnegative_integer_equivalent_numbers` Is true when `argument` is an iterable collection of nonnegative integer-equivalent numbers. `all_are_nonnegative_integer_powers_of_two` Is true when `argument` is an iterable collection of nonnegative integer powers of two. `all_are_nonnegative_integers` Is true when `argument` is an iterable collection of nonnegative integers. `all_are_pairs_of_types` Is true when `argument` is an iterable collection whose members are all 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_integers` Is true when `argument` is an iterable collection of positive integers. `are_relatively_prime` Is true when `argument` is an iterable collection of relative primes. `arithmetic_mean` Gets arithmetic mean of `argument`. `binomial_coefficient` Gets binomial coefficient of `n` choose `k`. `cumulative_products` Gets cumulative products of `argument`. `cumulative_sums` Gets cumulative sums of `argument`. `cumulative_sums_pairwise` Gets pairwise cumulative sums of `argument` from zero. `difference_series` Gets difference series of `argument`. `divisors` Gets positive divisors of `n` in increasing order. `factors` Gets prime factors less than or equal to `n` . `fraction_to_proper_fraction` Changes `rational` to proper fraction. `greatest_common_divisor` Calculates greatest common divisor of `integers`. `greatest_power_of_two_less_equal` Gets greatest integer power of two less than or equal to positive `n`. `integer_equivalent_number_to_integer` Changes integer-equivalent `number` to integer. `integer_to_base_k_tuple` Changes nonnegative integer `n` to base-k tuple. `integer_to_binary_string` Changes positive integer `n` to binary string. `is_assignable_integer` Is true when `argument` is equivalent to an integer that can be written without recourse to ties. `is_integer_equivalent` Is true when `argument` is an integer-equivalent number. `is_integer_equivalent_n_tuple` Is true when `argument` is a tuple of `n` integer-equivalent items. `is_integer_equivalent_number` Is true when `argument` is a number and `argument` is equivalent to an integer. `is_nonnegative_integer` Is true when `argument` equals a nonnegative integer. `is_nonnegative_integer_equivalent_number` Is true when `argument` is a nonnegative integer-equivalent number. `is_nonnegative_integer_power_of_two` Is true when `argument` is a nonnegative integer power of 2. `is_positive_integer` Is true when `argument` equals a positive integer. `is_positive_integer_equivalent_number` Is true when `argument` is a positive integer-equivalent number. `is_positive_integer_power_of_two` Is true when `argument` is a positive integer power of 2. `least_common_multiple` Gets least common multiple of positive `integers`. `partition_integer_by_ratio` Partitions positive integer-equivalent `n` by `ratio`. `partition_integer_into_canonic_parts` Partitions integer `n` into canonic parts. `sign` Gets sign of `n`. `weight` Gets weight of `argument`. `yield_all_compositions_of_integer` Yields all compositions of positive integer `n`.