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-2.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-2.0.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastarithmetic-2.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-2.0.0.tar.gz
Algorithm Hash digest
SHA256 c6e3aebd366c6732e0b4a91364f01f620743b4c92579d9b6a25105337c8f1153
MD5 a2346ef52dd0d8de8e9c6c844552dbea
BLAKE2b-256 dcf690aa4c4de1731377149c10e87393c8feea6d481b44345ba5754da04b4e26

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastarithmetic-2.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-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4239eed0e14e3be4010d77d52b0e979742dcd5721857584763ff735774485f10
MD5 c6e09e15f089b3dae4f9987e201a7a37
BLAKE2b-256 a14c37ebdcc9a645cf9f89e493d6a6669e14e5c7a90801b01324931d74856101

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