[Top][All Lists]

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

Re: real == frac

From: Marius Vollmer
Subject: Re: real == frac
Date: Sun, 30 Nov 2003 02:31:21 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Kevin Ryde <address@hidden> writes:

> 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.

Yes, that would be an improvement.  Could you implement it?

GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405

reply via email to

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