formula
Basic formulas interpreter.
npm install formula
Want to see pretty graphs? Log in now!
21 | downloads in the last month |
Last Published By | |
---|---|
Version | 0.0.2-beta2 last updated a few seconds ago |
License | MIT |
Keywords | formula, maths |
Repository | https://github.com/bfontaine/FormulaJS.git (git) |
Homepage | https://github.com/bfontaine/FormulaJS#readme |
Bugs | https://github.com/bfontaine/FormulaJS/issues |
Dependencies | None |
FormulaJS
This is an interpreter for basic formulas, based on an original idea by @tsalmon.
Install
(sudo) npm install formula # local
(sudo) npm install -g formula # global
Usage
formula <file>
Features
- Floats & integers, negative and positive numbers
- basic operations (
+
,-
,/
,*
) and power (^
) - constants (
E
,PI
) - some syntaxic sugar (e.g.
(…)(…)
instead of(…)*(…)
), various alternatives for some operations (e.g.⋅
or×
instead of*
,÷
instead of/
).
In the future, FormulaJS will be able to handle unknow variables and more functions (log, cos/sin/tan, etc).
Formula Examples
-2+3
((42-5)(12*3+2))^3
3.1415*18