Skip to content

A simple mathematical expressions evaluator written in Scala.

License

Notifications You must be signed in to change notification settings

sirIrishman/calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calculator

Build and tests status

master Build Status

A simple mathematical expressions evaluator written in Scala.

The calculator converts an input infix expression into the Reverse Polish notation (RPN) form using the Shunting-yard algorithm and then evaluates the postfix expression using the Postfix algorithm. Input expressions are processed case-insensitively.

Changelog

0.1 version:

  • integer and floating-point numbers;
  • positive and negative numbers;
  • algebraic operators:
    • + addition;
    • - subtraction;
    • / division;
    • * multiplication;
  • () parentheses (with no limits for nesting).

0.2 version:

  • algebraic operators;
    • % modulo;
    • ^ power;
  • constants:
    • pi;
    • e;
  • bug fixes.

Plans for future releases:

  • improve error handling (handle all types of invalid expressions with providing meaningful messages);
  • extend number of operators (bit operations, ...);
  • predefined mathematical functions (trigonometric: sin(x), tan(x), ...; roots: sqrt(x), root(x,y); ...);
  • variables.

About

A simple mathematical expressions evaluator written in Scala.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages