help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: bigger integers


From: Alan Mackenzie
Subject: Re: bigger integers
Date: Sat, 4 Sep 2004 08:18:35 +0000
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686))

Joe Corneli <jcorneli@math.utexas.edu> wrote on Thu, 02 Sep 2004 17:28:17
-0500:

> This fails on big numbers like 12.

>  (defun factorial (num)
>    (if (<= num 0)
>        1
>      (* num (factorial (1- num)))))

> Suggestions on how to make it work for bigger numbers?

Why on earth do you want to write a program for a calculation than just
about anybody could do in his head?

12! is, of course, 478,002,600.  ;-) 

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").


reply via email to

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