Skip to main content

Integer Mathematics

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Boring Math Library - Integer math package

Package of Python integer math libraries.

This project is part of the Boring Math boring.math namespace project.

Repos and Documentation

Repositories

Detailed documentation

Modules

Number Theory Module

  • Number Theory
    • function gcd(int, int) -> int
      • greatest common divisor of two integers
      • always returns a non-negative number greater than 0
    • function lcm(int, int) -> int
      • least common multiple of two integers
      • always returns a non-negative number greater than 0
    • function coprime(int, int) -> tuple(int, int)
      • make 2 integers coprime by dividing out gcd
      • preserves signs of original numbers
    • function iSqrt(int) -> int
      • integer square root
      • same as math.isqrt
    • function isSqr(int) -> bool
      • returns true if integer argument is a perfect square
    • function primes(start: int, end: int) -> Iterator[int]
      • now using Wilson's Theorem
    • function legendre_symbol(a: int, p: int) ->datastructures int
      • where p > 2 is a prime number
    • function jacobi_symbol(a: int, n: int) -> int
      • where n > 0

Combinatorics Module

  • Combinatorics
    • function comb(n: int, m: int) -> int
      • returns number of combinations of n items taken m at a time
      • pure Python implementation of math.comb
        • reasonably performant
    • function perm(n: int, m: int) -> int
      • returns number of permutations of n items taken m at a time
      • pure Python implementation of math.perm
        • about 5x slower than math.perm
        • keeping around for PyPy 3.12+

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

boring_math_integer_math-0.8.1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

boring_math_integer_math-0.8.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file boring_math_integer_math-0.8.1.tar.gz.

File metadata

File hashes

Hashes for boring_math_integer_math-0.8.1.tar.gz
Algorithm Hash digest
SHA256 29d5e81d87171a141006c39ed7a74db348ad0afe8d5219ccdbbf1bc42083589b
MD5 356cfe1449db444d462a848b3d109033
BLAKE2b-256 fedcfb9d3b13d79b2329885be2319cdb05cf3fbd7a966e528e10cd9c400abbf9

See more details on using hashes here.

File details

Details for the file boring_math_integer_math-0.8.1-py3-none-any.whl.

File metadata

File hashes

Hashes for boring_math_integer_math-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 741cdc9cb01da7d6d2fd595d6f5a3808555e73817fed83a196ff38a34c94515f
MD5 834bff06f01ddb797b6eed28c2ea4b67
BLAKE2b-256 d2f20d0f2c3961266110a5ccc359f9db47435507104c516240fedfdc605d9f38

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page