peter-mount / calculator

A golang library providing a simple calculator which can parse and process basic mathematics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

calculator

This is a prototype parser & evaluator for handling basic mathematics based on a string.

For example:

  • "1 + 2" should parse into a tree which when executed returns 3

The purpose of this is where I have some requirements for creating rules for testing metrics collected from the rail open data feeds. These rules need to be read at run time so they need evaluating at run time.

I was going to do something simple but decided that I needed something generic - hence this project.

Right now it doesn't work other than compile, but it's being worked on.

About

A golang library providing a simple calculator which can parse and process basic mathematics

License:Apache License 2.0


Languages

Language:Go 93.2%Language:Shell 4.5%Language:Dockerfile 2.3%