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

*To*: Sascha Ziemann <ceving@x>*Subject*: Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0*From*: Mark H Weaver <mhw@x>*Date*: Sat, 15 Dec 2012 12:27:11 -0500*Cc*: scheme-reports <scheme-reports@x>*In-reply-to*: <CAGUt3y55KEVFn=6_i9yRXR8w_e8Nk2tN7QGCF8rEhYTs2Xgrjw@mail.gmail.com> (Sascha Ziemann's message of "Sat, 15 Dec 2012 16:32:26 +0100")*References*: <8738zc9g2x.fsf@tines.lan> <CAMMPzYOKcOm+trYA0Fc+NtWfG00K0BM4hvghsxrr6L9wnCyhuQ@mail.gmail.com> <87d2yf80q3.fsf@tines.lan> <20121214223854.GX29857@mercury.ccil.org> <CAGUt3y55KEVFn=6_i9yRXR8w_e8Nk2tN7QGCF8rEhYTs2Xgrjw@mail.gmail.com>

Sascha Ziemann <ceving@x> writes: > 2012/12/14 John Cowan <cowan@x>: >>> For example, this reversal means that (max 1.0+0.0i 1.0-0.0i) is >>> permitted, and the result is no longer uniquely determined. >>> What should the result be? >> >> I'd say it's correct to return either one, since they are =. > > Wolfram thinks it is neither the first nor the second: > > http://www.wolframalpha.com/input/?i=max+%281.0%2B0.0i%2C+1.0-0.0i%29 Scheme is unusual in that it distinguishes between exact and inexact numbers, and keeps track of whether the results of numerical operations are exact or inexact. If the 'exact?' predicate answers true to the result of a computation, then you can be assured that the answer is precisely mathematically correct (assuming that the Scheme implementor did his job properly). Notationally, 0.0 is an inexact zero and 0 is the exact zero. Therefore, in Scheme notation, 1.0 (i.e. 1.0+0i) has a different meaning than 1.0+0.0i. In the case of 1.0, the imaginary part is known to be exactly zero, whereas for 1.0+0.0i the imaginary part is merely estimated to be approximately zero. Common Lisp, and (as far as I can tell) Wolfram Alpha do not keep track of the exactness of their results, so they can simply turn 1.0+0.0i into 1.0. Regards, 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:*Mark H Weaver <mhw@x>

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

**References**:**[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:*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>

- Prev by Date:
**Re: [Scheme-reports] Strong win later reversed: Real numbers have imaginary part #e0** - 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):