This file is indexed.

/usr/share/doc/octave/octave.html/Recursion.html is in octave-doc 4.2.2-1ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Recursion (GNU Octave)</title>

<meta name="description" content="Recursion (GNU Octave)">
<meta name="keywords" content="Recursion (GNU Octave)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Calling-Functions.html#Calling-Functions" rel="up" title="Calling Functions">
<link href="Arithmetic-Ops.html#Arithmetic-Ops" rel="next" title="Arithmetic Ops">
<link href="Call-by-Value.html#Call-by-Value" rel="prev" title="Call by Value">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">


</head>

<body lang="en">
<a name="Recursion"></a>
<div class="header">
<p>
Previous: <a href="Call-by-Value.html#Call-by-Value" accesskey="p" rel="prev">Call by Value</a>, Up: <a href="Calling-Functions.html#Calling-Functions" accesskey="u" rel="up">Calling Functions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Recursion-1"></a>
<h4 class="subsection">8.2.2 Recursion</h4>
<a name="index-factorial-function"></a>

<p>With some restrictions<a name="DOCF3" href="#FOOT3"><sup>3</sup></a>, recursive function calls are allowed.  A
<em>recursive function</em> is one which calls itself, either directly or
indirectly.  For example, here is an inefficient<a name="DOCF4" href="#FOOT4"><sup>4</sup></a> way to compute the factorial of a given integer:
</p>
<div class="example">
<pre class="example">function retval = fact (n)
  if (n &gt; 0)
    retval = n * fact (n-1);
  else
    retval = 1;
  endif
endfunction
</pre></div>

<p>This function is recursive because it calls itself directly.  It
eventually terminates because each time it calls itself, it uses an
argument that is one less than was used for the previous call.  Once the
argument is no longer greater than zero, it does not call itself, and
the recursion ends.
</p>
<p>The built-in variable <code>max_recursion_depth</code> specifies a limit to
the recursion depth and prevents Octave from recursing infinitely.
</p>
<a name="XREFmax_005frecursion_005fdepth"></a><dl>
<dt><a name="index-max_005frecursion_005fdepth"></a>: <em><var>val</var> =</em> <strong>max_recursion_depth</strong> <em>()</em></dt>
<dt><a name="index-max_005frecursion_005fdepth-1"></a>: <em><var>old_val</var> =</em> <strong>max_recursion_depth</strong> <em>(<var>new_val</var>)</em></dt>
<dt><a name="index-max_005frecursion_005fdepth-2"></a>: <em></em> <strong>max_recursion_depth</strong> <em>(<var>new_val</var>, &quot;local&quot;)</em></dt>
<dd><p>Query or set the internal limit on the number of times a function may
be called recursively.
</p>
<p>If the limit is exceeded, an error message is printed and control returns to
the top level.
</p>
<p>When called from inside a function with the <code>&quot;local&quot;</code> option, the
variable is changed locally for the function and any subroutines it calls.
The original variable value is restored when exiting the function.
</p></dd></dl>


<div class="footnote">
<hr>
<h4 class="footnotes-heading">Footnotes</h4>

<h3><a name="FOOT3" href="#DOCF3">(3)</a></h3>
<p>Some of Octave&rsquo;s functions are
implemented in terms of functions that cannot be called recursively.
For example, the ODE solver <code>lsode</code> is ultimately implemented in a
Fortran subroutine that cannot be called recursively, so <code>lsode</code>
should not be called either directly or indirectly from within the
user-supplied function that <code>lsode</code> requires.  Doing so will result
in an error.</p>
<h3><a name="FOOT4" href="#DOCF4">(4)</a></h3>
<p>It would be
much better to use <code>prod (1:n)</code>, or <code>gamma (n+1)</code> instead,
after first checking to ensure that the value <code>n</code> is actually a
positive integer.</p>
</div>



</body>
</html>