Skip to content
/ mather Public

A program that evaluates standard mathematical expressions using RDP algorithm

Notifications You must be signed in to change notification settings

Akimcx/mather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mather

This program evaluates standard mathematical expressions. The expressions can use real numbers and support the binary operations

  • Plus
  • Minus
  • Multiply
  • Divide

and the unary operations / function call

  • Negate
  • Factorial

The expressions are defined by the EBNF rules:

Expression = [ "-" | "+" ] Term { "-" | "+" Term };
Term = Factor { "*" | "/" Factor };
Factor = ( Number | "(" Expression ")"
        | Function_Name, "(" Expression ")" ) [ Unary_OP ];
Unary_OP = "!" | "%";
Function_Name = "sin" | "cos" | "tan" | "log" | "ln";
Number = Integer | Float;
Float = Integer, ".", Integer;
Integer = Digit { Digit };
Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;

Quick Start

./compile.sh
./run.sh

Build the project

About

A program that evaluates standard mathematical expressions using RDP algorithm

Resources

Stars

Watchers

Forks

Packages

No packages published