[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Equality predicates, signed zeroes, R5RS and R6RS
From: |
Mike Gran |
Subject: |
Re: Equality predicates, signed zeroes, R5RS and R6RS |
Date: |
Mon, 31 Jan 2011 13:36:48 -0800 (PST) |
> From:Mark H Weaver <address@hidden>
> To:address@hidden
> Cc:Andy Wingo <address@hidden>; Taylor R Campbell <address@hidden>
> Sent:Monday, January 31, 2011 11:53 AM
> Subject:Equality predicates, signed zeroes, R5RS and R6RS
>
> An issue has come to my attention that deserves wider discussion.
>
> Since at least Guile 1.8, (= 0.0 -0.0) has returned #t
> but (eqv? 0.0 -0.0) has returned #f, and this is still the case.
>
> PLT Scheme agrees with us that (eqv? 0.0 -0.0) is #f, but MIT/GNU Scheme,
> SCM, Chicken, and Gauche all return #t in this case.
As an aside, as of a couple of months ago, it was possible to create
the following seven versions of zero in Guile using the default reader.
0, ±0.0, ±0.0±0.0i
Note that there is no way to make negative zero integer (-0). And
there are no zero rationals: ±0/2, for example.
Each scheme has its quirks.
MzScheme 4.1 would let you create complex numbers with integer representation
real and float representation imaginary parts: 0+0.0i, for example. The integer
parts can only be positive zero and the float parts can be ±0.0.
But as a physicist, I declare that this is all madness.
-Mike