chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Different factorial results


From: Steve Graham
Subject: Re: [Chicken-users] Different factorial results
Date: Fri, 3 Jun 2011 09:00:19 -0700 (PDT)

Thanks, Mario.  Worked like a charm.  Why is that not part of the base package?

Eu morava nos estados de Sao Paolo e Parana desde 1971 a 1973.  Eu me gostei 
muito desse tempo.

Pardon my portuguese - it's been decades.


Steve

---

--- On Fri, 6/3/11, Mario Domenech Goulart <address@hidden> wrote:

> From: Mario Domenech Goulart <address@hidden>
> Subject: Re: [Chicken-users] Different factorial results
> To: "Steve Graham" <address@hidden>
> Cc: "Chicken-users" <address@hidden>
> Date: Friday, June 3, 2011, 10:36 AM
> Hi Steve,
> 
> On Fri, 3 Jun 2011 07:26:58 -0700 (PDT) Steve Graham <address@hidden>
> wrote:
> 
> > In running (factorial 50)
> >
> > (define (factorial n) (if (< n 2) 1 (* n (factorial
> (- n 1)))))
> >
> > I found that Chicken Scheme's result differed from
> Petite Chez, Kawa and Gambit.  The former gave
> >
> > 3.04140932017134e+064
> >
> > and the latter 3 gave
> >
> >
> 30414093201713378043612608166064768844377641568960512000000000000
> >
> > Why the difference?
> 
> It seems that you are not using the numbers egg
> (http://wiki.call-cc.org/egg/numbers). 
> 
> The full numeric tower support is provided as an
> extension.
> 
> Just
> 
>   $ chicken-install numbers
> 
> csi> (use numbers)
> csi> (define (factorial n) (if (< n 2) 1 (* n
> (factorial (- n 1)))))
> csi> (factorial 50)
> 30414093201713378043612608166064768844377641568960512000000000000
> 
> 
> Best wishes.
> Mario
> -- 
> http://parenteses.org/mario
>



reply via email to

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