<?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[Zahlen]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie kann ich, wenn ich eine Zahl &lt; 0 herausbekomme, bei einer if-Anweisung dann sagen, dass er das - nicht beachten soll?</p>
<p>Beispiel: ich bekomme eine -1 möchte ich meiner if-Anweisung aber nur mit der 1 prüfen! Also das - ignorieren!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/74950/zahlen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 28 Jun 2026 03:49:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/74950.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 26 May 2004 07:23:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zahlen on Wed, 26 May 2004 07:23:53 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie kann ich, wenn ich eine Zahl &lt; 0 herausbekomme, bei einer if-Anweisung dann sagen, dass er das - nicht beachten soll?</p>
<p>Beispiel: ich bekomme eine -1 möchte ich meiner if-Anweisung aber nur mit der 1 prüfen! Also das - ignorieren!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/527367</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/527367</guid><dc:creator><![CDATA[neuling12]]></dc:creator><pubDate>Wed, 26 May 2004 07:23:53 GMT</pubDate></item><item><title><![CDATA[Reply to Zahlen on Wed, 26 May 2004 07:41:50 GMT]]></title><description><![CDATA[<p>Vielleicht hilft dir ja abs().</p>
]]></description><link>https://www.c-plusplus.net/forum/post/527377</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/527377</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Wed, 26 May 2004 07:41:50 GMT</pubDate></item><item><title><![CDATA[Reply to Zahlen on Wed, 26 May 2004 07:45:25 GMT]]></title><description><![CDATA[<p>jaaa, danke dir!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/527383</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/527383</guid><dc:creator><![CDATA[neuling12]]></dc:creator><pubDate>Wed, 26 May 2004 07:45:25 GMT</pubDate></item><item><title><![CDATA[Reply to Zahlen on Wed, 26 May 2004 07:47:38 GMT]]></title><description><![CDATA[<p>Oder wenn du das mit if machen möchtest:</p>
<pre><code class="language-cpp">if (zahl&lt;0) zahl*=-1; // *= rechnet die Zahl mal -1 (Vorzeichen umkehren) und weist das Ergebnis gleich zu.
</code></pre>
<p>EDIT: Zu lahm... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/527384</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/527384</guid><dc:creator><![CDATA[Windoof]]></dc:creator><pubDate>Wed, 26 May 2004 07:47:38 GMT</pubDate></item><item><title><![CDATA[Reply to Zahlen on Wed, 26 May 2004 07:46:50 GMT]]></title><description><![CDATA[<p>Ich weiß nicht wie du das meinst, aber so müsste es gehen.</p>
<pre><code>int dummy = 0; //0 oder die Zahl die bei dir herauskommt
if(dummy &gt;= 0)
{
   //Mache dies, wenn alles über Null ist.
}
</code></pre>
<p>... oder ...</p>
<pre><code>if(dummy &gt;= 0 &amp;&amp; dummy &lt;= 1)
{
   // Mache das, wenn Variable 0 oder 1 ist. Oder alles dazwischen
}
</code></pre>
<p>... oder ...</p>
<pre><code>switch(dummy)
{
   case 0: /*Mach dies hier*/ ;break;
   case 1: /*Mach das  hier*/ ;break;
   default:/*Mach dieses, wenn keine 1 oder 0 da ist*/
}
</code></pre>
<p>(N)ever Touch A Running System!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/527385</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/527385</guid><dc:creator><![CDATA[The OS]]></dc:creator><pubDate>Wed, 26 May 2004 07:46:50 GMT</pubDate></item><item><title><![CDATA[Reply to Zahlen on Wed, 26 May 2004 07:50:07 GMT]]></title><description><![CDATA[<p>das abs() hat schon geholfen! sieht jetzt so aus:</p>
<pre><code>if(abs(reststunde_neu) &lt;= (StringGrid1-&gt;Cells[i+1][2].ToIntDef(0)))
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/527387</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/527387</guid><dc:creator><![CDATA[neuling12]]></dc:creator><pubDate>Wed, 26 May 2004 07:50:07 GMT</pubDate></item><item><title><![CDATA[Reply to Zahlen on Wed, 26 May 2004 07:52:11 GMT]]></title><description><![CDATA[<p>Ähm... Zum ersten:<br />
Er will die Zahl auch auswerten, wenn sie unter null ist</p>
<p>Zum zweiten:<br />
Schonmal was von Booleans gehört?</p>
<p>Zum dritten:<br />
Naja, no comment.</p>
<p>abs oder das was ich da geschrieben hatte sind wirklich besser.</p>
<p>EDIT: Galt für The OS.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/527389</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/527389</guid><dc:creator><![CDATA[Windoof]]></dc:creator><pubDate>Wed, 26 May 2004 07:52:11 GMT</pubDate></item></channel></rss>