Warning We'd better use exact rationals 

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)
Date: 2002, Nov 07
From: Mike O'Donnell <odonnell@cs.uchicago.edu>

That really surprises me. Here are some others that worry me even more:


(rational? (exp 1.0))
;Value: #t

(exp 100.0)
;Value: 2.6881171418161356e43

(rational? (exp 100.0))
;Value: #t
I can't think of any way to produce a real number that is not rational. If somebody can, please post it. I also tried these examples in mzscheme, which is the implementation inside of Dr Scheme. It's the same.

If we start doing inexact operations on endpoints of intervals, we'll invalidate all of our claims to exactness of the real numbers that they converge to. So, let's use only exact rationals. The predicate exact-rational? appears to test for just the right thing.




Mike O'D.


Messages

1. Question Endpoints only? by Mark Kittisopikul, 2002, Nov 07
1. Feedback Let's stick to exact rationals in all cases by Mike O'Donnell, 2002, Nov 07
2. More Robby Findler confirms that all Scheme reals are rationals by Mike O'Donnell, 2002, Nov 11

to: "We'd better use exact rationals"