[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] Fix for #1016: allow non-integral flonums for nume
From: |
Christian Kellermann |
Subject: |
Re: [Chicken-hackers] Fix for #1016: allow non-integral flonums for numerator and denominator |
Date: |
Sat, 29 Jun 2013 16:54:58 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
* Peter Bex <address@hidden> [130616 21:36]:
> Hi all,
>
> Attached is a patch to allow non-integral flonum arguments for the
> numerator and denominator procedures. They are supposed to accept
> rational numbers, and flonums, though inexact, can be rational (if
> they're not Inf or NaN). This fixes #1016 for core and brings us
> closer to R5RS compliance (yes, this is required by R5RS!)
>
> This code is a more-or-less straightforward port to C (+ specialization)
> of the Scheme code for the inexact->exact procedure from the numbers egg.
> Unfortunately, it does not give the "precise" results the numbers egg
> gives, because bignums are unavailable. OTOH, this precision is usually
> kind of misleading anyway since the inputs are inexact numbers!
Looks ok to me, so please find it in a master branch near you!
Thanks,
Christian
--
In the world, there is nothing more submissive and weak than
water. Yet for attacking that which is hard and strong, nothing can
surpass it. --- Lao Tzu