MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

$RecursionLimit Bug?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63932] $RecursionLimit Bug?
  • From: "W. Craig Carter" <ccarter at mit.edu>
  • Date: Mon, 23 Jan 2006 04:11:48 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello,
I am using Mathematica 5.2 on MacOS 10.4.4

I was trying to construct a cannonical timing example by writing
a memoryless factorial function.

If I do this (fresh kernel):

$RecursionLimit = $IterationLimit = 10^6
fact[0] = 1;
fact[n_] := n fact[n - 1]
Timing[fact[10^6]]
?fact
This generates no output, and the ?fact input line becomes In[1], as 
if the kernel died after Timing[fact[10^5]], but no messages are 
generated.

If I bury the recursion limit inside a Block, then I get
fact[0] = 1;
fact[n_] := n fact[n - 1]
Timing[Block[{$RecursionLimit = Infinity}, Return[fact[10^5]]]]
-----> $RecursionLimit::reclim : Recursion depth of 256 exceeded
?fact (* now is In[1] *)
-----? Symbol fact not found.


Is this a bug?  I couldn't find a list of known bugs on the 
mathematica site....


Thanks, WCC



W. Craig Carter
Lord Foundation Professor of Materials Science and Engineering
MIT, Dept. of Materials Science and Engineering 13-5018  77 Massachusetts Ave, Cambridge, MA 02139-4307 USA
617-253-6048  ccarter at mit.edu http://pruffle.mit.edu/~ccarter http://pruffle.mit.edu/~ccarter/FAQS/ http://pruffle.mit.edu/~ccarter/I_do_not_use_microsoft.html


  • Prev by Date: Re: Re: NDSolve useless?
  • Next by Date: show workings
  • Previous by thread: Mathematica 4.2 and Mac OS 10.4.4 font problems - attached files (1/1)
  • Next by thread: Re: $RecursionLimit Bug?