Duplicate
I need a program in Delphi that get one variable equation from Edit1 such as "F(x)=4*X+2*log(x)+4*power(X,2)"
and get X value variable from Edit2 then show the result F(X) in Edit3. Please help me.
Thanks.
I need a program in Delphi that get one variable equation from Edit1 such as "F(x)=4*X+2*log(x)+4*power(X,2)"
and get X value variable from Edit2 then show the result F(X) in Edit3. Please help me.
Thanks.
You can also check out JCL, which comes with an expression evaluator in the file JclExprEval.pas. It's free and open source.
You probably need to have a look at this component - TbcParser.
https://www.mathparsers.com/formula-parser-for-delphi/
This component has source code included.
Have a look at
http://www.efg2.com/Lab/Library/Delphi/MathFunctions/Parsers.htm
Also, if you have JEDI and/or FastReport libraries installed you can use their parsers. We use TParser10 from http://cc.embarcadero.com/item/15974 which is one of the fastest available if not the fastest. It is freeware and work flawlessly up to D2007. I heard that it works also in D2009. Not tested yet though.