Skip to content

markknol/hx-mathparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MathParser

Evaluates math expressions. Uses Haxe. I think it could be used in all platforms, no dependencies on haxe libs/OpenFl/Flambe.

Examples

MathParser.parse("1+2-3/4*5"); 
// returns -0.75

MathParser.parse("1+2--3/4*5"); 
// returns 6.75

MathParser.parse("(1+2--3)/4*5"); 
// returns 7.5

MathParser.parse("(1+2- -3)/(((4*.5)))"); 
// returns 3.0

MathParser.parse("(.1+.2- -.3)/(.4*.5)"); 
// returns 3.0000000000000004

MathParser.parse("0xFF * 10"); 
// returns 2550

The parser assumes that the given expression is valid

About

Evaluates math expressions. Written in Haxe.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages