Skip to main content

Optimized arithmetic operations for large numbers with high-speed algorithms.

Project description

fastarithmetic is a Python package designed for fast and efficient arithmetic operations on very large numbers. It implements optimized algorithms like Karatsuba multiplication and Newton-Raphson division to provide significantly faster performance than Python’s native arithmetic operators.

### Features - Fast Addition: Performs addition of large numbers in O(1) time complexity. - Fast Subtraction: Performs subtraction of large numbers in O(1) time complexity. - Optimized Multiplication: Uses the Karatsuba algorithm (O(n^1.58)) for large integer multiplication. - High-Speed Division: Implements the Newton-Raphson method (O(M(n))) for efficient division.

### Use Cases - Scientific computations with extremely large integers. - Cryptography where high precision and fast operations are required. - Big data applications involving large-scale numerical processing.

### Installation To install fastarithmetic, run the following command:

pip install fastarithmetic

### Example Usage

from fastarithmetic import fast_add, fast_sub, fast_mul, fast_div

a = 987654321987654321987654321 b = 123456789123456789

print(“Addition:”, fast_add(a, b)) print(“Subtraction:”, fast_sub(a, b)) print(“Multiplication:”, fast_mul(a, b)) print(“Division:”, fast_div(a, b))

### Performance Comparison Compared to native Python arithmetic, fastarithmetic is optimized for large numbers and provides faster computation for multiplication and division due to the use of advanced algorithms.

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

fastarithmetic-1.0.0.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

fastarithmetic-1.0.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file fastarithmetic-1.0.0.tar.gz.

File metadata

  • Download URL: fastarithmetic-1.0.0.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for fastarithmetic-1.0.0.tar.gz
Algorithm Hash digest
SHA256 918a777e85886c2e93ed7988c1eea5cb3b1e72b86531ea6473709e4bb0e24c2e
MD5 2e2ca3f729113efbdef574a2216ace11
BLAKE2b-256 1a4d901c433e687595d9a7065107169bf8b0b0640d024840ed5f257e3daa16ef

See more details on using hashes here.

File details

Details for the file fastarithmetic-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: fastarithmetic-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for fastarithmetic-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9548816cc81052533dfbe1a4dd247dd1388a23b27b4b6cd3b9446dfcf49e040
MD5 618b35cd401f7f52300ea6e6c2737c08
BLAKE2b-256 7b33ef27fa7f78318cd35bb8527941a340fc9ce3921779b7d9cd111f7e2c69b6

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