pedroth / BitCalculator

A simple BitCalculator language

Home Page:https://pedroth.github.io/BitCalculator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BitCalculator

Simple binary calculator

Available operators

*, /, +, -, ()

Numbers in binary

11.0010010 ~ 3.14

-101 = -5

Grammar

Program -> Expression Program | epsilon
Expression -> S;
S -> N + S | N + F | F + S | F
S -> N - S | N - F | F - S 
F -> N * F | N * E | E * F | E
F -> N / F | N / E | E / F
E -> (S) | N
N -> D.D | -D.D | D | -D
D -> 0D | 1D | epsilon

Examples

(1 + 1.1) * 0.1; \\ 1.25

1 + 1 + 1 * 10; \\ 4

Playground

https://pedroth.github.io/BitCalculator

About

A simple BitCalculator language

https://pedroth.github.io/BitCalculator

License:Apache License 2.0


Languages

Language:JavaScript 93.1%Language:HTML 3.5%Language:CSS 3.4%