<commit_before># shunting-yard-arbitrary-precision

[![Build Status](https://travis-ci.org/javiercejudo/shunting-yard-arbitrary-precision.svg)](https://travis-ci.org/javiercejudo/shunting-yard-arbitrary-precision)
[![Coverage Status](https://coveralls.io/repos/javiercejudo/shunting-yard-arbitrary-precision/badge.svg?branch=master)](https://coveralls.io/r/javiercejudo/shunting-yard-arbitrary-precision?branch=master)
[![Code Climate](https://codeclimate.com/github/javiercejudo/shunting-yard-arbitrary-precision/badges/gpa.svg)](https://codeclimate.com/github/javiercejudo/shunting-yard-arbitrary-precision)

Mathematical expression parser with arbitrary precision support
provided by the [arbitrary-precision](https://github.com/javiercejudo/arbitrary-precision)
package.

## Install

    npm i shunting-yard-arbitrary-precision

## Usage

```js
const shunt = require('shunting-yard-arbitrary-precision');

Number(shunt('3+2')); //=> 5

// all following results are returned as Decimal
// with the floating adapter by default
shunt('3+2'); //=> 5 (as Decimal)
shunt('(10+5)/5'); //=> 3
shunt('3+(5*2)*(-3+2)'); //=> -7
shunt('2^3'); //=> 8

const decimalFactory = require('arbitrary-precision');
const Decimal = decimalFactory(require('bigjs-adapter'));
<commit_msg>docs(README): add link to javascript-shunting-yard<commit_after># shunting-yard-arbitrary-precision

[![Build Status](https://travis-ci.org/javiercejudo/shunting-yard-arbitrary-precision.svg)](https://travis-ci.org/javiercejudo/shunting-yard-arbitrary-precision)
[![Coverage Status](https://coveralls.io/repos/javiercejudo/shunting-yard-arbitrary-precision/badge.svg?branch=master)](https://coveralls.io/r/javiercejudo/shunting-yard-arbitrary-precision?branch=master)
[![Code Climate](https://codeclimate.com/github/javiercejudo/shunting-yard-arbitrary-precision/badges/gpa.svg)](https://codeclimate.com/github/javiercejudo/shunting-yard-arbitrary-precision)

Arbitrary precision support on top of [javascript-shunting-yard](https://github.com/droptable/javascript-shunting-yard), a mathematical expression parser.

## Install

    npm i shunting-yard-arbitrary-precision

## Usage

```js
const shunt = require('shunting-yard-arbitrary-precision');

Number(shunt('3+2')); //=> 5

// all following results are returned as Decimal
// with the floating adapter by default
shunt('3+2'); //=> 5 (as Decimal)
shunt('(10+5)/5'); //=> 3
shunt('3+(5*2)*(-3+2)'); //=> -7
shunt('2^3'); //=> 8

const decimalFactory = require('arbitrary-precision');
const Decimal = decimalFactory(require('bigjs-adapter'));

{'fraction_non_alphanumeric': 0.17614964925954793, 'fraction_numerical': 0.01558846453624318, 'mean_word_length': 5.937837837837838, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7400350', 'n_tokens_mistral': 928, 'n_tokens_neox': 853, 'n_words': 123}