<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Moivre-Binet Formel für größere Zahlen realisieren]]></title><description><![CDATA[<p>Hi,</p>
<p>mit folgender Formel will ich große Zahlen in der Fibonacci-Folge bilden: <a href="http://upload.wikimedia.org/math/c/f/9/cf9e689b7872d81c0655a10eaf38aa32.png" rel="nofollow">http://upload.wikimedia.org/math/c/f/9/cf9e689b7872d81c0655a10eaf38aa32.png</a><br />
Für den kleineren Zahlenbereich lässt sich das relativ einfach realisieren. Ich habe versucht das mit GMP hinzukriegen. Aber da schaff ich es nicht mal richtig 1/wurzel 5 darzustellen. Liegt dass daran dass ich mich nicht genug eingearbeitet habe oder ist das eher das ungeeignete Werkzeug für solche Zwecke? Gibt es eine Alternative, welche vielleicht auch näher an C++ ist als an C?</p>
<p>Vielen Dank</p>
<p>Joachim Redies</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/219559/moivre-binet-formel-für-größere-zahlen-realisieren</link><generator>RSS for Node</generator><lastBuildDate>Thu, 08 Oct 2026 06:20:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/219559.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 04 Aug 2008 21:55:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Moivre-Binet Formel für größere Zahlen realisieren on Mon, 04 Aug 2008 21:55:48 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>mit folgender Formel will ich große Zahlen in der Fibonacci-Folge bilden: <a href="http://upload.wikimedia.org/math/c/f/9/cf9e689b7872d81c0655a10eaf38aa32.png" rel="nofollow">http://upload.wikimedia.org/math/c/f/9/cf9e689b7872d81c0655a10eaf38aa32.png</a><br />
Für den kleineren Zahlenbereich lässt sich das relativ einfach realisieren. Ich habe versucht das mit GMP hinzukriegen. Aber da schaff ich es nicht mal richtig 1/wurzel 5 darzustellen. Liegt dass daran dass ich mich nicht genug eingearbeitet habe oder ist das eher das ungeeignete Werkzeug für solche Zwecke? Gibt es eine Alternative, welche vielleicht auch näher an C++ ist als an C?</p>
<p>Vielen Dank</p>
<p>Joachim Redies</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1559290</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1559290</guid><dc:creator><![CDATA[hansjoachim]]></dc:creator><pubDate>Mon, 04 Aug 2008 21:55:48 GMT</pubDate></item><item><title><![CDATA[Reply to Moivre-Binet Formel für größere Zahlen realisieren on Mon, 04 Aug 2008 22:04:35 GMT]]></title><description><![CDATA[<blockquote>
<p>Liegt dass daran dass ich mich nicht genug eingearbeitet habe oder ist das eher das ungeeignete Werkzeug für solche Zwecke? Gibt es eine Alternative, welche vielleicht auch näher an C++ ist als an C?</p>
</blockquote>
<p>Ich würde mal sagen ersteres. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
Und <strong>grundsätzlich</strong> ist mit C++ alles möglich, was mit C auch möglich ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1559299</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1559299</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Mon, 04 Aug 2008 22:04:35 GMT</pubDate></item><item><title><![CDATA[Reply to Moivre-Binet Formel für größere Zahlen realisieren on Tue, 05 Aug 2008 11:24:41 GMT]]></title><description><![CDATA[<p>drakon schrieb:</p>
<blockquote>
<p>Ich würde mal sagen ersteres. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
</blockquote>
<p>Leider gibt es aber keine Möglichkeit in der Library Potenzen mit rationaler Basis zuberechnen.</p>
<p><a href="http://gmplib.org/manual/Integer-Exponentiation.html#Integer-Exponentiation" rel="nofollow">http://gmplib.org/manual/Integer-Exponentiation.html#Integer-Exponentiation</a><br />
<a href="http://gmplib.org/manual/Rational-Number-Functions.html#Rational-Number-Functions" rel="nofollow">http://gmplib.org/manual/Rational-Number-Functions.html#Rational-Number-Functions</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1559550</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1559550</guid><dc:creator><![CDATA[hansjoachim]]></dc:creator><pubDate>Tue, 05 Aug 2008 11:24:41 GMT</pubDate></item><item><title><![CDATA[Reply to Moivre-Binet Formel für größere Zahlen realisieren on Tue, 05 Aug 2008 11:37:19 GMT]]></title><description><![CDATA[<p>Hallo hansjoachim,</p>
<p>Die Moivre-Binet Formel hat den Vorteil, dass man den zweiten Summanden getrost weglassen kann, wenn man anschließend wieder auf ganze Zahlen rundet.<br />
Wenn Du dann die Klasse <a href="http://www.c-plusplus.net/forum/viewtopic-var-p-is-1447263.html#1447263" rel="nofollow">'Log10' aus diesem Beitrag nutzt</a>, so liefert folgendes kleines Programm Ergebnisse für f_n mit n bis max-int.</p>
<pre><code class="language-cpp">#include &quot;Log10.h&quot;
#include &lt;iostream&gt;
#include &lt;cmath&gt;

int main()
{
    using namespace std;
    for( int n; cin &gt;&gt; n; )
    {
        cout &lt;&lt; &quot;f_&quot; &lt;&lt; n &lt;&lt; &quot;= &quot;
            &lt;&lt; pow( Log10( (1 + sqrt(5.))/2 ), double(n) )/ sqrt( 5.) &lt;&lt; endl;
    }
    return 0;
}
</code></pre>
<p>man erhält z.B. folgenden Output</p>
<pre><code>100
f_100= 3.54225e+20
10000
f_10000= 3.36448e+2089
1000000
f_1000000= 1.95328e+208987
2100000000
f_2100000000= 1.49786e+438874044
</code></pre>
<p>größere Zahlen sind auch denkbar, aber die Genauigkeit geht dann natürlich irgendwann in den Keller.</p>
<p>Gruß<br />
Werner</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1559558</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1559558</guid><dc:creator><![CDATA[Werner Salomon]]></dc:creator><pubDate>Tue, 05 Aug 2008 11:37:19 GMT</pubDate></item></channel></rss>