Modern calculator build in HTML, CSS and Javascript. A custom grammar was built with PEG.js.
Demo : https://camillebaronnet.github.io/calculator/dist/index.html
- Addition, substraction, multiplication, division
- Custom variables with emoji support, accents and underscore
- Comment line support with hashtag
- Live result for each line
- Line highlight at mouseover of the result
- Syntax highlighting
- Support common mathematical constants (pi, e, ln10, ln2, log10e, log2e, sqrt1_2, sqrt2)
Download or clone the project and run /dist/index.html
on modern browser.
Clone the projet and download dependencies :
git clone [email protected]:camillebaronnet/calculator.git
cd calculator/
npm install
Work on grammar src/grammar.pegjs
:
npm run watch
Finally, build before commit :
npm run build