Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Expression Parser

This function can parse any string containing a mathematical expression like "2 * (34+1)/2 *sin(pi*3)/cosh(7)".
Usage: Pass a std::string to the constructor and the ExprParser will parse an expression that equals one number. That means that "3 4" will yield 3. Then you can use the following query functions:

getRemains() Returns the rest of the string that did get parsed
getResult() Query the result of the parsing
getSuccess() Tells whether any number could be retrieved at all

Supported functions

sin, asin, sinh, asinh, cos, acos, cosh, acosh, tan, atan, atan2, tanh, atanh, int, floor, ceil, abs, exp, log, ln, sign, sqrt, degrees, radians, mod, pow, div, max, min

Supported variables

pi 3.1415926535897932
e 2.7182818284590452
Last modified 8 years ago Last modified on Apr 12, 2017, 11:07:15 PM