<?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[2 variablne voneinander abziehn]]></title><description><![CDATA[<p>hi<br />
ich habe 2 uint64 variablen und will die voneinander abziehn damit der entwert nicht größer als 5 oder so ist</p>
<p>habs derzeit so gemacht</p>
<pre><code class="language-cpp">updiff = (Total0() - Total2());

			if(  updiff &gt; 9.2*1024*1024)
...
</code></pre>
<p>jedoch funzt das nicht</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/181875/2-variablne-voneinander-abziehn</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 10:24:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/181875.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 18 May 2007 12:10:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 2 variablne voneinander abziehn on Fri, 18 May 2007 12:10:48 GMT]]></title><description><![CDATA[<p>hi<br />
ich habe 2 uint64 variablen und will die voneinander abziehn damit der entwert nicht größer als 5 oder so ist</p>
<p>habs derzeit so gemacht</p>
<pre><code class="language-cpp">updiff = (Total0() - Total2());

			if(  updiff &gt; 9.2*1024*1024)
...
</code></pre>
<p>jedoch funzt das nicht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1287355</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1287355</guid><dc:creator><![CDATA[Cobain86]]></dc:creator><pubDate>Fri, 18 May 2007 12:10:48 GMT</pubDate></item><item><title><![CDATA[Reply to 2 variablne voneinander abziehn on Fri, 18 May 2007 12:15:46 GMT]]></title><description><![CDATA[<p>Und was genau funktioniert daran nicht?</p>
<p>(btw, aus dem Code-Schnipselchen kann man <strong>gar nichts</strong> erkennen)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1287357</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1287357</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 18 May 2007 12:15:46 GMT</pubDate></item><item><title><![CDATA[Reply to 2 variablne voneinander abziehn on Fri, 18 May 2007 12:18:15 GMT]]></title><description><![CDATA[<p>es funktioniert einfach nicht</p>
<p>der gibt die ausgabe schon bevor der wert 9,2 erreicht wurde aus!<br />
und er soll ja die ausgabe erst rausgeben wenn der wert überstiegen wurde und das funktioniert nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1287360</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1287360</guid><dc:creator><![CDATA[Cobain86]]></dc:creator><pubDate>Fri, 18 May 2007 12:18:15 GMT</pubDate></item><item><title><![CDATA[Reply to 2 variablne voneinander abziehn on Fri, 18 May 2007 12:20:19 GMT]]></title><description><![CDATA[<p>Dann zeig doch mal etwas mehr Code - wie gesagt kann man dort nichts erkennen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1287362</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1287362</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 18 May 2007 12:20:19 GMT</pubDate></item><item><title><![CDATA[Reply to 2 variablne voneinander abziehn on Fri, 18 May 2007 12:22:35 GMT]]></title><description><![CDATA[<p>[cpp]<br />
uint64 updiff;</p>
<p>updiff = (UploadedTotal() - DownloadedTotal());</p>
<p>if( updiff &gt; 9.2*1024*1024)</p>
<p>{<br />
Log(_T(&quot;OKAY&quot;));<br />
return true;<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1287365</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1287365</guid><dc:creator><![CDATA[Cobain86]]></dc:creator><pubDate>Fri, 18 May 2007 12:22:35 GMT</pubDate></item><item><title><![CDATA[Reply to 2 variablne voneinander abziehn on Fri, 18 May 2007 12:25:48 GMT]]></title><description><![CDATA[<p>Und was für Werte bekommst du von UploadedTotal() und DownloadedTotal()? (ein uint* ist unsigned, wenn die Differenz negativ wird, greift die Modulo-Arithmetik und du bekommst ein Ergebnis in der Größenordnung von 2<sup>64</sup>)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1287367</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1287367</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 18 May 2007 12:25:48 GMT</pubDate></item><item><title><![CDATA[Reply to 2 variablne voneinander abziehn on Fri, 18 May 2007 12:32:18 GMT]]></title><description><![CDATA[<p>achso<br />
mist das wusste ich nicht</p>
<p>ja die totals sind auch als uint64 deklariert<br />
und da die ja nicht ins negative gehen dann bringt das auch nichts</p>
<p>kann ich das irgendwie anders lösen ohne die variable zu ändern</p>
<p>der total gibt MB werte aus, bzw. byte werte<br />
eben was man gerade zu einem ftp server hochgeladen hat bzw. ein interener firmenclient.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1287369</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1287369</guid><dc:creator><![CDATA[Cobain86]]></dc:creator><pubDate>Fri, 18 May 2007 12:32:18 GMT</pubDate></item><item><title><![CDATA[Reply to 2 variablne voneinander abziehn on Fri, 18 May 2007 12:43:30 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>also Dein Sprachgebrauch lässt &quot;Ungeübtheit&quot; vermuten, deswegen mal kurz zur Klärung: updiff ist die einzige <em>Variable</em>, die Du überhaupt in den Händen hältst. Und dass Du die Rückgabewerte der Funktionen ändern kannst, wird aller Voraussicht nach auch nicht vorkommen...</p>
<p>Wenn Du Sorge vor einem Überlauf der Differenz hast, kannst Du erst die Funktionswerte gegeneinander checken und ggf. &quot;andersherum abziehen&quot;:</p>
<pre><code class="language-cpp">if(UploadedTotal() &gt; DownloadedTotal()) updiff = UploadedTotal() - DownloadedTotal();
else updiff =  DownloadedTotal() - UploadedTotal()
</code></pre>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1287374</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1287374</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Fri, 18 May 2007 12:43:30 GMT</pubDate></item></channel></rss>