https://github.com/zmmbreeze/solver
Help you solve simple mathematical expressions.
https://github.com/zmmbreeze/solver
Last synced: about 2 months ago
JSON representation
Help you solve simple mathematical expressions.
- Host: GitHub
- URL: https://github.com/zmmbreeze/solver
- Owner: zmmbreeze
- Created: 2015-04-07T00:42:01.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-04-07T14:00:14.000Z (about 11 years ago)
- Last Synced: 2026-01-25T23:07:26.166Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 137 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
solver
============
Help you solve simple mathematical expressions.
1 + 1 = 2
API
--
### solver.solve
solver.solve('2 + 2 / (2*1)') === 3;
solver.solve('x + y * 3', {
x: 1,
y: 2
}) === 7;
### solver.compile
var eq = solver.compile('1 + 3 * x');
eq.solve({ x: 1 }) === 4;
eq.solve({ x: 2 }) === 7;
eq.solve({ x: 3 }) === 10;
Install
--
You can install simple-solver by `npm` or `bower`.
npm install simple-solver
bower install simple-solver