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

*To*: John Cowan <cowan@x>*Subject*: Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0*From*: Mark H Weaver <mhw@x>*Date*: Wed, 19 Dec 2012 14:29:35 -0500*Cc*: scheme-reports <scheme-reports@x>*In-reply-to*: <20121216041031.GE10312@mercury.ccil.org> (John Cowan's message of "Sat, 15 Dec 2012 23:10:32 -0500")*References*: <CAMMPzYOKcOm+trYA0Fc+NtWfG00K0BM4hvghsxrr6L9wnCyhuQ@mail.gmail.com> <87d2yf80q3.fsf@tines.lan> <20121214223854.GX29857@mercury.ccil.org> <CAGUt3y55KEVFn=6_i9yRXR8w_e8Nk2tN7QGCF8rEhYTs2Xgrjw@mail.gmail.com> <878v8z5iq8.fsf@tines.lan> <874njn5b65.fsf@tines.lan> <20121215204015.GG13463@mercury.ccil.org> <87obhv3ts0.fsf@tines.lan> <20121215231548.GC10312@mercury.ccil.org> <87bodu4r0r.fsf@tines.lan> <20121216041031.GE10312@mercury.ccil.org>

John Cowan <cowan@x> writes: > Mark H Weaver scripsit: > >> There are several other ways of checking for this, such as: >> >> (eqv? 1.0+0.0i 1.0+0i) >> >> and >> >> (eqv? (make-rectangular 1.0 0.0) >> (make-rectangular 1.0 0)) >> >> For the three implementations I mentioned (Guile 2, Racket, and Ikarus) >> the expressions above return #f. > > Those are also consistent with (make-rectangular x 0) simply returning > a flonum. Who cares? The number of fields used internally to represent 1.0+0.0i or 1+0i has no relevance to the user or to the Scheme standards. As you know, reals are a subset of the complex numbers, and thus flonums count as a representation of complex numbers. My point is that your ComplexRepresentation page states that Guile and Racket do not support complex numbers of mixed exactness, but that's not quite true. There is one important special case of mixed exactness that *is* supported in Guile, Racket, Ikarus, and perhaps others. > I tried the 45 Schemes (less those with no make-rectangular support) with > this expression: > > (let > ((m (make-rectangular 2.0 2)) > (z (make-rectangular 2.0 0))) > (list m z (real? m) (real? z))) > > All the Schemes, except those which don't support make-rectangular, replied > either (2.0+2i 2.0 #f #t) or (2.0+2.0i 2.0 #f #t), I really don't see any point to this test that you did. Of course, in any implementation that is not utterly broken, (make-rectangular 2.0 0) is 'real?' and (make-rectangular 2.0 2) is not. If you had run one of the tests I gave above, then we might have learned something to help improve your ComplexRepresentations page. Another test that would be worthwhile is this: (list (eqv? +0.0 -0.0) (eqv? (make-rectangular +0.0 1.0) (make-rectangular -0.0 1.0)) (eqv? (make-rectangular 1.0 +0.0) (make-rectangular 1.0 -0.0)) I wouldn't be surprised if some Schemes distinguish signed zeroes in the real part but not in the imaginary part. If an implementation discards inexact zero imaginary parts, then it probably discards the sign as well as the exactness. Mark _______________________________________________ Scheme-reports mailing list Scheme-reports@x http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports

**Follow-Ups**:**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0***From:*John Cowan <cowan@x>

**References**:**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0***From:*Alex Shinn <alexshinn@x>

**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0***From:*Mark H Weaver <mhw@x>

**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0***From:*John Cowan <cowan@x>

**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0***From:*Sascha Ziemann <ceving@x>

**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0***From:*Mark H Weaver <mhw@x>

**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0***From:*Mark H Weaver <mhw@x>

**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0***From:*John Cowan <cowan@x>

**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0***From:*Mark H Weaver <mhw@x>

**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0***From:*John Cowan <cowan@x>

**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0***From:*Mark H Weaver <mhw@x>

**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0***From:*John Cowan <cowan@x>

- Prev by Date:
**Re: [Scheme-reports] Tracking change in the Scheme reports** - Next by Date:
**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0** - Previous by thread:
**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0** - Next by thread:
**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0** - Index(es):