reverse-polish-notation
v0.1.0
Published
Reverse Polish Notation - Javascript implementation
Downloads
10
Maintainers
Readme
node-reverse-polish-notation
Reverse Polish Notation - Native Javascript implemenation
Installation
npm i reverse-polish-notation
Usage
** see code samples in ./test
directory **
var rpn = require('reverse-polish-notation')
console.log(rpn('5 1 2 + 4 * + 3 -')) // prints "14"
console.log(rpn('3 4 5 * -')) // prints "-17"
console.log(rpn('3.1 -4.3 5.6 * -')) // prints "27.18"
References
- https://en.wikipedia.org/wiki/Reverse_Polish_notation
License
MIT