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

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

Re: bigger integers


From: Joe Corneli
Subject: Re: bigger integers
Date: Fri, 03 Sep 2004 17:00:52 -0500

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

   I think calc can cope with arbitrary precision.

I guess I'll check that out.



reply via email to

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