Does anyone know of a free c++ library that takes a formula as a string and returns the result as a float/double? It would be nice if it supports complex mathematics such as calculus and whatnot, but at bare minimum I need something that can parse and calculate basic math and trigonometry.
It's primarily used for a graphing application I'm working on.
Thanks.
Looking for a library
Started by TheNut, Apr 04 2008 03:46 AM
7 replies to this topic
#3
Posted 04 April 2008 - 04:27 AM
In the event you can't find a library that works for you, it wouldn't be very hard at all to build a parser using antlr or bison that would do the job (including evaluating expressions).
reedbeta.com - developer blog, OpenGL demos, and other projects
#4
Posted 04 April 2008 - 06:49 AM
#5
Posted 04 April 2008 - 08:18 AM
http://smallcode.weblogs.us/
Scroll down a bit and you'll find a expression evaluator code with variables and dynamic code generation.
Nils
Scroll down a bit and you'll find a expression evaluator code with variables and dynamic code generation.
Nils
My music: http://myspace.com/planetarchh <-- my music
My stuff: torus.untergrund.net <-- some diy electronic stuff and more.
My stuff: torus.untergrund.net <-- some diy electronic stuff and more.
#6
Posted 04 April 2008 - 11:30 AM
Thanks, these are all good. I'll spend some time tonight going through each one and checking them out.
http://www.nutty.ca - Being a nut has its advantages.
#7
Posted 04 April 2008 - 08:05 PM
Let us know which one you'll use :-)
Nils
Nils
My music: http://myspace.com/planetarchh <-- my music
My stuff: torus.untergrund.net <-- some diy electronic stuff and more.
My stuff: torus.untergrund.net <-- some diy electronic stuff and more.
#8
Posted 05 April 2008 - 02:24 AM
One of the first few chapters in The C++ Programming Language covers the basics of writing a symbolic calculator yourself (without grammars, parser tables, etc... ).
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












