home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.scheme
- Path: sparky!uunet!brunix!brunix!mj
- From: mj@cs.brown.edu (Mark Johnson)
- Subject: Why is the exact/inexact distinction built into Scheme?
- Message-ID: <1992Nov17.182740.11194@cs.brown.edu>
- Sender: news@cs.brown.edu
- Organization: Brown University Department of Computer Science
- Date: Tue, 17 Nov 1992 18:27:40 GMT
- Lines: 24
-
- As someone attempting to use Scheme to solve real world
- problems, I often find that I need to floor or round
- inexact reals to exact integers. In the Scheme I'm using,
- (inexact->exact (round x)) is comparitavely slow (so much so that
- it slows my image processing routines considerably).
-
- As I sit waiting for my machine to finish a job that a
- corresponding C program would have completed 15 mins or so
- earlier, I keep wondering what it was that inspired the
- Scheme language designers to build in the inexact/exact
- distinction.
-
- Are there so many algorithms that depend on distinguishing
- inexact from exact numbers that it was important to build
- the distinction into Scheme? Isn't it the case that it would
- be easy to write a generic arithmetic package that supports
- the inexact/exact distinction in a version of Scheme that
- didn't support this distinction?
-
- Mark
-
- Mark Johnson
- Cognitive Science, Box 1978
- Brown University
-