<commit_before># `S`mart `Calc`ulator
Smart Calculator for Nodejs without using `eval` function.

Focus on keeping the native math expression with all type of [Polish notations](https://en.wikipedia.org/wiki/Polish_notation).
Full-Supported the [JS's Math functions](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Math) with some extension functions.

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
[![build status](https://secure.travis-ci.org/dominhhai/calculator.svg)](http://travis-ci.org/dominhhai/calculator)
[![browser support](https://ci.testling.com/dominhhai/calculator.png)](https://ci.testling.com/dominhhai/calculator)

# Show case
## infix
```
100 = 100
1 + -5 = -4
-1 + 5 = 4
-1 + -5 = -6
abs[-1] + 2 = 3
abs[-1] + 2^3 = 9
-1 - |-3| + 2^5 = 28
-10 - abs(-3) + 2^5 = 18
-1 - abs(-3) + pow[2, 5] = 28
sin(90) + 5 = 5.893996663600558
(PI - 1) * 3 = 6.424777960769379
PI + 1 + 10%3 = 5.141592653589793
```

## prefix
```
+ 1 -5 = -4
+ -1 5 = 4
+ -1 -5 = -6
+ abs[-1] 2 = 3
+ abs[-1] 2^3 = 9
+ - -1 |-3| 2^5 = 28
+ - -10 abs(-3) 2^5 = 18
+ - -1 abs(-3) pow[2, 5] = 28
+ sin(90) 5 = 5.893996663600558
* - PI 1 3 = 6.424777960769379
+ + PI 1 10%3 = 5.141592653589793
```

## postfix
```
1 -5 + = -4
-1 5 + = 4
-1 -5 + = -6
abs[-1] 2 + = 3
abs[-1] 2^3 + = 9
-1 |-3| - 2^5 + = 28
-10 abs(-3) - 2^5 + = 18
-1 abs(-3) - pow[2, 5] + = 28
sin(90) 5 + = 5.893996663600558
PI 1 - 3 * = 6.424777960769379
PI 1 + 10%3 + = 5.141592653589793
```

# Installation
Global scope:
`npm install scalc -g`

Local scope:
`npm install scalc --save`

# Usage
## Command Line
Wrap your expression with double quotes or single quotes
`scalc "your_expression"`

or without any quotes
`scalc your_expression`

E.x: `scalc "1 + 5*(PI - 10 * 2^5)"` or `scalc 1 + 5*(PI - 10 * 2^5)`
## API
```
var scalc = require('scalc')
var result = scalc(your_expression)
```

# Contributing
Feel free to send your PRs!

1. Fork it ٩◔̯◔۶
2. Install dependencies: `npm install`
3. Test your changes: `npm test`
3. Commit your changes: `git commit -m 'Add some feature'`
4. Push to your repo: `git push`
5. Submit a pull request ♥‿♥

✌(-‿-)✌ You can use [git-u](https://www.npmjs.com/package/git-u) for quicker clone: `git-u your_name your_repo`

# License
[MIT](https://github.com/dominhhai/calculator/blob/master/LICENSE)
<commit_msg>Add clipboard info<commit_after># `S`mart `Calc`ulator
Smart Calculator for Nodejs without using `eval` function.

Focus on keeping the native math expression with all type of [Polish notations](https://en.wikipedia.org/wiki/Polish_notation).
Full-Supported the [JS's Math functions](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Math) with some extension functions.

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
[![build status](https://secure.travis-ci.org/dominhhai/calculator.svg)](http://travis-ci.org/dominhhai/calculator)
[![browser support](https://ci.testling.com/dominhhai/calculator.png)](https://ci.testling.com/dominhhai/calculator)

# Show case
## infix
```
100 = 100
1 + -5 = -4
-1 + 5 = 4
-1 + -5 = -6
abs[-1] + 2 = 3
abs[-1] + 2^3 = 9
-1 - |-3| + 2^5 = 28
-10 - abs(-3) + 2^5 = 18
-1 - abs(-3) + pow[2, 5] = 28
sin(90) + 5 = 5.893996663600558
(PI - 1) * 3 = 6.424777960769379
PI + 1 + 10%3 = 5.141592653589793
```

## prefix
```
+ 1 -5 = -4
+ -1 5 = 4
+ -1 -5 = -6
+ abs[-1] 2 = 3
+ abs[-1] 2^3 = 9
+ - -1 |-3| 2^5 = 28
+ - -10 abs(-3) 2^5 = 18
+ - -1 abs(-3) pow[2, 5] = 28
+ sin(90) 5 = 5.893996663600558
* - PI 1 3 = 6.424777960769379
+ + PI 1 10%3 = 5.141592653589793
```

## postfix
```
1 -5 + = -4
-1 5 + = 4
-1 -5 + = -6
abs[-1] 2 + = 3
abs[-1] 2^3 + = 9
-1 |-3| - 2^5 + = 28
-10 abs(-3) - 2^5 + = 18
-1 abs(-3) - pow[2, 5] + = 28
sin(90) 5 + = 5.893996663600558
PI 1 - 3 * = 6.424777960769379
PI 1 + 10%3 + = 5.141592653589793
```

# Installation
Global scope:
`npm install scalc -g`

Local scope:
`npm install scalc --save`

# Usage
## Command Line
Wrap your expression with double quotes or single quotes

`scalc "your_expression"`

`scalc 'your_expression'`

or without any quotes

`scalc your_expression`

E.x: `scalc "1 + 5*(PI - 10 * 2^5)"` or `scalc 1 + 5*(PI - 10 * 2^5)`

The result will be copid to the system clipboard, so you can easily paste to anywhere.

## API
```
var scalc = require('scalc')
var result = scalc(your_expression)
```

# Contributing
Feel free to send your PRs!

1. Fork it ٩◔̯◔۶
2. Install dependencies: `npm install`
3. Test your changes: `npm test`
3. Commit your changes: `git commit -m 'Add some feature'`
4. Push to your repo: `git push`
5. Submit a pull request ♥‿♥

✌(-‿-)✌ You can use [git-u](https://www.npmjs.com/package/git-u) for quicker clone: `git-u your_name your_repo`

# License
[MIT](https://github.com/dominhhai/calculator/blob/master/LICENSE)

{'fraction_non_alphanumeric': 0.18769043266301036, 'fraction_numerical': 0.12268941702214096, 'mean_word_length': 3.345984112974404, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 18, 'lorem ipsum': 0, 'www.': 2, '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': '1902896', 'n_tokens_mistral': 2434, 'n_tokens_neox': 2029, 'n_words': 564}