mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-24 05:42:59 +08:00
Documentation for c26eea874d
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/double_factorial.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,11 +124,12 @@ $(function(){initNavTree('d7/d89/double__factorial_8cpp_source.html','../../');
|
||||
<div class="headertitle"><div class="title">double_factorial.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d7/d89/double__factorial_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d7/d89/double__factorial_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include <cassert></span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span></div>
|
||||
<div class="foldopen" id="foldopen00018" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="../../d7/d89/double__factorial_8cpp.html#a0a3c417360400093891a9ccddaa4be26"> 18</a></span>uint64_t <a class="code hl_function" href="../../d7/d89/double__factorial_8cpp.html#a0a3c417360400093891a9ccddaa4be26">double_factorial_iterative</a>(uint64_t n) {</div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> uint64_t res = 1;</div>
|
||||
@@ -140,7 +141,7 @@ $(function(){initNavTree('d7/d89/double__factorial_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keywordflow">return</span> res;</div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span></div>
|
||||
<div class="foldopen" id="foldopen00031" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="../../d7/d89/double__factorial_8cpp.html#a68ba20fed2ce427f6469c7689437829d"> 31</a></span>uint64_t <a class="code hl_function" href="../../d7/d89/double__factorial_8cpp.html#a68ba20fed2ce427f6469c7689437829d">double_factorial_recursive</a>(uint64_t n) {</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordflow">if</span> (n <= 1)</div>
|
||||
@@ -148,14 +149,14 @@ $(function(){initNavTree('d7/d89/double__factorial_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordflow">return</span> n * <a class="code hl_function" href="../../d7/d89/double__factorial_8cpp.html#a68ba20fed2ce427f6469c7689437829d">double_factorial_recursive</a>(n - 2);</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> </div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span></div>
|
||||
<div class="foldopen" id="foldopen00043" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="../../d7/d89/double__factorial_8cpp.html#abbbcebf3a2d0c67f4c3cfb5511a97981"> 43</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(uint64_t n, uint64_t expected) {</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> assert(<a class="code hl_function" href="../../d7/d89/double__factorial_8cpp.html#a0a3c417360400093891a9ccddaa4be26">double_factorial_iterative</a>(n) == expected);</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> assert(<a class="code hl_function" href="../../d7/d89/double__factorial_8cpp.html#a68ba20fed2ce427f6469c7689437829d">double_factorial_recursive</a>(n) == expected);</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> </div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span></div>
|
||||
<div class="foldopen" id="foldopen00051" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="../../d7/d89/double__factorial_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9"> 51</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d7/d89/double__factorial_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>() {</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> std::cout << <span class="stringliteral">"Test 1:\t n=5\t..."</span>;</div>
|
||||
@@ -171,7 +172,7 @@ $(function(){initNavTree('d7/d89/double__factorial_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> std::cout << <span class="stringliteral">"passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> </div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span></div>
|
||||
<div class="foldopen" id="foldopen00068" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="../../d7/d89/double__factorial_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 68</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d7/d89/double__factorial_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <a class="code hl_function" href="../../d7/d89/double__factorial_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>();</div>
|
||||
@@ -189,7 +190,7 @@ $(function(){initNavTree('d7/d89/double__factorial_8cpp_source.html','../../');
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d7/d89/double__factorial_8cpp.html">double_factorial.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user