Skip to main content

A small example 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.0.1.tar.gz (8.2 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.0.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rounded_calculate-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9a48169212bf16ea9d46c4c061eedb002c3215a0f9b0e20265627c8599a4929c
MD5 797fb6ee2b866d3bda7dfc9ef282ddce
BLAKE2b-256 a6ccd7dacb51fbd9f182015699b61294855cfa54b156cf4e9b49562d3024bc72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rounded_calculate-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 49bc88d7786695495dd65425d820313b58a784adf509bdab2806f4954cd494f3
MD5 e1c118f957b6736ccc60fc6c21b52526
BLAKE2b-256 eaa9491b38c7183b9a211cecead289e8250c3468909353d5c34152e85e2f1509

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