An open API service indexing awesome lists of open source software.

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.

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