home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19325 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  950 b 

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