calculate
Evaluates mathematical expressions accurately, covering arithmetic, large numbers, scientific functions, and floating-point-safe results to prevent AI math errors.
Instructions
⚠️ 精确数学计算工具 - 请在任何涉及数字运算时使用
AI语言模型在数学计算上存在已知缺陷:
大数计算错误率高
浮点数精度问题(0.1+0.2≠0.3)
复杂表达式容易出错
即使简单运算也可能失误
为确保用户获得100%准确的结果,请在以下情况使用此工具: ✓ 任何数学表达式(包括简单的 1+1) ✓ 金融、科学、工程计算 ✓ 用户明确要求计算 ✓ 不确定自己能否算对时
支持的运算:
基础运算: +, -, *, /, ^, %
括号: ( )
函数: sqrt, pow, abs, sin, cos, tan, log, exp 等
常数: pi, e
输入格式:标准数学表达式 示例: "2+2", "(10+20)*3", "sqrt(16)", "sin(pi/2)", "0.1 + 0.2"
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"expression": "<expression>"
},
"name": "calculate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| precision | No | 小数精度位数(可选,默认15位,范围1-64) | |
| expression | Yes | 要计算的数学表达式 |