<?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[Float, Double und Long Double]]></title><description><![CDATA[<p>Ich bemerke gerade ein Problem, dass sich erst jetzt herausgestellt hat.<br />
Und zwar habe ich ein recht simples Programm geschrieben.<br />
Ich gab immer wieder 20 Stellen nach dem Komma ein und der Compiler spuckte mir immer wieder nur 5 Stellen nach dem Komma aus.<br />
(Ich weiß, ich hab das Programm umständlich geschrieben ! ^^)</p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
#include&lt;conio.h&gt;
using namespace std;

int main()
{
    float k1;
    double k2;
    long double k3;

    cout&lt;&lt;&quot;Gib bitte 3 mal die selbe Kommazahl mit 20 Stellen ein !&quot;&lt;&lt;endl;
    cin&gt;&gt;k1;
    cin&gt;&gt;k2;
    cin&gt;&gt;k3;

    cout&lt;&lt;&quot;Float&quot;&lt;&lt;endl;
    cout&lt;&lt;k1&lt;&lt;endl;
    cout&lt;&lt;&quot; &quot;&lt;&lt;endl;
    cout&lt;&lt;&quot;Double&quot;&lt;&lt;endl;
    cout&lt;&lt;k2&lt;&lt;endl;
    cout&lt;&lt;&quot; &quot;&lt;&lt;endl;
    cout&lt;&lt;&quot;Long Double&quot;&lt;&lt;endl;
    cout&lt;&lt;k3&lt;&lt;endl;
    cout&lt;&lt;&quot; &quot;&lt;&lt;endl;

    getch();
}
</code></pre>
<p>THX im Voraus und LG Flo</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/265774/float-double-und-long-double</link><generator>RSS for Node</generator><lastBuildDate>Thu, 03 Sep 2026 21:34:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/265774.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 Apr 2010 16:04:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Float, Double und Long Double on Wed, 28 Apr 2010 16:04:15 GMT]]></title><description><![CDATA[<p>Ich bemerke gerade ein Problem, dass sich erst jetzt herausgestellt hat.<br />
Und zwar habe ich ein recht simples Programm geschrieben.<br />
Ich gab immer wieder 20 Stellen nach dem Komma ein und der Compiler spuckte mir immer wieder nur 5 Stellen nach dem Komma aus.<br />
(Ich weiß, ich hab das Programm umständlich geschrieben ! ^^)</p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
#include&lt;conio.h&gt;
using namespace std;

int main()
{
    float k1;
    double k2;
    long double k3;

    cout&lt;&lt;&quot;Gib bitte 3 mal die selbe Kommazahl mit 20 Stellen ein !&quot;&lt;&lt;endl;
    cin&gt;&gt;k1;
    cin&gt;&gt;k2;
    cin&gt;&gt;k3;

    cout&lt;&lt;&quot;Float&quot;&lt;&lt;endl;
    cout&lt;&lt;k1&lt;&lt;endl;
    cout&lt;&lt;&quot; &quot;&lt;&lt;endl;
    cout&lt;&lt;&quot;Double&quot;&lt;&lt;endl;
    cout&lt;&lt;k2&lt;&lt;endl;
    cout&lt;&lt;&quot; &quot;&lt;&lt;endl;
    cout&lt;&lt;&quot;Long Double&quot;&lt;&lt;endl;
    cout&lt;&lt;k3&lt;&lt;endl;
    cout&lt;&lt;&quot; &quot;&lt;&lt;endl;

    getch();
}
</code></pre>
<p>THX im Voraus und LG Flo</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1889547</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1889547</guid><dc:creator><![CDATA[Florian S.]]></dc:creator><pubDate>Wed, 28 Apr 2010 16:04:15 GMT</pubDate></item><item><title><![CDATA[Reply to Float, Double und Long Double on Wed, 28 Apr 2010 16:09:01 GMT]]></title><description><![CDATA[<p><a href="http://www.cplusplus.com/reference/iostream/ios_base/precision/" rel="nofollow">http://www.cplusplus.com/reference/iostream/ios_base/precision/</a></p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1889551</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1889551</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Wed, 28 Apr 2010 16:09:01 GMT</pubDate></item><item><title><![CDATA[Reply to Float, Double und Long Double on Wed, 28 Apr 2010 16:09:12 GMT]]></title><description><![CDATA[<p>Meine eigentliche Frage war jetzt:</p>
<p>Warum spuckt er mir immer nur 5 Zahlen nach dem Komma aus ?<br />
Hab ich was vergessen ???<br />
Hab ein Black-Out... xD</p>
<p>Gruss</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1889552</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1889552</guid><dc:creator><![CDATA[Florian S.]]></dc:creator><pubDate>Wed, 28 Apr 2010 16:09:12 GMT</pubDate></item><item><title><![CDATA[Reply to Float, Double und Long Double on Wed, 28 Apr 2010 16:09:58 GMT]]></title><description><![CDATA[<p>OKay, warst schneller als ich !<br />
Vielen Dank und Gruss</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1889553</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1889553</guid><dc:creator><![CDATA[Florian S.]]></dc:creator><pubDate>Wed, 28 Apr 2010 16:09:58 GMT</pubDate></item><item><title><![CDATA[Reply to Float, Double und Long Double on Wed, 28 Apr 2010 18:27:03 GMT]]></title><description><![CDATA[<p>Neben der Ausgabe/Formatierung ist natürlich die Genauigkeit von double auch begrenzt. Typischerweise sind doubles nur auf etwa 15 Dezimalstellen (insgesamt, einschließlich die vor dem Komma) genau. 10 Stellen werden garantiert. Der C++ Standard verweist hier auf den C Standard, der sagt, dass das <code>DBL_DIG</code> -Makro aus <code>&lt;float.h&gt;</code> mindestens zu einer Ganzzahlkonstante mit dem Wert 10 expandiert. Bei long double sind's auch mindestens 10, bei float mindestens 6. Viel mehr bieten 32bit IEEE-754 single floats auch nicht an.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1889644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1889644</guid><dc:creator><![CDATA[krümelkacker]]></dc:creator><pubDate>Wed, 28 Apr 2010 18:27:03 GMT</pubDate></item></channel></rss>