[Top][All Lists]

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

Re: [Chicken-users] Possible numbers bug

From: Peter Bex
Subject: Re: [Chicken-users] Possible numbers bug
Date: Sat, 28 May 2011 20:11:28 +0200
User-agent: Mutt/

On Sat, May 28, 2011 at 11:03:41AM -0700, Matt Welland wrote:
> What was the final word on this? Is it a real issue on some platforms?

Probably. I will look into it when time allows.

> Anyhow, I found this whole exercise pretty interesting and played with
> it a bit more and observed a couple curious things:
> 2. Taking the inverse exponent (i.e. result^(1/n) ) runs into trouble
> at n=144. Anyone care to explain why that is and is there a numerical
> methods trick to work around it?

You divide the inexact 1.0 by the number.  Try doing an exact division
like (/ 1 n) or just (/ n). This will produce a rational number which
is exact and not limited in any way.

> 3. Why do guile, scm and STk put out +inf.0 and chicken puts out +inf
> (gauche gives #i1/0)? My hazy understanding is that +inf.0 is not the
> same as +inf.

I think it's the same.  Only flonums can be +inf and hence the .0 is

"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

reply via email to

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