Re: Signed imaginary zero

Felix Winkelmann via Chicken-users <[email protected]> Tue, 14 Jul 2026 21:19:44 +0200
Newsgroups gmane.lisp.scheme.chicken
Message-ID <[email protected]>
On Mon Jul 13, 2026 at 4:42 AM CEST, Peter McGoron via Chicken-users wrote:
> In CHICKEN 6 (and CHICKEN 5) there is a signed real zero but no signed=20
> imaginary zero:
>
> * -0.0i reads as -0.0 (the real number)
>
> * (imag-part (make-rectangular 1.0-0.0i)) evaluates to 0.0
>
> The lack of signed imaginary zero is a bit frustrating because some=20
> functions that should be sensitive to signed real zero return the=20
> incorrect values because the sign at some point doesn't transfer to the=
=20
> imaginary part.
>
> Is it possible to fix this?

I have pushed several changes to the complex number parsing,
printing and how make-rectangular handles inexact zero in
the second argument. Please give it a try (C6 only).


cheers,
felix