[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Fix #1051 by removing dead code
From: |
Peter Bex |
Subject: |
Re: [Chicken-hackers] [PATCH] Fix #1051 by removing dead code |
Date: |
Thu, 26 Sep 2013 21:51:18 +0200 |
User-agent: |
Mutt/1.4.2.3i |
On Sun, Sep 22, 2013 at 06:12:48PM -0400, John Cowan wrote:
> Peter Bex scripsit:
>
> > Care to provide a patch for that?
>
> I don't really know enough about Chicken's C conventions to do so
Sure you do! It's basic C code when calculations are considered;
it's only "different" when you have to return something or unpack
values from Scheme objects, but my original patch already took care
of that.
> A denormalized number can be recognized because its
> exponent bits are zero, but its fraction bits are non-zero (otherwise
> it would be +/-0.0).
I decided to use C99's isnormal() instead of rolling my own.
Even Windows supposedly supports this:
http://msdn.microsoft.com/en-us/library/hh308401.aspx
And Cygwin as well: http://cygwin.com/cygwin-api/compatibility.html
So hopefully this should be sufficient.
I even found some example denormalised numbers (those weren't as
easy to find as you'd hope!) from the NetBSD ATF tests for libm,
so this should help give *some* confidence that it's finally
correct now. Goddamn, I hate these motherfucking IEEE floats!
Can someone please test this on Windows?
Thanks for the tips, John!
Cheers,
Peter
--
http://www.more-magic.net
0001-Fix-1051-use-C99-isnormal-and-return-canned-values.patch
Description: Text document