We're Hiring!
Whitepaper
Docs
Sign In
Tool
Tool
Enhanced Calculator
Last Updated
a year ago
Created
a year ago
Tool ID
enhanced_calculator
Creator
@rais
Downloads
2.3K+
Get
Sponsored by Open WebUI Inc.
We are hiring!
Shape the way humanity engages with
intelligence
.
Description
This calculator will work with better capabilities and since it's using sympy there no security issues, making it very good for privacy and more complex math problems.
README
No README available
Tool Code
Show
import sympy as sp class Tools: def __init__(self): pass def calculator(self, equation: str) -> str: """ Calculate the result of an equation safely. :param equation: The equation to calculate. :return: The result of the equation. """ try: # Parse the equation using sympy expr = sp.sympify(equation) result = expr.evalf() return f"{equation} = {result}" except (sp.SympifyError, ValueError) as e: print(e) return "Invalid equation" # Example usage tools = Tools() result = tools.calculator("3 + 5 * (2 - 8)") print(result) # Output: 3 + 5 * (2 - 8) = -25.0000000000000