[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] [PATCH] Fix #1051 by removing dead code
From: |
Peter Bex |
Subject: |
[Chicken-hackers] [PATCH] Fix #1051 by removing dead code |
Date: |
Sun, 22 Sep 2013 16:49:10 +0200 |
User-agent: |
Mutt/1.4.2.3i |
Hi all,
As Felix noted in #1051, the implementation of C_flonum_rat() contains
some code which is never reached. This function is a hand-written
conversion of the Scheme code in the numbers egg which is responsible
for calculating the numerator and denominator, which is itself taken
from Scheme48.
The part which isn't reached is supposed enlarge extremely small
"denormalised" floating-point numbers so that they will fall within
the representable range again (are normalised). I don't fully grok
this stuff, but in the numbers egg this is done by multiplying by
the number 2^53 and dividing again (through gcd) after the operation
is done. However, this will result in a bignum on 32-bit platforms,
so we can't use this as-is in CHICKEN core.
Since this code would only make a difference in extreme situations,
I think it's safest to rip it out completely. The attached patch does
just that.
Cheers,
Peter
--
http://www.more-magic.net
0001-Fix-1051-by-ripping-out-unnecessary-code.patch
Description: Text document
- [Chicken-hackers] [PATCH] Fix #1051 by removing dead code,
Peter Bex <=