GCD Calculator Documentation
Overview
The GCD Calculator is a lightweight Python package designed to compute the Greatest Common Divisor (GCD) of two integers using the efficient Euclidean algorithm. It provides a simple interface for developers and mathematicians to quickly determine GCD values in their applications.
Features
- Calculates the GCD of two integers.
- Utilizes the efficient Euclidean algorithm for fast computation.
- Easy to install and use.
Installation
To install the GCD Calculator package, use pip:
pip install gcd_calculator
Usage
After installation, you can use the GCD Calculator in your Python projects as follows:
from gcd_calculator.gcd import gcd
# Example usage
result = gcd(10, 5)
print(f"The GCD of 10 and 5 is: {result}") # Output: The GCD of 10 and 5 is: 5
Function Details
The package provides the following function:
def gcd(a: int, b: int) -> int:
"""Calculate the GCD of two integers a and b."""
-
Parameters:
a(int): The first integer.b(int): The second integer.
-
Returns:
- int: The GCD of
aandb.
- int: The GCD of
Example
Here's an additional example demonstrating the use of the gcd function:
# Calculate GCD of two numbers
result1 = gcd(48, 18)
print(f"The GCD of 48 and 18 is: {result1}") # Output: 6
result2 = gcd(100, 75)
print(f"The GCD of 100 and 75 is: {result2}") # Output: 25
Contributing
Contributions are welcome! If you would like to contribute to the GCD Calculator, please follow these steps:
- Fork the repository.
- Create your feature branch:
git checkout -b my-feature. - Commit your changes:
git commit -m 'Add some feature'. - Push to the branch:
git push origin my-feature. - Open a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Usmonov Shoxruxmirzo
Email: usmonovshohruxmirzo@gmail.com
GitHub: webbro-software
Metadata
Release files for gcd-calculator 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gcd_calculator-0.2.0.tar.gz | 3.2 kB | Without provenance | Details for gcd_calculator-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gcd_calculator-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for gcd_calculator-0.2.0-py3-none-any.whl |
Total release size: 6.7 kB
Release files / gcd_calculator-0.2.0.tar.gz
| Download URL | gcd_calculator-0.2.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70ae8853a3ea3fb9e2a863c5189e7556730c61287a2498dffc988e68c8c4e6ab
|
|
BLAKE2b-256 checksum How to use checksums |
0a9a770dd006c10a74df5b95936d3d03b6609c61617f8cda0b5501bfaa25b4cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / gcd_calculator-0.2.0-py3-none-any.whl
| Download URL | gcd_calculator-0.2.0-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ebc28d800741109f505f1bc4339366112c871ad931707644f474c3c817ca6991
|
|
BLAKE2b-256 checksum How to use checksums |
3dd832024599750defb9d432445766a093fc05691b4658a7c1d983ae3c319867
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Security for gcd-calculator 0.2.0
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.