chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] Patch for ticket #1587


From: John Cowan
Subject: Re: [Chicken-hackers] Patch for ticket #1587
Date: Thu, 28 Feb 2019 17:35:52 -0500

I agree also given the existence of complex demotion in Chicken, whereby (make-rectangular 1.0 0.0) => (the flonum 1.0).  On the other hand, I think complex demotion is actually a Bad Thing because it means that inexactness in the computation of the imaginary part can make an inexact complex number into a real number, even though the imaginary part isn't truly zero.

On Thu, Feb 28, 2019 at 3:44 PM <address@hidden> wrote:
> On Thu, Feb 28, 2019 at 02:25:33PM -0500, John Cowan wrote:
> > See the ticket for explanations.
>
> After discussing on IRC, I'm not sure I believe this is correct.
> Given that we don't support complex numbers of mixed exactness, it
> makes more sense to return 0.0 for the imaginary part of a flonum.
>
> Inexactness is contagious in complex numbers; if any of the two
> parts are inexact, the entire number is inexact.  I think it's
> quite counter-intuitive to return exact zero for the imaginary part
> of a flonum, even though we know it to be "not there", so exactly
> zero.  So given that, I would lean towards keeping the current
> behaviour, especially since this would strictly speaking require
> us to go through the change request process.
>
> What do others think about this?
>

Exactness-preservation is exactly the right thing, I think.


felix


reply via email to

[Prev in Thread] Current Thread [Next in Thread]