[plt-scheme] fractions and decimals

From: Jefferson Provost (jp at cs.utexas.edu)
Date: Sun Jan 19 21:39:56 EST 2003

Stephen Bloch wrote:
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> I'm playing with the new "test suite" feature, and was surprised to 
> discover that (cube 1/2) is NOT 0.125 (although it DOES match 1/8). On 
> further investigation, I found that (equal? 0.125 1/8) returns true in 
> Beginner mode, but #f in R5RS and textual mzscheme.  Whazzap?

Note that (equal? ...) doesn't work the way you want but (= ...) does:


 > (equal? 1/8 0.125)
#f
 > (= 1/8 0.125)
#t
 >

Jeff



Posted on the users mailing list.