This project aims to make a simple calculator app. It also aims to make it better with simplicity. The project discourage use of any external dependency (mostly). External tools for maintenance are acceptable.
- Number: int or float or their scientific form
- binary operators:
+ (plus)
,- (minus)
,* (multiply)
,/ (divide)
,% (modulus)
,** (power)
- unary operators:
+ (positive)
,- (negative)
- operator precedence (supports
BODMAS
) - brackets allowed
(
and)
- supports functions and constants.
- functions can have fixed, optional or atleast one args
- decent GUI & CLI application.
Running GUI application:
python -m calc.app
Running as CLI application (see help):
python -m calc -h
Running the program:
python main.py
- only be watching for errors or bugs issues.
- No PR's
EXPR := TERM
| (PLUS | MINUS) EXPR
EXPRS := EXPR
| COMMA EXPRS
TERM := FACTOR
| (MUL | DIV | MOD | POW) TERM
FACTOR := NUM
| LAPREN EXPR RPAREN
| (PLUS | MINUS) FACTOR
| NAME LPAREN EXPRS RPAREN
| NAME
PLUS := '+'
MINUS := '-'
MUL := '*'
DIV := '/'
MOD := '%'
POW := '**'
LPREN := '('
RPAREN := ')'
COMMA := ','
NUM := '[0-9]+(\.[0-9]+)?([+-]?[eE][0-9]+)?'