[plt-scheme] Exact/inexact behavior?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Nov 27 09:42:07 EST 2003

On Thursday, November 27, 2003, at 09:32 AM, Shriram Krishnamurthi 
wrote:

>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> Matt wrote:
>
>> Do we get the .0000000000000003 free in both cases?
>
> This is just the usual floating point noise, right?

G. L. Steele Jr. and J. L. White. How to print floating-point numbers 
accurately . In Proceedings of the ACM SIGPLAN '90 Conference on 
Programming Language Design and Implementation, pages 112--126, White 
Plains, New York, June 1990

>
> Put differently, if I try it (suitably adapted) in Beginner Scheme,
>
>> (+ 0.051 0.042
>                 0.042 0.048
>                 0.042 0.042
>                 1.193 0.042
>                 0.042 0.288
>                 1.762)
> 3.594
>
> Your OS X calculator is similarly using exact rationals (in the form
> of fixed-point numbers).
>
> I guess I don't quite understand your question.

Matt, in the first four language levels we read . numbers as rationals 
and
compute with them as such. In "real" Scheme, they are read as inexacts
and when you do inexact arithmetic your computer lies. DrScheme warns
you with #i that things are going bad .. most languages just lie.

-- Matthias

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1376 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20031127/89235efc/attachment.bin>

Posted on the users mailing list.