<?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[Nachkommastelle?]]></title><description><![CDATA[<p>SERVUS.</p>
<p>ich habe das Problem, dass ich ein paar Zahlen habe und ich möchte mittels meines kleinen C++ Programms herausbekommen, ob es sich um ganzzahlige Zahlen oder Zahlen mit Nachkommastellen handelt. Was vor dem Komma steht, interessiert mich eigentlich weniger.</p>
<p>Vielen Dank schonmal.<br />
STICK.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/133712/nachkommastelle</link><generator>RSS for Node</generator><lastBuildDate>Fri, 28 Aug 2026 02:00:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/133712.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 20 Jan 2006 09:16:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Nachkommastelle? on Fri, 20 Jan 2006 09:16:12 GMT]]></title><description><![CDATA[<p>SERVUS.</p>
<p>ich habe das Problem, dass ich ein paar Zahlen habe und ich möchte mittels meines kleinen C++ Programms herausbekommen, ob es sich um ganzzahlige Zahlen oder Zahlen mit Nachkommastellen handelt. Was vor dem Komma steht, interessiert mich eigentlich weniger.</p>
<p>Vielen Dank schonmal.<br />
STICK.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971107</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971107</guid><dc:creator><![CDATA[stick_thai]]></dc:creator><pubDate>Fri, 20 Jan 2006 09:16:12 GMT</pubDate></item><item><title><![CDATA[Reply to Nachkommastelle? on Fri, 20 Jan 2006 09:29:19 GMT]]></title><description><![CDATA[<p>Die einfachste Variante wäre wohl über cast-Operatoren (hat allerdings Probleme mit großen Zahlen):</p>
<pre><code class="language-cpp">double zahl;
...
if(zahl==(long)zahl)
  cout&lt;&lt;&quot;ganzzahlig&quot;;
else
  cout&lt;&lt;&quot;hat Nachkommastellen &quot;&lt;&lt;zahl-(long)zahl;
</code></pre>
<p>Plan B wäre es, die Nachkommastellen der Zahl mit fmod() zu ermitteln:</p>
<pre><code class="language-cpp">double zahl;
double nk=fmod(zahl,1);
if(nk!=0)...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/971121</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971121</guid><dc:creator><![CDATA[CStoll (off)]]></dc:creator><pubDate>Fri, 20 Jan 2006 09:29:19 GMT</pubDate></item><item><title><![CDATA[Reply to Nachkommastelle? on Fri, 20 Jan 2006 09:31:12 GMT]]></title><description><![CDATA[<p>und was ist mit 2.0000000000000001, ist das auch eine &quot;ganzzahl&quot; oder nicht?</p>
<p>empfohlen: (fabs(a-b) &lt; epsilon)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971123</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971123</guid><dc:creator><![CDATA[c.rackwitz]]></dc:creator><pubDate>Fri, 20 Jan 2006 09:31:12 GMT</pubDate></item><item><title><![CDATA[Reply to Nachkommastelle? on Fri, 20 Jan 2006 09:39:39 GMT]]></title><description><![CDATA[<p>vielen dank. ist auf jeden fall was brauchbares dabei.</p>
<p>STICK.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971132</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971132</guid><dc:creator><![CDATA[stick_thai]]></dc:creator><pubDate>Fri, 20 Jan 2006 09:39:39 GMT</pubDate></item></channel></rss>