Documentation for 5704841875

This commit is contained in:
github-actions
2023-06-16 21:39:03 +00:00
parent 29158cf9a8
commit 2911106c7f
43 changed files with 518 additions and 410 deletions

View File

@@ -150,6 +150,9 @@ Functions</h2></td></tr>
<tr class="memitem:ac5803413618fcfb922cb32c6db0fc864"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../dd/d47/namespacemath.html#ac5803413618fcfb922cb32c6db0fc864">cylinder_surface_area</a> (T radius, T height)</td></tr>
<tr class="memdesc:ac5803413618fcfb922cb32c6db0fc864"><td class="mdescLeft">&#160;</td><td class="mdescRight">surface area of a <a href="https://en.wikipedia.org/wiki/Cylinder" target="_blank">cylinder</a> (2 * pi * r * h + 2 * pi * r^2) <br /></td></tr>
<tr class="separator:ac5803413618fcfb922cb32c6db0fc864"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6c72f756a7bf1b9043c357e3fe7814ca"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d47/namespacemath.html#a6c72f756a7bf1b9043c357e3fe7814ca">is_factorial</a> (uint64_t n)</td></tr>
<tr class="memdesc:a6c72f756a7bf1b9043c357e3fe7814ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to check if the given number is factorial of some number or not. <br /></td></tr>
<tr class="separator:a6c72f756a7bf1b9043c357e3fe7814ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a91366864111e1fac29722ca45e02ea8f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d47/namespacemath.html#a91366864111e1fac29722ca45e02ea8f">sieve</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; bool &gt; *vec)</td></tr>
<tr class="memdesc:a91366864111e1fac29722ca45e02ea8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the sieve. <br /></td></tr>
<tr class="separator:a91366864111e1fac29722ca45e02ea8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
@@ -843,6 +846,59 @@ Here is the call graph for this function:</div>
</div><!-- fragment -->
</div>
</div>
<a id="a6c72f756a7bf1b9043c357e3fe7814ca" name="a6c72f756a7bf1b9043c357e3fe7814ca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6c72f756a7bf1b9043c357e3fe7814ca">&#9670;&#160;</a></span>is_factorial()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool math::is_factorial </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>n</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Function to check if the given number is factorial of some number or not. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">n</td><td>number to be checked. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if number is a factorial returns true </dd>
<dd>
false if number is not a factorial </dd></dl>
<p>this loop is basically a reverse factorial calculation, where instead of multiplying we are dividing. We start at i = 2 since i = 1 has no impact division wise</p>
<p>if n was the sum of a factorial then it should be divided until it becomes 1</p>
<div class="fragment"><div class="line"><span class="lineno"> 27</span> {</div>
<div class="line"><span class="lineno"> 28</span> <span class="keywordflow">if</span> (n &lt;= 0) { <span class="comment">// factorial numbers are only ever positive Integers</span></div>
<div class="line"><span class="lineno"> 29</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><span class="lineno"> 30</span> }</div>
<div class="line"><span class="lineno"> 31</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 32</span><span class="comment"> /*!</span></div>
<div class="line"><span class="lineno"> 33</span><span class="comment"> * this loop is basically a reverse factorial calculation, where instead</span></div>
<div class="line"><span class="lineno"> 34</span><span class="comment"> * of multiplying we are dividing. We start at i = 2 since i = 1 has</span></div>
<div class="line"><span class="lineno"> 35</span><span class="comment"> * no impact division wise</span></div>
<div class="line"><span class="lineno"> 36</span><span class="comment"> */</span></div>
<div class="line"><span class="lineno"> 37</span> <span class="keywordtype">int</span> i = 2;</div>
<div class="line"><span class="lineno"> 38</span> <span class="keywordflow">while</span> (n % i == 0) {</div>
<div class="line"><span class="lineno"> 39</span> n = n / i;</div>
<div class="line"><span class="lineno"> 40</span> i++;</div>
<div class="line"><span class="lineno"> 41</span> }</div>
<div class="line"><span class="lineno"> 42</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 43</span><span class="comment"> /*!</span></div>
<div class="line"><span class="lineno"> 44</span><span class="comment"> * if n was the sum of a factorial then it should be divided until it</span></div>
<div class="line"><span class="lineno"> 45</span><span class="comment"> * becomes 1</span></div>
<div class="line"><span class="lineno"> 46</span><span class="comment"> */</span></div>
<div class="line"><span class="lineno"> 47</span> <span class="keywordflow">return</span> (n == 1);</div>
<div class="line"><span class="lineno"> 48</span>}</div>
</div><!-- fragment -->
</div>
</div>
<a id="afa39ec943a4836c878e1614fd89b146f" name="afa39ec943a4836c878e1614fd89b146f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afa39ec943a4836c878e1614fd89b146f">&#9670;&#160;</a></span>largestPower()</h2>

View File

@@ -14,6 +14,7 @@ var namespacemath =
[ "cylinder_surface_perimeter", "dd/d47/namespacemath.html#a1d4df7a4e43a2eac1acc0ac610487c73", null ],
[ "cylinder_volume", "dd/d47/namespacemath.html#abde24398be43538c62e4a496968e60ca", null ],
[ "integral_approx", "dd/d47/namespacemath.html#aec65db4e5c7317323227f026fe50ef11", null ],
[ "is_factorial", "dd/d47/namespacemath.html#a6c72f756a7bf1b9043c357e3fe7814ca", null ],
[ "largestPower", "dd/d47/namespacemath.html#afa39ec943a4836c878e1614fd89b146f", null ],
[ "lcmSum", "dd/d47/namespacemath.html#a04065193d190d605e1f0d0d93a87e244", null ],
[ "magic_number", "dd/d47/namespacemath.html#a8d8e81a7cd59644b311ef9adb268f5f0", null ],