This is a Delphi Component (whose ancestor is TComponent) which lets you compile at run-time your mathematical formulas and to evaluate them.
Internally it converts the formula in Reverse Polish Notation where parenthesis and priority don't exist and then compile it in FPU (80387) code (which acts as a RPN calculator...).
You can use the following operators:
+
-
*
/
%
(module)... the following functions:
abs
chs
(unary minus) (if you wanted to write y=-x
you should code it like chs(x0)
and not -x0
)cos
sin
tan
atan
int
frac
log
(base 2)ln
exp
pos
(pos(x0)=max(x,0)
)and the constant pi
(3.14 and so on...).
You can use as many variables as you like, calling them x0, x1, ...
The source code is for Delphi 6, but it is in a bigger package...
Download | |
Source code in Delphi 6 | AndSoft.src.zip |