by Andreas Jdger
The inspiration to write this code was to have an easy-to-use parser for functions given as string. You have a string like
and you want to compute some values, maybe for displaying the graph of the function. You can write code like this:
long double y = fkt->Execute(1.5);
There are lots of definitions in the background, but the result is easy and fast! There is a one-time pasing step to construct the function tree, and function evaluations are only calls of standard math functions like sin, +, *, sqrt. When you want to know details about the implementaion, you should look into the source code. It would be too complex to describe the parsing algorithm here.
Download here:
Download demo source
Download demo app
Permalink: Code Library - A powerful math function parser(zz)
Subcribe the update with Google Reader.
RSS feed for comments on this post · TrackBack URI
Leave a reply