home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / scheme / 2602 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.2 KB  |  35 lines

  1. Newsgroups: comp.lang.scheme
  2. Path: sparky!uunet!brunix!brunix!mj
  3. From: mj@cs.brown.edu (Mark Johnson)
  4. Subject: Why is the exact/inexact distinction built into Scheme?
  5. Message-ID: <1992Nov17.182740.11194@cs.brown.edu>
  6. Sender: news@cs.brown.edu
  7. Organization: Brown University Department of Computer Science
  8. Date: Tue, 17 Nov 1992 18:27:40 GMT
  9. Lines: 24
  10.  
  11. As someone attempting to use Scheme to solve real world
  12. problems, I often find that I need to floor or round 
  13. inexact reals to exact integers.  In the Scheme I'm using,
  14. (inexact->exact (round x)) is comparitavely slow (so much so that
  15. it slows my image processing routines considerably).
  16.  
  17. As I sit waiting for my machine to finish a job that a
  18. corresponding C program would have completed 15 mins or so
  19. earlier, I keep wondering what it was that inspired the
  20. Scheme language designers to build in the inexact/exact
  21. distinction.
  22.  
  23. Are there so many algorithms that depend on distinguishing
  24. inexact from exact numbers that it was important to build
  25. the distinction into Scheme?  Isn't it the case that it would
  26. be easy to write a generic arithmetic package that supports
  27. the inexact/exact distinction in a version of Scheme that
  28. didn't support this distinction?
  29.  
  30. Mark
  31.  
  32. Mark Johnson
  33. Cognitive Science, Box 1978
  34. Brown University
  35.