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: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] Distinguish between positive and negative zero in flonums
Date: Sat, 29 Jun 2019 16:08:24 +0200
User-agent: NeoMutt/20170113 (1.7.2)

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

Attachment: 0001-Distinguish-between-IEEE-fp-positive-and-negative-ze.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

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