jaynetics / yaam

Yet Another Arithmetics Module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yaam - Yet Another Arithmetics Module

Calculates arithmetic expressions without using eval().

import {calculate, tryCalculate} from 'yaam'

calculate("2 ^ 3 * (4 + 5)") // => 72
calculate("foo") // ERROR

tryCalculate("2.5 % 2") // => 0.5
tryCalculate("foo") // null
tryCalculate("foo", { verbose: true }) // null, but logs to console

About

Yet Another Arithmetics Module

License:MIT License


Languages

Language:TypeScript 97.8%Language:JavaScript 2.2%