unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Alan Mackenzie <acm@muc.de>
Subject: Re: bigger integers
Date: Sat, 4 Sep 2004 08:18:35 +0000	[thread overview]
Message-ID: <rotbhc.m6.ln@acm.acm> (raw)
In-Reply-To: mailman.1324.1094164438.1998.help-gnu-emacs@gnu.org

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").

  parent reply	other threads:[~2004-09-04  8:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1324.1094164438.1998.help-gnu-emacs@gnu.org>
2004-09-02 23:10 ` bigger integers Kevin Rodgers
2004-09-03  2:11 ` Pascal Bourguignon
2004-09-03 10:20 ` Phillip Lord
2004-09-04  8:18 ` Alan Mackenzie [this message]
2004-09-04 11:09   ` Neil Woods
2004-09-06  0:00 ` Miles Bader
2004-09-17 19:45 ` giacomo boffi
     [not found] <mailman.1438.1094249173.1998.help-gnu-emacs@gnu.org>
2004-09-03 23:29 ` Pascal Bourguignon
2004-09-07 17:46 ` Kevin Rodgers
2004-09-03 22:00 Joe Corneli
  -- strict thread matches above, loose matches on Subject: below --
2004-09-02 22:28 Joe Corneli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=rotbhc.m6.ln@acm.acm \
    --to=acm@muc.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).