www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/09/14/20:40:22

Date: Wed, 14 Sep 1994 11:39:08 -0700 (PDT)
From: Gordon Hogenson <ghogenso AT u DOT washington DOT edu>
Subject: Re: User defined functions
To: Duncan Sands <sands AT clipper DOT ens DOT fr>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019