<?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[Umrechnung einer negativen Zahl im Datentyp short int.]]></title><description><![CDATA[<p>Ich bin mir unsicher was das Rechnen mit den Vorzeichenbehafteten Zahlen angeht.</p>
<p>Wie lautet Bitdarstellung der Zahl -291 im Datentyp short int</p>
<blockquote>
<p>291 : 2 = 145 Rest: 1<br />
145 : 2 = 72 Rest: 1<br />
72 : 2 = 36 Rest: 0<br />
36 : 2 = 18 Rest: 0<br />
18 : 2 = 9 Rest: 0<br />
9 : 2 = 4 Rest: 1<br />
4 : 2 = 2 Rest: 0<br />
2 : 2 = 1 Rest: 0<br />
1 : 2 = 0 Rest: 1</p>
<p>Resultat: 100100011</p>
</blockquote>
<p>Wäre dann -291 = <strong>1</strong>100100011 ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/205398/umrechnung-einer-negativen-zahl-im-datentyp-short-int</link><generator>RSS for Node</generator><lastBuildDate>Fri, 09 Oct 2026 02:20:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/205398.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 13 Feb 2008 20:34:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Umrechnung einer negativen Zahl im Datentyp short int. on Wed, 13 Feb 2008 20:34:33 GMT]]></title><description><![CDATA[<p>Ich bin mir unsicher was das Rechnen mit den Vorzeichenbehafteten Zahlen angeht.</p>
<p>Wie lautet Bitdarstellung der Zahl -291 im Datentyp short int</p>
<blockquote>
<p>291 : 2 = 145 Rest: 1<br />
145 : 2 = 72 Rest: 1<br />
72 : 2 = 36 Rest: 0<br />
36 : 2 = 18 Rest: 0<br />
18 : 2 = 9 Rest: 0<br />
9 : 2 = 4 Rest: 1<br />
4 : 2 = 2 Rest: 0<br />
2 : 2 = 1 Rest: 0<br />
1 : 2 = 0 Rest: 1</p>
<p>Resultat: 100100011</p>
</blockquote>
<p>Wäre dann -291 = <strong>1</strong>100100011 ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1455381</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1455381</guid><dc:creator><![CDATA[MarcR]]></dc:creator><pubDate>Wed, 13 Feb 2008 20:34:33 GMT</pubDate></item><item><title><![CDATA[Reply to Umrechnung einer negativen Zahl im Datentyp short int. on Wed, 13 Feb 2008 20:43:02 GMT]]></title><description><![CDATA[<p>Vorzeichen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1455386</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1455386</guid><dc:creator><![CDATA[*D*]]></dc:creator><pubDate>Wed, 13 Feb 2008 20:43:02 GMT</pubDate></item><item><title><![CDATA[Reply to Umrechnung einer negativen Zahl im Datentyp short int. on Wed, 13 Feb 2008 21:16:29 GMT]]></title><description><![CDATA[<p>Kommt ganz auf die Darstellungsweise an. Da gibt es verschiedene Möglichkeiten.</p>
<p>Aber normalerweise wird das Zweierkomlement gebildet:</p>
<p>- höchstes Bit gibt Vorzeichen an<br />
- restlichen Bits werden negiert<br />
- +1</p>
<p>=&gt; -291 = 1011011101</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1455449</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1455449</guid><dc:creator><![CDATA[Tobias W]]></dc:creator><pubDate>Wed, 13 Feb 2008 21:16:29 GMT</pubDate></item><item><title><![CDATA[Reply to Umrechnung einer negativen Zahl im Datentyp short int. on Wed, 13 Feb 2008 22:40:57 GMT]]></title><description><![CDATA[<p>danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--smiling_face_with_sunglasses"
      title="8)"
      alt="😎"
    /> , aber irgendwie komme ich nicht auf die 10..... ist die null zuviel?</p>
<p>-291 = <strong>10</strong>11011101</p>
<p>-291 = 11011101</p>
<blockquote>
<p>1. Vorzeichen ignorieren und ins Binärsystem umrechnen: 291(10) = 100100011(2)<br />
2. Invertieren, da negativ: 011011100<br />
3. Eins addieren, da negativ: 011011100 + 00000001 = 11011101<br />
-291(10) = 11011101(2)</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1455499</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1455499</guid><dc:creator><![CDATA[MarcR]]></dc:creator><pubDate>Wed, 13 Feb 2008 22:40:57 GMT</pubDate></item><item><title><![CDATA[Reply to Umrechnung einer negativen Zahl im Datentyp short int. on Thu, 14 Feb 2008 01:39:42 GMT]]></title><description><![CDATA[<p>hmm...vllt. hilfts:</p>
<p>binärzahlen negieren funktioniert so:</p>
<p>alle zahlen invertieren und anschließend 1 addieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1455537</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1455537</guid><dc:creator><![CDATA[XaTrIxX]]></dc:creator><pubDate>Thu, 14 Feb 2008 01:39:42 GMT</pubDate></item><item><title><![CDATA[Reply to Umrechnung einer negativen Zahl im Datentyp short int. on Thu, 14 Feb 2008 06:35:54 GMT]]></title><description><![CDATA[<p>MarcR schrieb:</p>
<blockquote>
<p>...</p>
</blockquote>
<p>Und der nächste Punkt: Beachte dabei die Größe des Datentyps. Selbst wenn 3 die binäre Darstellung &quot;10&quot; hat, so stehen je nach länge des Datentypes noch mehr oder weniger 0en davor.</p>
<p>cu André</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1455550</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1455550</guid><dc:creator><![CDATA[asc]]></dc:creator><pubDate>Thu, 14 Feb 2008 06:35:54 GMT</pubDate></item><item><title><![CDATA[Reply to Umrechnung einer negativen Zahl im Datentyp short int. on Thu, 14 Feb 2008 10:43:49 GMT]]></title><description><![CDATA[<p>da short-INT 16Bit hat wäre die -291</p>
<p>1. Vorzeichen ignorieren und ins Binärsystem umrechnen: 291(10) = 100100011(2)<br />
2. Invertieren, da negativ: 011011100<br />
3. Eins addieren, da negativ: 011011100 + 00000001 = 11011101<br />
-291(10) = 11011101(2)</p>
<p><strong>Vorzeichenbit &quot;15tes Bit&quot;</strong> / <em>8-14 Bit auffüllen</em> / 0-7 Bit -291<br />
<strong>[1]</strong> / <em>000000</em> / 11011101</p>
<p>-&gt; 1000000011011101</p>
<p>Kann das Stimmen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1455711</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1455711</guid><dc:creator><![CDATA[MarcR]]></dc:creator><pubDate>Thu, 14 Feb 2008 10:43:49 GMT</pubDate></item><item><title><![CDATA[Reply to Umrechnung einer negativen Zahl im Datentyp short int. on Thu, 14 Feb 2008 10:51:44 GMT]]></title><description><![CDATA[<p>Du brauchst nichts auffüllen, beachte einfach die Länge des Datentypen:</p>
<p>1. Vorzeichen ignorieren und ins Binärsystem umrechnen (und <strong>hier</strong> schon die Breite beachten): 291(10) = 0000000100100011(2)<br />
2. Zweierkomplement bilden, da negativ:<br />
2a. Invertieren: 1111111011011100<br />
2b. Eins addieren: 1111111011011100 + 1 = 1111111011011101</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1455717</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1455717</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Thu, 14 Feb 2008 10:51:44 GMT</pubDate></item><item><title><![CDATA[Reply to Umrechnung einer negativen Zahl im Datentyp short int. on Thu, 14 Feb 2008 11:34:07 GMT]]></title><description><![CDATA[<p>oh, merci <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1455752</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1455752</guid><dc:creator><![CDATA[MarcR]]></dc:creator><pubDate>Thu, 14 Feb 2008 11:34:07 GMT</pubDate></item><item><title><![CDATA[Reply to Umrechnung einer negativen Zahl im Datentyp short int. on Thu, 14 Feb 2008 11:36:07 GMT]]></title><description><![CDATA[<p>du kannst auch erst im Nachhinein auffüllen, allerdings werden negative Zahlen mit 1 statt mit 0 aufgefüllt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1455754</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1455754</guid><dc:creator><![CDATA[zwutz]]></dc:creator><pubDate>Thu, 14 Feb 2008 11:36:07 GMT</pubDate></item></channel></rss>