guile-devel
[Top][All Lists]
Advanced

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

Re: numeric tests


From: Marius Vollmer
Subject: Re: numeric tests
Date: 28 Jul 2001 15:04:48 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102

Dirk Herrmann <address@hidden> writes:

> .I have re-implemented the string->number functionality to
> (hopefully) closely match the syntax as it is specified by R5RS.
> The new implementation tries to be as accurate as possible, i. e. a
> rational number a/b is first read as two exact integers, and
> afterwards one single division is performed.

I like this!
 
> Just some more remarks:  The new implementation in its current state is
> much slower than the old one.

In all cases, or only in the cases where it has better behavior than
the previous code?

> I have at first aimed at correctness and did not put a lot of effort
> into performance.  Should I commit it to the CVS trunk anyway?

Yep, I'd say so.

> However, "#e9/10" _is_ accepted and gives 1, similarly "#e1.2" is
> accepted as well and also gives 1 

I don't think they should be accepted.  If the user explcitely
requests an exact number and we can't give it to him, we should not
stealthily return an inexact number, or a number that is exact, but
not the one the user has requested.

> I was not quite sure about the last two examples "#e9/10" and "#e1.2".  
> R5RS does not state that the #e prefix in conjunction with an inexact
> number should be disallowed.

Hmm, I don't understand.  What do you mean with "in conjunction with
an inexact number"?  "1.2" is not inexact by itself, it is exactly
12/10.



reply via email to

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