pydoc > _pylong

Help on module _pylong:

NAME
    _pylong

MODULE REFERENCE
    https://docs.python.org/3.12/library/_pylong.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

DESCRIPTION
    Python implementations of some algorithms for use by longobject.c.
    The goal is to provide asymptotically faster algorithms that can be
    used for operations on integers with many digits.  In those cases, the
    performance overhead of the Python implementation is not significant
    since the asymptotic behavior is what dominates runtime. Functions
    provided by this module should be considered private and not part of any
    public API.

    Note: for ease of maintainability, please prefer clear code and avoid
    "micro-optimizations".  This module will only be imported and used for
    integers with a huge number of digits.  Saving a few microseconds with
    tricky or non-obvious code is not worth it.  For people looking for
    maximum performance, they should use something like gmpy2.

FUNCTIONS
    int_divmod(a, b)
        Asymptotically fast replacement for divmod, for 'int'.
        Its time complexity is O(n**1.58), where n = #bits(a) + #bits(b).

    int_from_string(s)
        Asymptotically fast version of PyLong_FromString(), conversion
        of a string of decimal digits into an 'int'.

    int_to_decimal(n)
        Asymptotically fast conversion of an 'int' to Decimal.

    int_to_decimal_string(n)
        Asymptotically fast conversion of an 'int' to a decimal string.

    str_to_int(s)
        Asymptotically fast version of decimal string to 'int' conversion.

FILE
    /usr/lib/python3.12/_pylong.py


Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-01 16:48 @216.73.216.239
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!