snow-varus

0.0.1 • Public • Published

Overview

Implement equation evaluate by stack with fraction support. Input equation by array of elements. Element can be number, fraction, operator and parentheses.

Purpose

Handle equation when already know all terms and operators.

Demo

❯ yarn dev

Start!!!
Compute: 1 + 2 * 3 = 3
Compute: 1 + 2 * 3 = 7
Compute: (1 + 2) * 3 = 9
Compute: 1 + (1/2) = 1.5
Compute: 1 + (1/3) = 1.3333333333333333
Compute: 1 + (1/3) + (1/2)= 1.8333333333333333
Finish!!!
Start Fraction!!!
Compute: 1 + 2 * 3 = 3/1
Compute: 1 + 2 * 3 = 7/1
Compute: (1 + 2) * 3 = 9/1
Compute: 1 + (1/2) = 3/2
Compute: 1 + (1/3) = 4/3
Compute: 1 + (1/3) + (1/2)= 11/6
Finish Fraction!!!

Readme

Keywords

none

Package Sidebar

Install

npm i snow-varus

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

18.2 kB

Total Files

11

Last publish

Collaborators

  • vuaduahau