A simple calculator
Project description
mcalc
A simple not very precise calculator :exclamation::exclamation::exclamation:
Able to perform basic operations like:
- Add
- Subtract
- Multiply
- Divide
- Take n root
Getting started:
Instalation:
To install the package run pip install mcalc
Usage examples
>>> from mcalc.calc import Calculator
>>> Calculator(0)
0.0
>>> Calculator(1)
1.0
>>> cal1 = Calculator(10)
>>> cal1.add(5)
15.0
>>> cal1.subtract(10)
5.0
>>> cal1.multiply(-5)
-25.0
>>> cal1.divide(-5)
5.0
>>> cal1.n_root(3)
1.7099759466766968
>>> cal1.reset(9)
9.0
>>> cal1.n_root(2)
3.0
>>> cal1.n_root(0.2)
243.0
Usage caveats
- You get basic python floating point precision
n_rootmethod doesn't support taking roots of negative numbers, because this package doesn't support complex numbers (simple is in the name :sweat_smile:)
License
This code is protected 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
mcalc-0.1.8.tar.gz
(5.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
mcalc-0.1.8-py3-none-any.whl
(3.3 kB
view details)
File details
Details for the file mcalc-0.1.8.tar.gz.
File metadata
- Download URL: mcalc-0.1.8.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.25.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e82818b0c4d0ece6e90f531623063fcc024b72b1cf7aacaf6381b805ec5cf78c
|
|
| MD5 |
59f3ccd0bce24cb58371becbd7897fb9
|
|
| BLAKE2b-256 |
6a5ec3741562a96bd0847a9fa9b198340114cc17b644082bd46b6857ddebf2ad
|
File details
Details for the file mcalc-0.1.8-py3-none-any.whl.
File metadata
- Download URL: mcalc-0.1.8-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.25.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38ff4aaf1f5b5cfee86ec6362b95ad1e52a37b021cf5931333ffacda943cf5f6
|
|
| MD5 |
a0449e300a69e97ff626473c7c6ea879
|
|
| BLAKE2b-256 |
4783ad7b6e876e4e2b1e230398ee81f1c4c68fe6b9a37613f4ff8547a25cf7da
|