JSBI-Calculator is a calculator utility to perform arbitrary arithmetic computation, with the help of JSBI-based BigDecimal.
npm install jsbi-calculatorJSBI-Calculator is an IE11-compatible calculator utility to perform arbitrary (up to 18 decimals) arithmetic computation, with the help of JSBI-based BigDecimal.
Remarkable contribution from this project to GoogleChromeLabs/jsbi
```
> npm install jsbi-calculator
> For module:
`js
import JBC from "jsbi-calculator";
const { calculator } = JBC;
const expressionOne = "((10 (24 / ((9 + 3) (-2)))) + 17) + 5";
const resultOne = calculator(expressionOne);
console.log(resultOne);
// -> '12'
const max = String(Number.MAX_SAFE_INTEGER);
console.log(max);
// -> '9007199254740991'
const expressionTwo = ${max} + 2;`
const resultTwo = calculator(expressionTwo);
console.log(resultTwo);
// -> '9007199254740993'
> For node:
`js
const JBC = require("jsbi-calculator");
const { calculator } = JBC;
const expressionOne = "((10 (24 / ((9 + 3) (-2)))) + 17) + 5";
const resultOne = calculator(expressionOne);
console.log(resultOne);
// -> '12'
const max = String(Number.MAX_SAFE_INTEGER);
console.log(max);
// -> '9007199254740991'
const expressionTwo = ${max} + 2;`
const resultTwo = calculator(expressionTwo);
console.log(resultTwo);
// -> '9007199254740993'
> For browser:
`html`
The following operations are available. Please mind the factors which are
negative must start with "-" and be surrounded by parentheses, e.g. (-11) and
the positive ones can not start with "+".
| Operation | Symbol |
| -------------- | ----------------------------------- |
| Addition | + |-
| Subtration | |*
| Multiplication | |/` |
| Division |
| Square Root | JBC.BigDecimal.sqrt(num).toString() |
Great inspiration by the following resources.
trincot's answer to _BigDecimal in JavaScript_
LeetCode150 - Evaluate Reverse Polish Notation
Parsing math expressions with JavaScript - FreeCodeCamp