1.0.0 • Published 1 year ago
math-exec v1.0.0
⚙️ Installation
npm i math-exec
CDN Links:
- https://cdn.jsdelivr.net/npm/math-exec@1.0.0/math-exec.js
- https://www.unpkg.com/math-exec@1.0.0/math-exec.js
📖 Usage
● Import
// ES6
import mathExec from "math-exec";
// commonjs
const mathExec = require("math-exec");
● Evaluate
mathExec("1 + 2 * 3 / 1");
mathExec("sin(45) ^ 2");
mathExec("2 + 3 % 2");
mathExec("log(10, 100) * 2");
Make sure to console.log()
the values!
Operator names | Operator names | Operator names |
---|---|---|
** | + | - |
* | / | % |
^ | // | log |
log10 | min | max |
random | sqrt | abs |
round | ceil | floor |
sin | cos | tan |
asin | acos | atan |
exp | floorDiv | mod |
roundTo | cbrt | expm1 |
hypot | sign | trunc |
1.0.0
1 year ago