> From:Mark H Weaver <[email protected]> > To:[email protected] > Cc:Andy Wingo <[email protected]>; Taylor R Campbell <[email protected]> > 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
