chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Problems with #e and #i in the numeric egg


From: felix winkelmann
Subject: Re: [Chicken-users] Problems with #e and #i in the numeric egg
Date: Wed, 19 Oct 2005 09:49:28 +0200

On 10/18/05, John.Cowan <address@hidden> wrote:
> 1) The #i and #e syntaxes do not use the numeric egg's redefined versions of
> exact->inexact and inexact->exact properly.  Thus #e5/2, #i5/2, and #e2.5
> all produce errors instead of 5/2, 2.5, and 5/2 respectively.

Thanks, i have fixed this in the reader:

% darcs diff library.scm
2124,2125c2124,2125
<                            ((#\i) (##sys#read-char-0 port) (exact->inexact
(r-number-with-radix)))
<                            ((#\e) (##sys#read-char-0 port) (inexact->exact
(r-number-with-radix)))
---
>                            ((#\i) (##sys#read-char-0 port) 
> (##sys#exact->inexact (r-number-with-radix)))
>                            ((#\e) (##sys#read-char-0 port) 
> (##sys#inexact->exact (r-number-with-radix)))

>
> 2) I think that using inexact->exact for #e<decimal> is not the Right Thing.
> With the previous point fixed, #e5.2 would return 
> 5854679515581645/1125899906842624
> instead of 52/10 = 26/5.  I'd rather see the latter, thus allowing exact
> rationals to be written as decimal numbers.
>

Ok, I'll take a look.


cheers,
felix




reply via email to

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