Documentation for 8b1eab204b

This commit is contained in:
realstealthninja
2024-11-04 12:43:05 +00:00
parent 4fb6e622e9
commit a7bccf7d01
6732 changed files with 153919 additions and 365711 deletions

View File

@@ -1,3 +1,4 @@
<!-- HTML header for doxygen 1.12.0-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
@@ -5,10 +6,15 @@
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: math/string_fibonacci.cpp File Reference</title>
<title>TheAlgorithms/C++: math/string_fibonacci.cpp File Reference</title>
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
</script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../navtreedata.js"></script>
@@ -18,14 +24,24 @@
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
<script type="text/javascript">
window.MathJax = {
options: {
ignoreHtmlClass: 'tex2jax_ignore',
processHtmlClass: 'tex2jax_process'
},
loader: {
load: ['[tex]/ams']
},
tex: {
macros: {},
packages: ['base','configmacros','ams']
}
};
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
@@ -33,10 +49,11 @@ MathJax.Hub.Config({
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
<div id="projectname">TheAlgorithms/C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
<div id="projectbrief">All the algorithms implemented in C++</div>
</td>
</tr>
</tbody>
@@ -120,10 +137,12 @@ Include dependency graph for string_fibonacci.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d0/da1/string__fibonacci_8cpp__incl.svg" width="250" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><table class="memberdecls">
</div>
<p><a href="../../de/d47/string__fibonacci_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a28052eee05d43c2ebc5147c52bd50c35" id="r_a28052eee05d43c2ebc5147c52bd50c35"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a28052eee05d43c2ebc5147c52bd50c35">add</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> a, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> b)</td></tr>
<tr class="memitem:a28052eee05d43c2ebc5147c52bd50c35" id="r_a28052eee05d43c2ebc5147c52bd50c35"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a28052eee05d43c2ebc5147c52bd50c35">add</a> (std::string a, std::string b)</td></tr>
<tr class="separator:a28052eee05d43c2ebc5147c52bd50c35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad8055ee368a5d5b24de01bdde6bf8fca" id="r_ad8055ee368a5d5b24de01bdde6bf8fca"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad8055ee368a5d5b24de01bdde6bf8fca">fib_Accurate</a> (uint64_t n)</td></tr>
<tr class="separator:ad8055ee368a5d5b24de01bdde6bf8fca"><td class="memSeparator" colspan="2">&#160;</td></tr>
@@ -134,6 +153,8 @@ Functions</h2></td></tr>
<div class="textblock"><p>This Programme returns the Nth fibonacci as a string. </p>
<p>The method used is manual addition with carry and placing it in a string which is called string addition This makes it have no bounds or limits</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../de/de4/fibonacci__large_8cpp.html" title="Computes N^th Fibonacci number given as input argument. Uses custom build arbitrary integers library ...">fibonacci_large.cpp</a>, <a class="el" href="../../d4/d32/fibonacci__fast_8cpp.html" title="Faster computation of Fibonacci series.">fibonacci_fast.cpp</a>, <a class="el" href="../../d9/d89/fibonacci_8cpp.html" title="n-th Fibonacci number.">fibonacci.cpp</a> </dd></dl>
<p class="definition">Definition in file <a class="el" href="../../de/d47/string__fibonacci_8cpp_source.html">string_fibonacci.cpp</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a28052eee05d43c2ebc5147c52bd50c35" name="a28052eee05d43c2ebc5147c52bd50c35"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a28052eee05d43c2ebc5147c52bd50c35">&#9670;&#160;</a></span>add()</h2>
@@ -142,14 +163,14 @@ Functions</h2></td></tr>
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> add </td>
<td class="memname">std::string add </td>
<td>(</td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a></td> <td class="paramname"><span class="paramname"><em>a</em></span>, </td>
<td class="paramtype">std::string</td> <td class="paramname"><span class="paramname"><em>a</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a></td> <td class="paramname"><span class="paramname"><em>b</em></span>&#160;)</td>
<td class="paramtype">std::string</td> <td class="paramname"><span class="paramname"><em>b</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
@@ -160,20 +181,22 @@ Functions</h2></td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>sum as a <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> </dd></dl>
<dl class="section return"><dt>Returns</dt><dd>sum as a std::string </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../de/d47/string__fibonacci_8cpp_source.html#l00025">25</a> of file <a class="el" href="../../de/d47/string__fibonacci_8cpp_source.html">string_fibonacci.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 25</span> {</div>
<div class="line"><span class="lineno"> 26</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> temp = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><span class="lineno"> 26</span> std::string temp = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><span class="lineno"> 27</span> </div>
<div class="line"><span class="lineno"> 28</span> <span class="comment">// carry flag</span></div>
<div class="line"><span class="lineno"> 29</span> <span class="keywordtype">int</span> carry = 0;</div>
<div class="line"><span class="lineno"> 30</span> </div>
<div class="line"><span class="lineno"> 31</span> <span class="comment">// fills up with zeros</span></div>
<div class="line"><span class="lineno"> 32</span> <span class="keywordflow">while</span> (a.length() &lt; b.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>()) {</div>
<div class="line"><span class="lineno"> 32</span> <span class="keywordflow">while</span> (a.length() &lt; b.length()) {</div>
<div class="line"><span class="lineno"> 33</span> a = <span class="stringliteral">&quot;0&quot;</span> + a;</div>
<div class="line"><span class="lineno"> 34</span> }</div>
<div class="line"><span class="lineno"> 35</span> </div>
<div class="line"><span class="lineno"> 36</span> <span class="comment">// fills up with zeros</span></div>
<div class="line"><span class="lineno"> 37</span> <span class="keywordflow">while</span> (b.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>() &lt; a.length()) {</div>
<div class="line"><span class="lineno"> 37</span> <span class="keywordflow">while</span> (b.length() &lt; a.length()) {</div>
<div class="line"><span class="lineno"> 38</span> b = <span class="stringliteral">&quot;0&quot;</span> + b;</div>
<div class="line"><span class="lineno"> 39</span> }</div>
<div class="line"><span class="lineno"> 40</span> </div>
@@ -195,21 +218,13 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 56</span> }</div>
<div class="line"><span class="lineno"> 57</span> </div>
<div class="line"><span class="lineno"> 58</span> <span class="comment">// removes leading zeros.</span></div>
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">while</span> (temp[0] == <span class="charliteral">&#39;0&#39;</span> &amp;&amp; temp.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">length</a>() &gt; 1) {</div>
<div class="line"><span class="lineno"> 60</span> temp = temp.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string/substr.html">substr</a>(1);</div>
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">while</span> (temp[0] == <span class="charliteral">&#39;0&#39;</span> &amp;&amp; temp.length() &gt; 1) {</div>
<div class="line"><span class="lineno"> 60</span> temp = temp.substr(1);</div>
<div class="line"><span class="lineno"> 61</span> }</div>
<div class="line"><span class="lineno"> 62</span> </div>
<div class="line"><span class="lineno"> 63</span> <span class="keywordflow">return</span> temp;</div>
<div class="line"><span class="lineno"> 64</span>}</div>
<div class="ttc" id="abasic_string_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a></div></div>
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string/size.html">std::string::length</a></div><div class="ttdeci">T length(T... args)</div></div>
<div class="ttc" id="asubstr_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string/substr.html">std::string::substr</a></div><div class="ttdeci">T substr(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../de/d47/string__fibonacci_8cpp_a28052eee05d43c2ebc5147c52bd50c35_cgraph.svg" width="224" height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><!-- fragment -->
</div>
</div>
<a id="ad8055ee368a5d5b24de01bdde6bf8fca" name="ad8055ee368a5d5b24de01bdde6bf8fca"></a>
@@ -232,25 +247,21 @@ Here is the call graph for this function:</div>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="../../de/d47/string__fibonacci_8cpp_source.html#l00069">69</a> of file <a class="el" href="../../de/d47/string__fibonacci_8cpp_source.html">string_fibonacci.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 69</span> {</div>
<div class="line"><span class="lineno"> 70</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> tmp = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><span class="lineno"> 71</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> fibMinus1 = <span class="stringliteral">&quot;1&quot;</span>;</div>
<div class="line"><span class="lineno"> 72</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> fibMinus2 = <span class="stringliteral">&quot;0&quot;</span>;</div>
<div class="line"><span class="lineno"> 70</span> std::string tmp = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"><span class="lineno"> 71</span> std::string fibMinus1 = <span class="stringliteral">&quot;1&quot;</span>;</div>
<div class="line"><span class="lineno"> 72</span> std::string fibMinus2 = <span class="stringliteral">&quot;0&quot;</span>;</div>
<div class="line"><span class="lineno"> 73</span> <span class="keywordflow">for</span> (uint64_t i = 0; i &lt; n; i++) {</div>
<div class="line"><span class="lineno"> 74</span> tmp = <a class="code hl_function" href="#a28052eee05d43c2ebc5147c52bd50c35">add</a>(fibMinus1, fibMinus2);</div>
<div class="line"><span class="lineno"> 75</span> fibMinus2 = fibMinus1;</div>
<div class="line"><span class="lineno"> 76</span> fibMinus1 = tmp;</div>
<div class="line"><span class="lineno"> 77</span> }</div>
<div class="line"><span class="lineno"> 78</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; fibMinus2;</div>
<div class="line"><span class="lineno"> 78</span> std::cout &lt;&lt; fibMinus2;</div>
<div class="line"><span class="lineno"> 79</span>}</div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="astring__fibonacci_8cpp_html_a28052eee05d43c2ebc5147c52bd50c35"><div class="ttname"><a href="#a28052eee05d43c2ebc5147c52bd50c35">add</a></div><div class="ttdeci">std::string add(std::string a, std::string b)</div><div class="ttdef"><b>Definition</b> string_fibonacci.cpp:25</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../de/d47/string__fibonacci_8cpp_ad8055ee368a5d5b24de01bdde6bf8fca_cgraph.svg" width="367" height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
<div class="ttc" id="astring__fibonacci_8cpp_html_a28052eee05d43c2ebc5147c52bd50c35"><div class="ttname"><a href="#a28052eee05d43c2ebc5147c52bd50c35">add</a></div><div class="ttdeci">std::string add(std::string a, std::string b)</div><div class="ttdef"><b>Definition</b> <a href="../../de/d47/string__fibonacci_8cpp_source.html#l00025">string_fibonacci.cpp:25</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
@@ -268,23 +279,19 @@ Here is the call graph for this function:</div>
</table>
</div><div class="memdoc">
<p>main function </p>
<p class="definition">Definition at line <a class="el" href="../../de/d47/string__fibonacci_8cpp_source.html#l00082">82</a> of file <a class="el" href="../../de/d47/string__fibonacci_8cpp_source.html">string_fibonacci.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 82</span> {</div>
<div class="line"><span class="lineno"> 83</span> <span class="keywordtype">int</span> n;</div>
<div class="line"><span class="lineno"> 84</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Enter whatever number N you want to find the fibonacci of\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 85</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; n;</div>
<div class="line"><span class="lineno"> 86</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; n &lt;&lt; <span class="stringliteral">&quot; th Fibonacci is \n&quot;</span>;</div>
<div class="line"><span class="lineno"> 84</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Enter whatever number N you want to find the fibonacci of\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 85</span> std::cin &gt;&gt; n;</div>
<div class="line"><span class="lineno"> 86</span> std::cout &lt;&lt; n &lt;&lt; <span class="stringliteral">&quot; th Fibonacci is \n&quot;</span>;</div>
<div class="line"><span class="lineno"> 87</span> <a class="code hl_function" href="#ad8055ee368a5d5b24de01bdde6bf8fca">fib_Accurate</a>(n);</div>
<div class="line"><span class="lineno"> 88</span> </div>
<div class="line"><span class="lineno"> 89</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 90</span>}</div>
<div class="ttc" id="abasic_istream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a></div></div>
<div class="ttc" id="astring__fibonacci_8cpp_html_ad8055ee368a5d5b24de01bdde6bf8fca"><div class="ttname"><a href="#ad8055ee368a5d5b24de01bdde6bf8fca">fib_Accurate</a></div><div class="ttdeci">void fib_Accurate(uint64_t n)</div><div class="ttdef"><b>Definition</b> string_fibonacci.cpp:69</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../de/d47/string__fibonacci_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="464" height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
<div class="ttc" id="astring__fibonacci_8cpp_html_ad8055ee368a5d5b24de01bdde6bf8fca"><div class="ttname"><a href="#ad8055ee368a5d5b24de01bdde6bf8fca">fib_Accurate</a></div><div class="ttdeci">void fib_Accurate(uint64_t n)</div><div class="ttdef"><b>Definition</b> <a href="../../de/d47/string__fibonacci_8cpp_source.html#l00069">string_fibonacci.cpp:69</a></div></div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->