Mail Archives: djgpp/1994/09/14/20:40:22
On Tue, 13 Sep 1994, Duncan Sands wrote:
> Can anyone help me:
> I am writing a program ( using DJ's gcc - which is great by the way! )
> which needs to evaluate a user specified mathematical function of several
> variables like sin(x*y) fairly rapidly for many x and y values. I appreciate
> that the best way to do this might be to link in object code defining
> the function but this is not feasible for me: the people specifying the
> function may not even know what a compiler is. This seems
> to leave me the task of parsing the user's input into some sort of
> tree structure and then using this to evaluate the function.
>
You could try the gnuplot source code -- it contains routines for
parsing functions. Gnuplot is available at prep.ai.mit.edu and
other GNU mirrors (even a DOS version).
Gordon
- Raw text -