chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] [PATCH] Distinguish between positive and negative


From: John Cowan
Subject: Re: [Chicken-hackers] [PATCH] Distinguish between positive and negative zero in flonums
Date: Sat, 29 Jun 2019 10:57:32 -0400

Awesome!

On Sat, Jun 29, 2019 at 10:08 AM Peter Bex <address@hidden> wrote:
On Sat, Jun 29, 2019 at 03:26:54PM +0200, Peter Bex wrote:
> Hi all,
>
> Attached is a patch for #1627.
>
> I'm not happy with the hacky way the reader deals with these, but I could
> not really come up with a clean solution for it.  Suggestions for
> improvement are welcome.

There was a small bug in the previous patch; it would also carry the sign
of the exponent into the final result, which is definitely not correct.
Very obscure case, but the nice numbers test suite from S7 found it :)

I also found another case: if there was an exponent at all, it would not
propagate the sign (so -0e1 would be 0.0 instead of -0.0).  I had to move
the go-inexact! call from scan-exponent down into scan-ureal, where the
sign is known.  This is fine, as the other call to scan-exponent was
inside scan-decimal-tail, before which scan-ureal already calls
go-inexact! as well.

This new patch has additional test cases for this as well.

Cheers,
Peter
_______________________________________________
Chicken-hackers mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

reply via email to

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