A small calculator module for Python
Project description
Calculator Module for Python
By White Night
Install
# Linux/macOS
python3 -m pip install -U whiteCalculator
# Windows
py -3 -m pip install -U whiteCalculator
QuickStart
Calculator
>>> from whiteCalculator import Calculator
>>> c = Calculator()
>>> print(c.run("1+8(5^2)"))
201
>>> print(c.run("9Ans"))
1809
Formula
>>> from whiteCalculator import Formula
>>> f = Formula()
>>> print(f.f2(6, 6, 60))
6
>>> print(f.QuadraticEquation(1, -2, 1))
(1, 1)
Errors
>>> from whiteCalculator import Calculator
>>> c2 = Calculator() # Default is True
>>> c2.run("9/0")
Error: division by zero
>>> c1 = Calculator(skipError=False)
>>> c1.run("9/0")
Traceback (most recent call last):
...
ZeroDivisionError: division by zero
Links
You can use:
- sin / asin / sinh
- cos / acos / cosh
- tan / atan / tanh
- ln / log
- × / •
- ^ / ** / power
- √ / sqrt
- π / pi
- %
- ÷
- Ans
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
whiteCalculator-0.0.4.tar.gz
(4.8 kB
view hashes)
Built Distribution
Close
Hashes for whiteCalculator-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a191d677ba3e4c0d3e395193368d2d9cd9695132a052de901138431ff270b5dd |
|
MD5 | e4c3ce34b5d30268aec9d32d992a2057 |
|
BLAKE2b-256 | 7450e552dd6117bc856dac85f1786d4c1ca12f794fc23c8c5f785f2781faa9fb |