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

Uploaded Python 3

File details

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

File metadata

  • Download URL: turing_calc-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 b06de8ced632b1116af8d5e7a458f58e4dc09202b8cb1640f9e595f8da1a3306
MD5 6d878ef5b8da5032cd9aba8e1c5106e1
BLAKE2b-256 492bec7b2982e1b5ccc69e73a282b985adbd5d97190db2837ad6eff67283eced

See more details on using hashes here.

File details

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

File metadata

  • Download URL: turing_calc-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eba966bc549ce7fe8a8a262fd1368bc66e450a730982288f5188f6b172b1840b
MD5 29922f1f281ac2268b15724ef817ac9e
BLAKE2b-256 e62382ce5f831e79bddeea213a938adbabc16ddcaec20fb5ca0b7d18e8aa02f5

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