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

Uploaded Python 3

File details

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

File metadata

  • Download URL: turing_calc-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 0eac31f6357e2c63cd9770aa06e4fbc49fd59c72355c7018e131c555b9e1fede
MD5 2cd631edcccd8c0f0927158edfddc73a
BLAKE2b-256 1abce7e155fc2b7da3dfa923e83fd854df4ca88c56d8454046b6dffc47f37987

See more details on using hashes here.

File details

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

File metadata

  • Download URL: turing_calc-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f28dd63feae7adfa574b47abac53817809ccadeba05bb6796150ea449be75d8f
MD5 7dbccc94c5cefe1d068fa51eb7cc30af
BLAKE2b-256 c4350b871b7ba2fe51efdc8f70528d39c4d1478c8a172353b6842f304d8884be

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