Skip to main content

No project description provided

Project description

Calculator Project

Calculator module that accepts arithmetic operations as user input and stores resulting value in memory.

Structure

.
├── tests/
│   ├── __init__.py
│   └── test_calculator.py
├── turing_calc/
│   ├── __init__.py
│   ├── calculator.py
│   └── main.py
├── README.md
└── pyproject.toml

Features

  • Basic arithmetic operations: addition, subtraction, multiplication, division, and nth root.
  • Memory management: store and use results from previous calculations and reset to 0.
  • Format validation: ensures that the inputs are properly formatted.

Installation

Poetry

To install with poetry use poetry add turing-calculator

pip

To install with pip use pip install turing-calculator

Usage

python

from calculator import Calculator

calc = Calculator()
print(calc.add(10))         # Outputs: 10.0
print(calc.sub(2))          # Outputs: 8
print(calc.mul(4))          # Outputs: 32.0
print(calc.div(2))          # Outputs: 16.0
print(calc.root(4))         # Outputs: 2.0
calc.clear()                # Resets memory to 0.0
calc.quit()                 # Exits module

Testing

Tests are located in the tests/ directory and can be run using pytest.

Contributing

  1. Fork the repository.
  2. Create a new branch for your features or fixes.
  3. Write tests that cover your changes.
  4. Submit a pull request and provide a detailed description of your changes.

License

This project is licensed under the terms of the LICENSE file.

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

turing_calc-0.1.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

turing_calc-0.1.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file turing_calc-0.1.1.tar.gz.

File metadata

  • Download URL: turing_calc-0.1.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Windows/11

File hashes

Hashes for turing_calc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1e9a5307681501b0c872f628052325868115a3d687615357cacf3c96dc27570e
MD5 753b4c639b273b4f10957f6e98db40f5
BLAKE2b-256 e2737f8c092d2fb1550ff041b1d05240b8299865af10f45ff41ae38319d84f69

See more details on using hashes here.

File details

Details for the file turing_calc-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: turing_calc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Windows/11

File hashes

Hashes for turing_calc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d63c0f13c338b600494aa8a9ea40d5613d4ca635962649d4ae842939e1e52a74
MD5 0ff8de97a9df1755b8d13497535e823a
BLAKE2b-256 c38538dbef235f574df75f19ee20df87c72f11dc9fb3b735eceb53e6237b6f86

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