Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0 Mark H Weaver (16 Dec 2012 03:27 UTC)

Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0 Mark H Weaver 16 Dec 2012 03:25 UTC

John Cowan <cowan@mercury.ccil.org> writes:

> Mark H Weaver scripsit:
>
>> Several implementations that are not able to represent mixed exactness
>> in the general case are able to do so in one special case: when the
>> imaginary part is exact 0.
>
> I don't think the behavior of `imag-part` is a reliable indication of this.
> It may be simply that it returns 0 when the argument is a flonum.

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.

     Mark

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports