{"id":"nezuo/evaluate","name":"evaluate","scope":"nezuo","platform":"roblox","description":"Mirrored from the Wally registry.","version":"0.1.0","latest":"0.1.0","versions":["0.1.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":["License identified from the packaged LICENSE file; the manifest declared none."],"licenseVerified":true,"dependencies":{},"integrity":"cadc8688d35aa5342ae2b37212576921dbc3bb60bac7911d9ed941a8e0e703f5","likes":0,"downloads":0,"install":"forest install nezuo/evaluate","url":"https://forest.dev/p/roblox/nezuo/evaluate","files":"https://api.forest.dev/ai/package/roblox/nezuo/evaluate/files","readme":"# evaluate\n\n**evaluate** is mathematical evaluator for Lua.\n\nFeatures:\n- Supports variables\n- Support constants like pi\n- Supports standard mathematical operators\n- Functions with a variable number of arguments like min\n- Supports unary operators, e.g. -2 or +2\n\n## Usage Examples:\n```lua\nlocal evaluate = require(...)\n\n-- Simple expression without variables.\nevaluate(\"1 + 1 / 3\") -- 1.3333333333333\n\n-- A more complex expression showing support for unary operators.\nevaluate(\"(3.4 + -4.1)/2\") -- -0.35\n\n-- Expression using functions and variables.\nevaluate(\"sqrt(a^2 + b^2)\", {\n    a = 2.4;\n    b = 9.253;\n}) -- 9.5591845363504\n\n-- Expression with constant.\nevaluate(\"pi * 2\") -- 6.2831853071796\n\n-- Expression using composite function calls and constant.\nevaluate(\"sin(cos(pi)))\") -- -0.8414709848079\n\n-- Expression using function with variable parameters.\nevaluate(\"max(2, 4, 7, 1)\") -- 7\n```\n\n## Supported Operators\n\n| Operator | Description |\n| ----------- | ----------- |\n| + | Addition operator / Unary plus\n| - | Subtraction operator / Unary minus\n| * | Multiplication operator\n| / | Division operator\n| % | Modulo operator\n| ^ | Power operator\n\n## Supported Functions\n\n| Function |\n| ----------- |\n| abs |\n| acos |\n| asin |\n| atan |\n| atan2 |\n| ceil |\n| clamp |\n| cos |\n| cosh |\n| deg |\n| exp |\n| floor |\n| fmod |\n| ldexp |\n| log |\n| max |\n| min |\n| noise |\n| pow |\n| rad |\n| random |\n| sign |\n| sin |\n| sinh |\n| sqrt |\n| tan |\n| tanh |\n\n## Supported Constants\n\n| Constant |\n| ----------- |\n| pi |\n| huge |","readmeTruncated":false}