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
Project details
Release history Release notifications | RSS feed
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.3.tar.gz
(7.4 kB
view details)
Built Distribution
File details
Details for the file pycalc3-0.0.3.tar.gz
.
File metadata
- Download URL: pycalc3-0.0.3.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0fea917c4355c4438638ec5accab470f20ede9f0de6878a5681812d18bc5483 |
|
MD5 | 11ec98463a437139a2b5809ca499b719 |
|
BLAKE2b-256 | ca1de807e0c8bd2f5aeca36a468405081bdaa64ec13fab8c957ef4cacd19b1de |
File details
Details for the file pycalc3-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: pycalc3-0.0.3-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1903b72121dbad4cc9bd24dbd2c0e42837eca3951aa05997920b3f2d59a36bcb |
|
MD5 | e34d97b274bcc3ddeee1d1193f170b18 |
|
BLAKE2b-256 | eb2a4b141106b33dcd541b7a6fd1bb4591d4c9d2fa024d8aea64b42b94c7984a |