polymerist.maths.numbersys.positional ===================================== .. py:module:: polymerist.maths.numbersys.positional .. autoapi-nested-parse:: Conversion tools for representing positive integers in fixed and mixed radix positional bases Classes ------- .. autoapisummary:: polymerist.maths.numbersys.positional.PositionalNumberingSystem Module Contents --------------- .. py:class:: PositionalNumberingSystem(radices: Sequence[int]) For representing positive integers in standard and mixed-radix positional numbering systems .. py:property:: radices :type: Sequence[int] .. py:attribute:: bases .. py:property:: places :type: Generator[int, None, None] Generates the values of each position in a general mixed-radix positional notation .. py:method:: int_to_digits_iter(n: int) -> Generator[int, None, None] Convert a non-negative integer to its digit representation under the specified radices Yields digits in ascending order of significance (i.e. starting from least significant digit) .. py:method:: int_to_digits(n: int, as_str: bool = False) -> Union[str, list[int]] Returns digits of number in descending order of significance (i.e. most significant digit first) .. py:method:: digits_to_int(digits: Sequence[int]) -> int Convert a sequence of digits to an integer in the specified numbering system Digits should be passed in descending order (i.e. most-significant digit first)