Calculator App exposes a curated set of mathematical functions and constants that you can use in any expression. These are injected into the evaluation sandbox via theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Seaus-tech/Calculator-App/llms.txt
Use this file to discover all available pages before exploring further.
safe_dict in evaluator.py, making them available by name without any import or prefix.
Available Functions and Constants
| Name | Type | Description | Example |
|---|---|---|---|
sqrt(x) | Function | Square root of x | sqrt(16) → 4.0 |
sin(x) | Function | Sine of x (radians) | sin(0) → 0.0 |
cos(x) | Function | Cosine of x (radians) | cos(0) → 1.0 |
tan(x) | Function | Tangent of x (radians) | tan(0) → 0.0 |
log(x) | Function | Natural logarithm of x | log(e) → 1.0 |
pi | Constant | π ≈ 3.141592653589793 | pi → 3.141592653589793 |
e | Constant | Euler’s number ≈ 2.718281828459045 | e → 2.718281828459045 |
Usage Examples
Combining Functions with Operators
Functions return numeric values and can be composed with any operator or other function:Trigonometry and Degree Conversion
All trigonometric functions (
sin, cos, tan) accept angles in radians, not degrees. To convert degrees to radians, multiply by pi / 180:Security Sandbox
__builtins__ is set to an empty dict ({}) in the safe_dict passed to eval. This disables all built-in Python functions — only the explicitly listed functions and constants above are accessible. Attempts to call anything else (e.g., open(), print(), __import__) will return Invalid - Math error or Invalid - Unknown variable.evaluator.py: