<?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[Modulo durch logisches Verunden]]></title><description><![CDATA[<p>Hallo,</p>
<p>warum ist das Ergebnis der bitweisen Verundung einer Zahl a mit 31 das gleiche wie</p>
<p>a = a % 32?</p>
<p>In assembler sähe das so aus: andl $0x1f, %eax</p>
<p>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/314597/modulo-durch-logisches-verunden</link><generator>RSS for Node</generator><lastBuildDate>Sat, 01 Aug 2026 06:00:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/314597.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Mar 2013 15:04:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Modulo durch logisches Verunden on Thu, 07 Mar 2013 15:04:20 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>warum ist das Ergebnis der bitweisen Verundung einer Zahl a mit 31 das gleiche wie</p>
<p>a = a % 32?</p>
<p>In assembler sähe das so aus: andl $0x1f, %eax</p>
<p>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2305034</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2305034</guid><dc:creator><![CDATA[hex123]]></dc:creator><pubDate>Thu, 07 Mar 2013 15:04:20 GMT</pubDate></item><item><title><![CDATA[Reply to Modulo durch logisches Verunden on Thu, 07 Mar 2013 15:08:26 GMT]]></title><description><![CDATA[<p>Weil beim Ver-Unden nur die Bits durchkommen, die bei der Darstellung von der Zahl 31 auf 1 sind (die ersten 5 kleinsten Bits).</p>
<p>Beim Modulieren ist der Wertebereich so gross wie der Modulant (nennt man den so oO).</p>
<p>x % m = y, wobei 0 &lt;= y &lt; m</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2305037</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2305037</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Thu, 07 Mar 2013 15:08:26 GMT</pubDate></item><item><title><![CDATA[Reply to Modulo durch logisches Verunden on Thu, 07 Mar 2013 15:14:00 GMT]]></title><description><![CDATA[<p>Sei (x y) Binärdarstellung von a, wobei y die hinteren 5 Bits und x die restlichen Bits sind. Dann ist a = 32x + y. Es gilt a &amp; 31 = y, weil nur die 5 hinteren Bits von a stehen bleiben. Es gilt aber auch a % 32 = (32x + y) % 32 = (32x % 32) + (y % 32) = 0 + y, weil 32x durch 32 teilbar ist.</p>
<p>Edit: Das klappt natürlich auch mit jeder anderen Zweierpotenz, aber mit keiner Zahl, die keine Zweierpotenz ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2305039</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2305039</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Thu, 07 Mar 2013 15:14:00 GMT</pubDate></item></channel></rss>