home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!bu.edu!news.tufts.edu!jade.tufts.edu!slahiri
- From: slahiri@jade.tufts.edu (Sandip Lahiri)
- Newsgroups: comp.lang.c
- Subject: How can you evaluate an arbitrary function?
- Message-ID: <1993Jan6.202453.8630@news.tufts.edu>
- Date: 6 Jan 93 20:24:53 GMT
- Sender: news@news.tufts.edu (USENET News System)
- Organization: Tufts University - Medford, MA
- Lines: 11
-
- Suppose you have to write a program which would accept any arbitrary
- function f(x) and calculate its values for x = ... . The program has
- to be written in C. How would you go about it ? Note, common lisp
- does have the eval primitive and this task is considerably easier
- if the program is written in lisp. Should you write a parser first to
- check the input ? Remember we can have a function nested to any
- arbitrary depth e.g. f(x) = tan(tanx + sin(cos(sinx + x^2)) + 5).
- Any help/pointers most welcome.
- Thanx in advance.
-
- Sandip
-