Skip to main content

Rounded calculator package

Project description

Rounded calculator

Features

This package allows users to calculate addition, substraction, division, multiplication and power of n root of active memory value. Also package users can print history of calculations and undo last actions to access specific history values. All calculations made with this package are rounded to 8 decimal points.

Getting started

Instalation of the Rounded Calculate package is done by running command
pip install rounded-calculate

Package usage

Init Calculator

Assign Calculator class to desired variable
calculator = Calculator()

All the calculations made by the Calculator is based on value of the Calculator memory.

Calculator class contains class of Memory which is storing all the history of calculations performed by using this package.

Calculator functions


All Calculator methods returns calculation result where operand 1 is current value of calculator memory and operand 2 is called method parameter. This do not apply for memory related methods.



calculator.add(n)
Adds parameter n to calculator memory value. Returns new calculator memory value.


calculator.substract(n)
Substracts parameter n from calculator memory value. Returns new calculator memory value.


calculator.multiply(n)
Multiplies calculator memory value by power of parameter n. Returns new calculator memory value.


calculator.divide(n)
Divides calculator memory value by power of parameter n. Returns new calculator memory value.


calculator.root(n)
Adds parameter n to last calculation of calculator outcome. Returns new calculator memory value.


calculator.undo()
Removes last entry of calculator history.


calculator.reset_memory()
Deletes all calculations history, sets next calculation base to 0.


calculator.print_history()
Prints all calculations history.


License

Licensed under the MIT License.

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

rounded_calculate-0.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

rounded_calculate-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rounded_calculate-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for rounded_calculate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 67b5174213e1d2f7e14a9da69efab5a07d5a19fe11af5119d3fab3690992884f
MD5 4898e01f021e83a7af4b0258d12f6f66
BLAKE2b-256 4fb32fa7ab76d19220e087dcc03c3e19ba97bd277c0ab39f8d13a70f4fbe5977

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rounded_calculate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b4c9081bcf002848eded8a5187ca0c4c01e3d646a9916fae10498cd56276380
MD5 448e850feba66cd6fd84d5d8a9143e69
BLAKE2b-256 f193ab01e4ac62562cc91a1a39f418512fa1f3b4d28947ae84d5349a6e011861

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