DSH Plugin dsh-tool-calculator: Safely Evaluate Mathematical Expressions
`dsh-tool-calculator` is a tool plugin within the DSH plugin ecosystem, registering the `calculator` tool for safely evaluating mathematical expressions. It adopts the MIT license, is based on a hand-written recursive descent parser, and strictly adheres to the "zero dependencies, zero processes, pure function" design philosophy. It rejects `eval` and code execution, handling only whitelisted operators, functions, and constants. The plugin supports basic arithmetic operations such as addition, subtraction, multiplication, division, modulo, and exponentiation, as well as mathematical functions like `abs`, `sqrt`, and trigonometric functions. It requires results to be finite numbers and automatically rejects `NaN` and `Infinity`. Note that trigonometric functions use radians, and scientific notation and large integers exceeding the safe range of IEEE 754 double-precision are not supported. Installation requires compatibility with DSH 0.1.2-alpha.1, via `d
Read More