Skip to content

An implementation of the shunting-yard algorithm in Java.

Notifications You must be signed in to change notification settings

Hc747/Canvaculator

Repository files navigation

A simple calculator written in Java 21 implementing the shunting yard algorithm.

Example

public static void main(String[] args) {
  final var calculator = new ShuntingYardExpressionEvaluator(new InfixExpressionTokeniser());
  final var expression = "-3 + ((4 * 2) / ((1 - 5) ^ (2 ^ 3)))";
  final var result = calculator.evaluate(expression); // -2.9998779296875
}

About

An implementation of the shunting-yard algorithm in Java.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages