Skip to main content

Basic math operations with internal memory.

Project description

Calculator

Perform basic math operations with internal memory

Calculator methods:

  • add - add a real number to the internal memory value
  • subtract - subtract a real number from the internal memory value
  • multiply - multiply the internal memory value by a real number
  • divide - divide the internal memory value by a real number
  • root - take (n) root of the internal memory value
  • reset - reset the internal memory value

Installation

pip install pycalc3

Usage

>>> from pycalc3.calculator import Calculator
>>> cal = Calculator()
>>> cal.add(12)
>>> cal.memory_value
12.0
>>> cal.subtract(3)
>>> cal.memory_value
9.0
>>> cal.multiply(3)
>>> cal.memory_value
27.0
>>> cal.divide(3)
>>> cal.memory_value
9.0
>>> cal.root(2)
>>> cal.memory_value
3.0
>>> cal.reset()
>>> cal.memory_value
0.0

Changelog

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

pycalc3-0.0.2.tar.gz (2.2 kB view hashes)

Uploaded Source

Built Distribution

pycalc3-0.0.2-py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page