[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

real == frac

From: Kevin Ryde
Subject: real == frac
Date: Sat, 22 Nov 2003 06:58:55 +1000
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

I noticed that

        (= 0.5 (+ 1/2 (/ 1 (ash 1 1000))))

gives #t, but I think with exact fractions it should now be #f, since
the second arg is 1/2+1/2^1000, not an actual 0.5.

I guess fraction2double is rounding, making the comparison not quite
right.  Going the other way, converting double to fraction and
comparing fractions would avoid that.

I suspect the same applies to all uses of fraction2double in <, min
and max too.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]