Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goCalculator

Calculator which can evaluate basic mathematical expressions. It has lexer and parser.

installation

go install github.com/HayKor/goCalculator

Usage

package main

import (
	"fmt"

	calc "github.com/HayKor/goCalculator/pkg/calculator"
)

func main() {
	input := "5 + 3 * (2 - 1)"
	result, err := calc.Calc(input)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(result) // Output: 8
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages