Skip to main content

Calculator with addition, subtraction, multiplication, division and (n) root functions

Project description

Calculator

Calculator is a Python package for performing addition, subtraction, multiplication, division and n-th root functions on a number stored in calculator's memory. Everytime a function is performed, calculator's memory is updated.

Installation

Use the package manager pip to this calculator as calculator-meluzx==0.0.7.

pip install calculator-meluzx==0.0.7

Usage

To import this package, use the following code.

from calculator_meluzx.calculator_meluzx import Calculator

# activates calculator with initial memory's value 
calculator = Calculator()

The initial value stored in calculator's memory is 0. All functions are performed with latest value in calculator's memory and a number, defined in brackets when calling a method. The following code describes a case, in which some prior functions have been performed and latest value in calculator's memory is 2.

# performs 2 + 3, returns 5
calculator.add(3)

# performs 5 - 4, returns 1
calculator.subtract(4)

# performs 1 * 8, returns 8
calculator.multiply(8)

# performs 8 / 2, returns 4
calculator.divide(2)

# performs 4 ** 2, returns 2
calculator.root(2)

Calculator also has reset function, which sets calculator's memory value to 0.

# returns 0
calculator.reset()

Requirements

This package is introduced in Python3.12 and works with python versions >= 3.6. For installation you need to have pip module in your environment.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

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

calculator_meluzx-0.0.7.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

calculator_meluzx-0.0.7-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file calculator_meluzx-0.0.7.tar.gz.

File metadata

  • Download URL: calculator_meluzx-0.0.7.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.0

File hashes

Hashes for calculator_meluzx-0.0.7.tar.gz
Algorithm Hash digest
SHA256 7d5a01065de3b873dbfa32e4c4d9710c7d2da251476c8d9db33f2a4dca6314b6
MD5 5d2b52a605cb9d5ab604776edf4c8532
BLAKE2b-256 98d12fe93e277e3a9b20e8e27b158fa01eff9853915ec87a7ee4244e22828b18

See more details on using hashes here.

File details

Details for the file calculator_meluzx-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for calculator_meluzx-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 f88dc89e7b605ee33419859686d825d54713cdb6aaa4fba6af29012dd541d39d
MD5 638100df4404d6fd80eb2c4593e0bb25
BLAKE2b-256 9b0b83952ff4de1affb3ac201b9c5685f1317d10db05829f29a0307f2b138e62

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