<?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[Fließkommafehler ärgert mich]]></title><description><![CDATA[<p>Ich habe ein Programm aufgestellt und nun muss<br />
ich fest stellen, dass alle Rechnungen durch die<br />
Fließkommafehler in einem solchen Grad verfälscht wurden,<br />
dass die Ergebnisse nicht mehr zumutbar sind.</p>
<p>Ich habe schon von GMP gehört, aber das zu compilieren<br />
geht mit meinem Compiler (VC2005) leider nicht, ist<br />
auch nicht in der Doku erwähnt wie man das macht.</p>
<p>Gibt es noch eine andere, leichter zu integrierende<br />
Lib, die man in 20 Minuten am Laufen hat?</p>
<p>mfG<br />
Listing</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/182300/fließkommafehler-ärgert-mich</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 18:07:23 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/182300.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 May 2007 14:11:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fließkommafehler ärgert mich on Wed, 23 May 2007 14:11:24 GMT]]></title><description><![CDATA[<p>Ich habe ein Programm aufgestellt und nun muss<br />
ich fest stellen, dass alle Rechnungen durch die<br />
Fließkommafehler in einem solchen Grad verfälscht wurden,<br />
dass die Ergebnisse nicht mehr zumutbar sind.</p>
<p>Ich habe schon von GMP gehört, aber das zu compilieren<br />
geht mit meinem Compiler (VC2005) leider nicht, ist<br />
auch nicht in der Doku erwähnt wie man das macht.</p>
<p>Gibt es noch eine andere, leichter zu integrierende<br />
Lib, die man in 20 Minuten am Laufen hat?</p>
<p>mfG<br />
Listing</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1290757</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1290757</guid><dc:creator><![CDATA[Listing]]></dc:creator><pubDate>Wed, 23 May 2007 14:11:24 GMT</pubDate></item><item><title><![CDATA[Reply to Fließkommafehler ärgert mich on Wed, 23 May 2007 14:41:05 GMT]]></title><description><![CDATA[<p>Um wie viele Nachkommastellen handelt es sich denn?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1290778</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1290778</guid><dc:creator><![CDATA[temporärer-gast]]></dc:creator><pubDate>Wed, 23 May 2007 14:41:05 GMT</pubDate></item><item><title><![CDATA[Reply to Fließkommafehler ärgert mich on Wed, 23 May 2007 14:46:55 GMT]]></title><description><![CDATA[<p>temporärer-gast schrieb:</p>
<blockquote>
<p>Um wie viele Nachkommastellen handelt es sich denn?</p>
</blockquote>
<p>Es geht darum, dass er eine Zahl fälschlich als eine ganze Zahl erkennt die keine ist. Denn 4.000005 ist ja nicht 4 <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":/"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1290784</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1290784</guid><dc:creator><![CDATA[Listing]]></dc:creator><pubDate>Wed, 23 May 2007 14:46:55 GMT</pubDate></item><item><title><![CDATA[Reply to Fließkommafehler ärgert mich on Wed, 23 May 2007 14:49:50 GMT]]></title><description><![CDATA[<p>Vielleicht werden in deinem Programm inplizierte Typprüfungen durchgeführt, also z.b. flot -&gt; int.</p>
<p>Gcc gibt mit entsprechen Flags dabei jedoch eine Warnmeldung aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1290790</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1290790</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Wed, 23 May 2007 14:49:50 GMT</pubDate></item><item><title><![CDATA[Reply to Fließkommafehler ärgert mich on Wed, 23 May 2007 15:22:52 GMT]]></title><description><![CDATA[<p>long double a = 4.000005L;<br />
Das geht nicht? Bist du dir da sicher?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1290822</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1290822</guid><dc:creator><![CDATA[temporärer-gast]]></dc:creator><pubDate>Wed, 23 May 2007 15:22:52 GMT</pubDate></item><item><title><![CDATA[Reply to Fließkommafehler ärgert mich on Wed, 23 May 2007 15:26:46 GMT]]></title><description><![CDATA[<p>The-Kenny schrieb:</p>
<blockquote>
<p>Vielleicht werden in deinem Programm inplizierte Typprüfungen durchgeführt, also z.b. flot -&gt; int.</p>
<p>Gcc gibt mit entsprechen Flags dabei jedoch eine Warnmeldung aus.</p>
</blockquote>
<p>Ja, ich will die Floatzahl runden um zu gucken ob sie eine ganze Zahl ist</p>
<p>Pseudo-Code:<br />
if(floatNormal == floatGerunded)<br />
break;</p>
<p>Um zu runden convertiere ich in integer und wieder zurück zu float</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1290827</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1290827</guid><dc:creator><![CDATA[Listing]]></dc:creator><pubDate>Wed, 23 May 2007 15:26:46 GMT</pubDate></item><item><title><![CDATA[Reply to Fließkommafehler ärgert mich on Wed, 23 May 2007 15:29:02 GMT]]></title><description><![CDATA[<p>ja, ist doch klar<br />
Beispiel:<br />
float 1,5 wird in int konvertiert, dann ist das wohl 1, dann konvertierst du 1 warscheinlich wieder zurück also 1.0!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1290828</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1290828</guid><dc:creator><![CDATA[temporärer-gast]]></dc:creator><pubDate>Wed, 23 May 2007 15:29:02 GMT</pubDate></item><item><title><![CDATA[Reply to Fließkommafehler ärgert mich on Wed, 23 May 2007 15:38:25 GMT]]></title><description><![CDATA[<p>temporärer-gast schrieb:</p>
<blockquote>
<p>ja, ist doch klar<br />
Beispiel:<br />
float 1,5 wird in int konvertiert, dann ist das wohl 1, dann konvertierst du 1 warscheinlich wieder zurück also 1.0!</p>
</blockquote>
<p>du verstehst was falsch,<br />
ich will wissen ob die Zahl nachkommastellen hat oder nicht...</p>
<pre><code class="language-cpp">comf = myfloat;
rounded = (int)comf;
secf = rounded;
if(secf == comf)
	break;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1290835</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1290835</guid><dc:creator><![CDATA[Listing]]></dc:creator><pubDate>Wed, 23 May 2007 15:38:25 GMT</pubDate></item><item><title><![CDATA[Reply to Fließkommafehler ärgert mich on Wed, 23 May 2007 15:42:51 GMT]]></title><description><![CDATA[<p>Merke, C-Style-Casts sind nicht so praktisch wie C++-Casts <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>Und schreib bitte mal, welche Typen die Variablen haben, und wenn möglich, auch die Stelle an der deiner Meinung nach der Fehler auftritt.</p>
<p>Auch kann es helfen, das Programm mal mit einem Debugger durchzugehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1290840</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1290840</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Wed, 23 May 2007 15:42:51 GMT</pubDate></item><item><title><![CDATA[Reply to Fließkommafehler ärgert mich on Wed, 23 May 2007 15:54:26 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">// IntegerHochrechner.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
//

#include &lt;windows.h&gt;
#include &lt;iostream&gt;
using namespace std;

void main()
{
	//Declarations
	float f;
	int   rounded;
	float comf;
	float secf;
	__int64   i = 0;
	__int64 trylimit;

	cout &lt;&lt; &quot;IntegerHochrechner v1.0 loaded!&quot; &lt;&lt; endl &lt;&lt; &quot;Please enter a float digit: &quot;;
	cin &gt;&gt; f;
	cout &lt;&lt; &quot;How many tries do you want to do?&quot; &lt;&lt; endl &lt;&lt; &quot;Tries: &quot;;
	cin &gt;&gt; trylimit;
	cout &lt;&lt; &quot;Working...&quot; &lt;&lt; endl;

	while (i &lt; trylimit)
	{
		++i;
		comf = (f * i);
		rounded = comf;
		secf = rounded;
		if(secf == comf)
			break;
	}
	cout &lt;&lt; &quot;Calculation done!&quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;Multiplier was identified as: &quot; &lt;&lt; i &lt;&lt; &quot;.&quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;Proof: &quot; &lt;&lt; f &lt;&lt; &quot; * &quot; &lt;&lt; i &lt;&lt; &quot; = &quot; &lt;&lt; comf &lt;&lt; endl;
	system(&quot;pause&quot;);

}
</code></pre>
<blockquote>
<p>IntegerHochrechner v1.0 loaded!<br />
Please enter a float digit: 1.22133<br />
How many tries do you want to do?<br />
Tries: 10000000<br />
Working...<br />
Calculation done!<br />
Multiplier was identified as: 3985.<br />
Proof: 1.22133 * 3985 = 4867<br />
Drücken Sie eine beliebige Taste . . .</p>
</blockquote>
<p>Dabei gilt</p>
<blockquote>
<p>1.22133 * 3985 = 4867,00005</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":/"
      alt="😕"
    /></p>
<p>PS: Jaaaa, ich weiß dass die floatzahl überlaufen kann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1290851</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1290851</guid><dc:creator><![CDATA[Listing]]></dc:creator><pubDate>Wed, 23 May 2007 15:54:26 GMT</pubDate></item><item><title><![CDATA[Reply to Fließkommafehler ärgert mich on Wed, 23 May 2007 16:38:07 GMT]]></title><description><![CDATA[<p>wie wärs wenn du anstatt float mal ein long double versuchst?</p>
<p>double kann schon wirklich eine ganze menge fassen. Aber genau wirst du es nie erreichen, irgendwann ist schluss. Ich kann mir aber auch kaum vorstellen, dass GMP nicht mit MSVC05 läuft. was ist denn das problem?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1290888</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1290888</guid><dc:creator><![CDATA[Maxi]]></dc:creator><pubDate>Wed, 23 May 2007 16:38:07 GMT</pubDate></item><item><title><![CDATA[Reply to Fließkommafehler ärgert mich on Wed, 23 May 2007 17:08:29 GMT]]></title><description><![CDATA[<p>Vielen Dank jetzt ist es etwas genauer, bei großen Zahlen aber immernoch Fehlerbehaftet</p>
<pre><code>IntegerHochrechner v1.0 loaded!
Please enter a float digit: 1.22133
How many tries do you want to do?
Tries: 100000000
Working...
Calculation done!
Multiplier was identified as: 100000.
Proof: 1.22133 * 100000 = 122133
Drücken Sie eine beliebige Taste . . .
</code></pre>
<p>Mit GMP sollte es komplett ohne Fehler gehen, deshalb bin ich da scharf drauf <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Aber in der Manual (<a href="http://gmplib.org/gmp-man-4.2.1.pdf" rel="nofollow">http://gmplib.org/gmp-man-4.2.1.pdf</a>)<br />
steht etwas wie</p>
<pre><code class="language-cpp">GMP has an autoconf/automake/libtool based configuration system. On a Unix-like system a
basic build can be done with
./configure
make
Some self-tests can be run with
make check
And you can install (under ‘/usr/local’ by default) with
make install
If you experience problems, please report them to gmp-bugs@swox.com. See Chapter 4 [Reporting
Bugs], page 28, for information on what to include in useful bug reports.
</code></pre>
<p>Sowas kann man nicht mit vc2005 compilieren, jedenfalls wird nicht erklärt wie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1290924</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1290924</guid><dc:creator><![CDATA[Listing]]></dc:creator><pubDate>Wed, 23 May 2007 17:08:29 GMT</pubDate></item><item><title><![CDATA[Reply to Fließkommafehler ärgert mich on Thu, 24 May 2007 10:42:41 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Wenn du unbedingt GMP willst, hilft dir vielleicht das hier<br />
<a href="http://www.cs.nyu.edu/exact/core/gmp/" rel="nofollow">http://www.cs.nyu.edu/exact/core/gmp/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1291316</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1291316</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 24 May 2007 10:42:41 GMT</pubDate></item></channel></rss>