A high precision calculator
Project description
This is a super calculator that is designed to do calculations with numbers from very large numbers, or very small decimals.
Functions
Addition
Adds 2 numbers together
def addition(value1 : str, value2 : str) -> str:...
Example
import supercalculator as calc
equals = calc.addition("-1", "5")
print(equals)
Out: "4"
Subtraction
Subtracts 2 numbers
def subtraction(value1 : str, value2 : str) -> str:...
Example
import supercalculator as calc
equals = calc.subtraction("10", "17")
print(equals)
Out: "-7"
Multiplication
Multiplies 2 numbers together
def multiplication(value1 : str, value2 : str) -> str:...
Example
import supercalculator as calc
equals = calc.multiplication("4", "8")
print(equals)
Out: "32"
Division
Divides 2 numbers
def division(value1 : str, value2 : str, precision : int = 100) -> str:...
Example
import supercalculator as calc
equals = calc.division("6", "3")
print(equals)
Out: "2"
Exponential
Multiplies a number by itself x times
def exponent(value : str, exp : str) -> str:...
Example
import supercalculator as calc
equals = calc.exponent("4", "2")
print(equals)
Out: "16"
Factorial
Factorial
def factorial(value : str) -> str:...
Example
import supercalculator as calc
equals = calc.factorial("4")
print(equals)
Out: "24"
Sin
Outputs sin of number
def sin(value : str, precision : int = 10) -> str:...
Example
import supercalculator as calc
equals = calc.sin("1")
print(equals)
Out: "0.84147098484930199201"
Square root
Outputs square_root of a number
def square_root(value : str, precision : int = 100) -> str:...
Example
import supercalculator as calc
equals = calc.square_root("16")
print(equals)
Out: "4"
Round
Rounds a number
def round(value : str, decimals : int = 0) -> str:...
Example
import supercalculator as calc
equals = calc.round("16.5")
print(equals)
Out: "17"
Limits
Find what an equation equals as x->value
def limit(equation, x_goes_towards : str, precision : int = 100) -> str:...
Example
import supercalculator as calc
equals = calc.limit(equation = "(5 / (x ^ 2))", x_goes_towards = "0")
print(equals)
Out: "infinity"
Precision default
class Precision:
limit = 100
square_root = 100
sin = 10
division = 100
Change default
Example
print(Precision().division)
Precision.division = 200
print(Precision().division)
Out[1]: 100
Out[2]: 200
Equation Builder
DISCLAIMER Factorials do NOT work in equation builder yet!!
def calculate(equation : str, x_val : str = None) -> str:...
x_val is necessary if x is in the equation and is not defined.
- Limits define x values, only in the limit.
Syntax
Parentheses must be around any operation.
Example
x - (4 * x ^2) would be (x - (4 *(x^2)))
X values for limits go on lower line
Example
For limit(equation = "1/x", x_goes_towards = 0) it would be:
"""
lim(1 / x)
x->0
"""
For multiple limits
"""
(lim(1 / x) / lim(2 ^ x))
x->0.1 x->3
"""
Functions such as sqrt(), and sin() act like parentheses
Example
"sqrt(x - 3)"
Change Log
0.1.8 (10/6/2023)
- Fixed square roots in equation builder
- Fixed division hanging
- Added Precision default changer to docs
0.1.6 (10/6/2023)
- Made specific 10 ^ #, 100 ^ #... algorithm
- Made negative exponents
0.1.5 (10/5/2023)
- Massive limits fix
- Fixed decimal exponent problem (cannot do decimal exponents)
0.1.401 (10/3/2023)
- Fixed -0
0.1.4 (10/3/2023)
- Fixed limits
- Changed limit precision default from 50 -> 100
0.1.3 (10/3/2023)
- Updated documentation
0.1.2 (10/2/2023)
- Fixed negative numbers in limits
0.1.1 (10/2/2023)
- Added functionality to equation builder.
- Added functions / limits
0.1.0 (10/1/2023)
- Initial Release
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
File details
Details for the file supercalculator-0.1.8.tar.gz.
File metadata
- Download URL: supercalculator-0.1.8.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffcaf03b48a04375c32dfad49e03d90ec3e7b55f337f3dcb27f863bf139fed92
|
|
| MD5 |
a5d6152d1d6b8cdf55a7e4a82a94af9e
|
|
| BLAKE2b-256 |
8811a3b1ff419abb1b2344cb7b115499f5925329e113b8ca2f30c7b2e00837fe
|