[plt-scheme] Exact/inexact behavior?

From: Matt (mcj4 at kent.ac.uk)
Date: Thu Nov 27 09:21:16 EST 2003

Hi all,


Welcome to MzScheme version 204, Copyright (c) 1995-2003 PLT
> (define foo '(0.051 0.042
                0.042 0.048
                0.042 0.042
                1.193 0.042
                0.042 0.288
                1.762))
> (apply + foo)
3.5940000000000003

and

Chez Scheme Version 6.9b
Copyright (c) 1985-2003 Cadence Research Systems

> (define foo '(0.051 0.042
                0.042 0.048
                0.042 0.042
                1.193 0.042
                0.042 0.288
                1.762))
> (apply + foo)
3.5940000000000003

Do we get the .0000000000000003 free in both cases? The OS X caclulator
gives me "3.594". This came up as I was introducing someone to Scheme in
the context of a little script to add up the cost of calls on their phone
bill.

Just my 2.0000000000004 cent question for the day,
Matt ;)


Posted on the users mailing list.