Skip to main content

Batch GCD

Overview

A pure Python implementation of DJB's Batch GCD algorithm.

Installation

Download and install with pip.

Or, download from source and install with make install (standard, user) or make install_dev (editable, system).

Usage

This is a library and cannot be invoked directly.

Test with make test.

The batch_gcd module exposes a batch_gcd function which takes integers and returns a list of their GCDs at the corresponding index.

>>> # Example batch_gcd usage
>>> from batch_gcd import batch_gcd
>>> batch_gcd(1909, 2923, 291, 205, 989, 62, 451, 1943, 1079, 2419)
[1909, 1, 1, 41, 23, 1, 41, 1, 83, 41]

This calculation involves two intermediate steps: creating a product tree and creating a remainder tree. These functions are also exposed, as products and remainders. products take integers and returns a product tree, remainders takes an integer and a product tree and returns a list of remainders.

Resources

Metadata

Release files for batch-gcd 0.0.5

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

Source distribution (sdist)

Source distribution for batch-gcd 0.0.5
File Size Uploaded Provenance Actions
batch_gcd-0.0.5.tar.gz 2.9 kB With provenance Details for batch_gcd-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for batch-gcd 0.0.5
File Interpreter ABI Platform Actions
batch_gcd-0.0.5-py3-none-any.whl Python 3 none any Details for batch_gcd-0.0.5-py3-none-any.whl

Total release size: 5.8 kB

Release files / batch_gcd-0.0.5.tar.gz

Download URL batch_gcd-0.0.5.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5ed3c7119120a137e327768bcc416c55aa776a7b2de41dc2f84489e2840254c7
BLAKE2b-256 checksum
How to use checksums
9b0feb63b04a7cc1ddb2b6c3c882a939e711249b48758992ef894dc6768ac6ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / batch_gcd-0.0.5-py3-none-any.whl

Download URL batch_gcd-0.0.5-py3-none-any.whl
Size 2.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3bf828209a225cef3fe67984f88a2f2d6ebf37332d1c3a7653e94dc5a9087fff
BLAKE2b-256 checksum
How to use checksums
21454a5b0eb33ff178221d194a8d40fe511a973f7606c81eaa7dc6cf138f9ce2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for batch-gcd 0.0.5

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for batch_gcd-0.0.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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