From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: bigger integers
Date: Tue, 07 Sep 2004 11:46:46 -0600 [thread overview]
Message-ID: <413DF406.8010608@yahoo.com> (raw)
In-Reply-To: mailman.1438.1094249173.1998.help-gnu-emacs@gnu.org
Joe Corneli wrote:
> After all, emacs lisp is designed to count characters in a file,
> not to compute factorials.
>
> "Emacs is the extensible, customizable, self-documenting real-time
> display editor."
>
> If I can't extend or customize it to compute 12! then there seems to
> be something missing. Kevin's factorial works though so I guess
> that's good enough for me... oh wait a second now it stopped working.
>
> Debugger entered--Lisp error: (error "Lisp nesting exceeds max-lisp-eval-depth")
The obvious pseudo-fix is something like:
(setq max-lisp-eval-depth (* 42 max-lisp-eval-depth))
> (factorial (1- num))
> (* num (factorial (1- num)))
> (if (<= num 0) 1.0 (* num (factorial ...)))
> factorial(7)
> (* num (factorial (1- num)))
> (if (<= num 0) 1.0 (* num (factorial ...)))
> factorial(8)
> (* num (factorial (1- num)))
> (if (<= num 0) 1.0 (* num (factorial ...)))
> factorial(9)
> (* num (factorial (1- num)))
> (if (<= num 0) 1.0 (* num (factorial ...)))
> factorial(10)
> (* num (factorial (1- num)))
> (if (<= num 0) 1.0 (* num (factorial ...)))
> factorial(11)
> (* num (factorial (1- num)))
> (if (<= num 0) 1.0 (* num (factorial ...)))
> factorial(12)
> eval((factorial 12))
>
> (This same computation was fine just a minute ago, then I tried to
> compute 100! and now it doesn't want to do 12! any more.)
That's weird, it sounds like the stack has been corrupted.
--
Kevin Rodgers
next prev parent reply other threads:[~2004-09-07 17:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.1438.1094249173.1998.help-gnu-emacs@gnu.org>
2004-09-03 23:29 ` bigger integers Pascal Bourguignon
2004-09-07 17:46 ` Kevin Rodgers [this message]
[not found] <mailman.1324.1094164438.1998.help-gnu-emacs@gnu.org>
2004-09-02 23:10 ` Kevin Rodgers
2004-09-03 2:11 ` Pascal Bourguignon
2004-09-03 10:20 ` Phillip Lord
2004-09-04 8:18 ` Alan Mackenzie
2004-09-04 11:09 ` Neil Woods
2004-09-06 0:00 ` Miles Bader
2004-09-17 19:45 ` giacomo boffi
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=413DF406.8010608@yahoo.com \
--to=ihs_4664@yahoo.com \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.