<?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 werte vergleichen]]></title><description><![CDATA[<p>hallo<br />
gibt es eine funktion mit der man double werte vergleichen kann. Ein normales == kann problematisch sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/169215/double-werte-vergleichen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 16:29:47 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/169215.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 03 Jan 2007 10:41:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to double werte vergleichen on Wed, 03 Jan 2007 10:41:42 GMT]]></title><description><![CDATA[<p>hallo<br />
gibt es eine funktion mit der man double werte vergleichen kann. Ein normales == kann problematisch sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1201701</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1201701</guid><dc:creator><![CDATA[hi]]></dc:creator><pubDate>Wed, 03 Jan 2007 10:41:42 GMT</pubDate></item><item><title><![CDATA[Reply to double werte vergleichen on Wed, 03 Jan 2007 10:45:42 GMT]]></title><description><![CDATA[<p>Definiere gleich.</p>
<p>Vllt. reicht Dir aber schon ein mal 100 und das jeweils als int vergleichen !?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1201707</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1201707</guid><dc:creator><![CDATA[Knuddlbaer]]></dc:creator><pubDate>Wed, 03 Jan 2007 10:45:42 GMT</pubDate></item><item><title><![CDATA[Reply to double werte vergleichen on Wed, 03 Jan 2007 10:50:25 GMT]]></title><description><![CDATA[<p>Wenn dir ein &quot;fast gleich&quot; ausreicht, kannst du auch die Differenz der Werte bilden und mit einer Fehlerschranke vergleichen:</p>
<pre><code class="language-cpp">if(fabs(x-y)&lt;epsilon) cout&lt;&lt;&quot;Werte sind gleich&quot;;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1201714</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1201714</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 03 Jan 2007 10:50:25 GMT</pubDate></item><item><title><![CDATA[Reply to double werte vergleichen on Wed, 03 Jan 2007 10:52:03 GMT]]></title><description><![CDATA[<p>hallo,<br />
ja an das dachte ich auch. z.b. den double wert mal 1000000 und dann als int vergleichen. In delphi gibt es eine funktion bei der man angeben kann bis zur wievielten stellen der double wert auf gleichheit überprüft werden soll. Falls es dies in c/c++ nicht gibt werde ich es so machen wie du geschrieben hast.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1201717</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1201717</guid><dc:creator><![CDATA[hi]]></dc:creator><pubDate>Wed, 03 Jan 2007 10:52:03 GMT</pubDate></item><item><title><![CDATA[Reply to double werte vergleichen on Wed, 03 Jan 2007 11:08:05 GMT]]></title><description><![CDATA[<p>Die Variante von CStoll gefällt mir aber besser, wird deutlich weniger Rechenzeit verbraten <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1201734</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1201734</guid><dc:creator><![CDATA[Knuddlbaer]]></dc:creator><pubDate>Wed, 03 Jan 2007 11:08:05 GMT</pubDate></item><item><title><![CDATA[Reply to double werte vergleichen on Wed, 03 Jan 2007 14:45:46 GMT]]></title><description><![CDATA[<p>Geht das nicht so irgendwie?</p>
<pre><code class="language-cpp">if( std::abs(x-y) &lt; (std::max(std::abs(x), std::abs(y)) + 1) * epsilon )
    {
        // &quot;gleich&quot;, hurrah
    }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1201985</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1201985</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Wed, 03 Jan 2007 14:45:46 GMT</pubDate></item></channel></rss>