[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: division by 0
From: |
Bernard Urban |
Subject: |
Re: division by 0 |
Date: |
Tue, 20 Apr 2004 15:21:06 +0200 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.2 (gnu/linux) |
Kevin Ryde <address@hidden> writes:
> Bernard Urban <address@hidden> writes:
>>
>> Is (/ 1 x) always equal to (/ x) in 1.7 ?
>> This is actually my problem. It originates in the fact that hobbit
>> converts (/ x) to (/ 1 x), and for x = 0, it fails for 1.6.
>
> You need to be clearer about what you're trying to report.
>
> If you're saying (/ 0) is not the same as (/ 1 0), then I see that's
> the case. My guess would be that's wrong, probably both ought to give
> errors (on the basis there's no multiplicative inverse of an exact
Page 20 of R5RS says: "This report recommends, but does not require,
that the IEEE 32-bit and 64-bit floating point standards be followed..."
Sot it is fine for guile to follow the standard (actually IEEE-754),
which implies treatment of infinity and NAN.
> zero). This is the case in the cvs head, perhaps it should be made so
> in the 1.6 series too.
>
My argument is one of coherence, and I always believed coherence
was in the spirit of scheme:
guile> (/ 3)
0.333333333333333
guile> (/ 3.0)
0.333333333333333
guile> (/ 1 3)
0.333333333333333
guile> (/ 1 3.0)
0.333333333333333
guile> (/ 0)
+#.#
guile> (/ 0.0)
+#.#
guile> (/ 1 0)
standard input:16:1: In procedure / in expression (/ 1 0):
standard input:16:1: Numerical overflow
ABORT: (numerical-overflow)
guile> (/ 1 0.0)
+#.#
guile>
--
Bernard Urban