<?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[Double nach String Genauigkeitsproblem]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich muss in meinem Programm eine Double Variable in einen std::string umwandeln. Mein Ansatz sieht so aus:</p>
<pre><code class="language-cpp">double zahl = 6.35;
zahl = pow(zahl, 5.19);

ostringstream Str;
Str &lt;&lt; zahl;
std::string ZahlAlsString(Str.str());
</code></pre>
<p>zahl ist bei dem Beispiel 14668.835363 usw. Der String ist aber nur &quot;14668.8&quot; ( ZahlAlsString.size() == 7 ). Gibt es eine Möglichkeit sämtliche Nachkommastellen einer double Variable in einen String zu schreiben?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/238406/double-nach-string-genauigkeitsproblem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 23 Sep 2026 02:39:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/238406.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 10 Apr 2009 03:40:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Double nach String Genauigkeitsproblem on Fri, 10 Apr 2009 03:40:35 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich muss in meinem Programm eine Double Variable in einen std::string umwandeln. Mein Ansatz sieht so aus:</p>
<pre><code class="language-cpp">double zahl = 6.35;
zahl = pow(zahl, 5.19);

ostringstream Str;
Str &lt;&lt; zahl;
std::string ZahlAlsString(Str.str());
</code></pre>
<p>zahl ist bei dem Beispiel 14668.835363 usw. Der String ist aber nur &quot;14668.8&quot; ( ZahlAlsString.size() == 7 ). Gibt es eine Möglichkeit sämtliche Nachkommastellen einer double Variable in einen String zu schreiben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1693787</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1693787</guid><dc:creator><![CDATA[wook]]></dc:creator><pubDate>Fri, 10 Apr 2009 03:40:35 GMT</pubDate></item><item><title><![CDATA[Reply to Double nach String Genauigkeitsproblem on Fri, 10 Apr 2009 08:45:38 GMT]]></title><description><![CDATA[<p>Google ist dein Freund <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>
<p><a href="http://www.google.at/search?hl=de&amp;q=c%2B%2B+double+to+string&amp;btnG=Google-Suche&amp;meta=&amp;aq=f&amp;oq=" rel="nofollow">http://www.google.at/search?hl=de&amp;q=c%2B%2B+double+to+string&amp;btnG=Google-Suche&amp;meta=&amp;aq=f&amp;oq=</a></p>
<p>Keros</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1693826</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1693826</guid><dc:creator><![CDATA[Keros]]></dc:creator><pubDate>Fri, 10 Apr 2009 08:45:38 GMT</pubDate></item></channel></rss>