Metadata-Version: 2.4
Name: boring-math-integer-math
Version: 0.8.1
Summary: Integer Mathematics
Keywords: comb,combinations,combinatorics,gcd,integer,lcm,math,number-theory,primes
Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
License-File: LICENSE
Requires-Dist: pythonic-fp.circular-array>=5.3.0
Requires-Dist: pythonic-fp.iterables>=5.0.0
Requires-Dist: pythonic-fp.fptools>=5.0.0
Requires-Dist: pytest>=8.4.1 ; extra == "test"
Project-URL: Changelog, https://github.com/grscheller/boring-math-integer-math/blob/main/CHANGELOG.md
Project-URL: Documentation, https://grscheller.github.io/boring-math/integer-math/development/build/html/releases.html
Project-URL: Homepage, https://github.com/grscheller/boring-math/blob/main/README.md
Project-URL: Source, https://github.com/grscheller/boring-math-integer-math
Provides-Extra: test

# Boring Math Library - Integer math package

Package of Python integer math libraries.

- [Number theory](#number-theory-module): `bm.integer_math.num_theory`
- [Combinatorics](#combinatorics-module): `bm.integer_math.combinatorics`

This project is part of the
[Boring Math][1] **boring.math** namespace project.

## Repos and Documentation

### Repositories

- [boring_math-integer-math][2] project on *PyPI*
- [Source code][3] on *GitHub*

### Detailed documentation

- [Detailed API documentation][4] on *GH-Pages*

## 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+

______________________________________________________________________

[1]: https://github.com/grscheller/boring-math/README.md
[2]: https://pypi.org/project/boring_math-integer-math/
[3]: https://github.com/grscheller/boring-math-integer-math/
[4]: https://grscheller.github.io/boring-math/integer-math/development/build/html/

