Skip to main content

pyfastmath

🚀 pyfastmath is a blazing-fast math utility module for Python, written in C for maximum performance. It includes essential number-theoretic functions like GCD, primality checking, modular exponentiation and many more. Check below for more information about the features.


✨ Features

  • gcd(a, b) – Compute the Greatest Common Divisor of two integers
  • is_prime(n) – Efficiently check if a number is prime
  • mod_exp(base, exp, mod) – Perform Modular Exponentiation: (base^exp) % mod
  • lcm(a, b) – Calculate the Lowest Common Multiplicant
  • factorial(n) – Calculate the factorial of a positive integer
  • ncr(n, r) – Calculate the combination of two number(nCr)
  • npr(n, r) – Calculate the permutation of two number(nPr)

⚙️ Installation

After building locally:

pip install .

Or after uploading to PyPI:

pip install pyfastmath

🧪 Usage

import pyfastmath

print(pyfastmath.gcd(48, 18))         # ➝ 6
print(pyfastmath.is_prime(97))        # ➝ True
print(pyfastmath.mod_exp(2, 10, 100)) # ➝ 24
print(pyfastmath.lcm(48, 18))         # ➝ 144
print(pyfastmath.factorial(5))        # ➝ 120
print(pyfastmath.ncr(5,2))            # ➝ 10
print(pyfastmath.npr(5, 2))           # ➝ 20

Documentation

See the full documentation from here Docs

🚧 Requirements

  • Python 3.6 or higher
  • C compiler (e.g. gcc, clang, MSVC)

💠 Build from Source

python setup.py sdist bdist_wheel
pip install dist/pyfastmath-<version>.whl

📦 Distribute via PyPI

pip install twine
twine upload dist/*

📜 License

This project is licensed under the MIT License.


Contribution

See the contribution guidelines guidelines

👨‍💻 Author

Built with ❤️ by Gourabananda Datta B.Tech CSE, Ramkrishna Mahato Government Engineering College

Metadata

Release files for pyfastmath 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyfastmath 1.1.2
File Size Uploaded Provenance
pyfastmath-1.1.2.tar.gz 5.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyfastmath 1.1.2
File Interpreter ABI Platform
pyfastmath-1.1.2-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details

Total release size: 14.9 kB

Release files / pyfastmath-1.1.2.tar.gz

Download URL pyfastmath-1.1.2.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7271f2f9a3bcf4f5c225c859375814279d1517905e6b00acfb95a7a793fb5bac
BLAKE2b-256 checksum
How to use checksums
47b0cd3527521f34073fa93647d4dd84d6c79b523b305943dd76e2ee5caa6bc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Release files / pyfastmath-1.1.2-cp312-cp312-win_amd64.whl

Download URL pyfastmath-1.1.2-cp312-cp312-win_amd64.whl
Size 9.7 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
f41057a53c56e513af35eba052fb37a7bb6daae9a72feca5b64c2262216c512f
BLAKE2b-256 checksum
How to use checksums
a32540e629f566f470addcc7682562020176ff0d7a08157f96d367f54b15b89c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Security for pyfastmath 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page