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.
- Number theory:
bm.integer_math.num_theory - Combinatorics:
bm.integer_math.combinatorics
Repos and Documentation
Repositories
- bm.integer-math project on PyPI
- Source code on GitHub
Detailed documentation
- Detailed API documentation on GH-Pages
This project is part of the Boring Math bm. namespace project.
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 > 2is a prime number
- where
- function jacobi_symbol(a: int, n: int) -> int
- where
n > 0
- where
- function gcd(int, int) -> int
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+
- about 5x slower than
- function comb(n: int, m: int) -> int
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file boring_math_integer_math-0.8.0.tar.gz.
File metadata
- Download URL: boring_math_integer_math-0.8.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f443070e739c3f50478ba529e214d39086f777e01871b2a2e12abbcf4a94843
|
|
| MD5 |
318744bd0e690a1b904fbc48c343b43d
|
|
| BLAKE2b-256 |
6e912d169f14114f22c78a80422dc4a3e7952b8d3dd5737948edb1e25bd82d4e
|
File details
Details for the file boring_math_integer_math-0.8.0-py3-none-any.whl.
File metadata
- Download URL: boring_math_integer_math-0.8.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78307bf8abe57a09afe347f56f00bb05beb6091b76cc7799e4ec7a05bb6117ba
|
|
| MD5 |
7ba46216d36a2b8e470c138b4866d28d
|
|
| BLAKE2b-256 |
0cb99cde4dcc01300a88b290a5aba600eff6df734e0c7612604c1ee6a58b481a
|