calculator
Evaluate mathematical and statistical expressions using Python syntax. Perform operations like arithmetic, list expressions, and use functions such as min, max, mean, and variance. Supports custom variables for advanced calculations in blockchain and crypto strategies.
Instructions
Safely evaluates a mathematical or statistical expression string using Python syntax.
Supports arithmetic operations (+, -, *, /, **, %, //), list expressions, and a range of math and statistics functions:
abs, round, min, max, len, sum, mean, median, stdev, variance, sin, cos, tan, sqrt, log, exp, floor, ceil, etc.
Custom variables can be passed via the 'variables' dict, including lists for time series data.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
expression | Yes | ||
variables | Yes |
Input Schema (JSON Schema)
{
"properties": {
"expression": {
"title": "Expression",
"type": "string"
},
"variables": {
"additionalProperties": true,
"title": "Variables",
"type": "object"
}
},
"required": [
"expression",
"variables"
],
"title": "calculatorArguments",
"type": "object"
}