This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bignum arithmetics


On Dec 3,  5:49pm, Buechel Olivier wrote:
> Subject: Re: bignum arithmetics
>
> On Dec 2, 23:45, Keith Wright wrote:
>
> > Did you try it?  I used the following program.
> > (define (fact n)
> >   (let mul ((k 1)(p 1))
> >     (if (> k n) p (mul (+ k 1)(* k p)))))
> > after testing with (fact 4) and (fact 5), I tried
> > (fact 10000) and got something ending in
> > 000000000000000000000000000000000000000004617333575079170156
>
> guile> (fact 10000)
> runs OK on a sparc with 128Mb,
>
> guile> (fact 100000)
> ERROR: In procedure * in expression (* k p):
> ERROR: Memory allocation error
> ABORT: (memory-allocation-error)
>
> ends with a error-message as predicted.
>
> > guile> (version)
> > "1.3a"
>
> guile> (version)
> "1.3"
>
> everything seem to be allright, specialy when an "a" in 1.3a means alpha?!
>
> olivier.buechel@unifr.ch
>-- End of excerpt from Buechel Olivier


With guile 1.0 on an SGI w. 128 MB RAM under Irix 6.2,
(fact 10000) returns a number ending in many zeros.


Allan Dobbins