guile-devel
[Top][All Lists]
Advanced

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

Re: ratio implementation


From: Bill Schottstaedt
Subject: Re: ratio implementation
Date: Wed, 15 Oct 2003 05:57:58 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

> With your new files, I now get
>  guile> (inexact->exact 123456789123456789.0)
>  0

I noticed this, but wasn't sure how to proceed;
in the previous guile, you'd get (in a sense) equally
bogus results:

guile> (inexact->exact 17452826108659293487.0)
17452826108659294208

guile> (= (truncate 17452826108659293487.3) 17452826108659293487.0)
#f

I wasn't even sure whether you wanted inexact->exact to
be changed -- I left the old code in place.

I wrote a gmp version of the continued fraction code about
10 years ago -- I think I can still find it.

>  guile> (define pi (* 2 (acos 0)))
>  guile> (- (inexact->exact pi) pi)
>  3.31628058347633e-10
> Shouldn't we be able to do better than this?

I think so; but in the current version, I'm setting the
minimum error to 1/INT_MAX, which looks like it's in the
ballpark of e-10.





reply via email to

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