Warning Don't use inexact->exact: it just pretends that something is exact 

Forum: Com Sci 12500, U Chicago, Autumn 2002, Discuss Classwork
Re: News Project Step #1, due Friday 8 November
Re: Note Observations on rational? and exact? (Mark Kittisopikul)
Re: Note inexact->exact (Mark Kittisopikul)
Date: 2002, Nov 07
From: Mike O'Donnell <odonnell@cs.uchicago.edu>

inexact->exact is not a good thing to use in this assignment. It doesn't really create "exact" values in the intuitive sense. It merely marks numbers as exact. It's proper use is to take a number that is the result of some approximations, do some tests to determine that the error has been driven to 0, then mark it as exact. That won't happen in our project.

If you think about it, there's no way to take an approximation by itself and make it exact. You have to have some additional information to know that the error has been reduced to 0.


(inexact->exact 0.3)
;Value: 5404319552844595/18014398509481984
This is a nice instructive case. What you type as 0.3 is converted to binary. Marking it "exact" makes Scheme treat it as an exact rational, with a big power of 2 as the numerator.

We can do this whole project with exact rationals. There's no need to bring in inexact guys at all. If you test an inexact number for membership in an interval, the result is meaningless unless you have some bound on the error in the inexact number.




Mike O'D.


to: "Don't use inexact->exact: it just pretends that something is exact"