<?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[Ganz präzise]]></title><description><![CDATA[<p><strong>Hallo!</strong></p>
<p>Welche der folgenden Abfragen ist die treffendste:</p>
<pre><code class="language-cpp">typedef unsigned __int64 bitboard;

bitboard a, b;

if ((a &amp; b) == bitboard(0))

if (!(a &amp; b))

if ((a &amp; b) == false)
</code></pre>
<p>Das ist bei mir ein grundsätzliches Problem. Ich bin mir nicht sicher, was tatsächlich &quot;korrekt&quot; ist. <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=":confused:"
      alt="😕"
    /></p>
<p><strong>Danke schonmal!</strong></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/252265/ganz-präzise</link><generator>RSS for Node</generator><lastBuildDate>Mon, 14 Sep 2026 13:26:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/252265.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 17 Oct 2009 08:30:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ganz präzise on Sat, 17 Oct 2009 08:30:00 GMT]]></title><description><![CDATA[<p><strong>Hallo!</strong></p>
<p>Welche der folgenden Abfragen ist die treffendste:</p>
<pre><code class="language-cpp">typedef unsigned __int64 bitboard;

bitboard a, b;

if ((a &amp; b) == bitboard(0))

if (!(a &amp; b))

if ((a &amp; b) == false)
</code></pre>
<p>Das ist bei mir ein grundsätzliches Problem. Ich bin mir nicht sicher, was tatsächlich &quot;korrekt&quot; ist. <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=":confused:"
      alt="😕"
    /></p>
<p><strong>Danke schonmal!</strong></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1793690</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1793690</guid><dc:creator><![CDATA[Tomahawk]]></dc:creator><pubDate>Sat, 17 Oct 2009 08:30:00 GMT</pubDate></item><item><title><![CDATA[Reply to Ganz präzise on Sat, 17 Oct 2009 08:46:10 GMT]]></title><description><![CDATA[<p>Tomahawk schrieb:</p>
<blockquote>
<p>Welche der folgenden Abfragen ist die treffendste:</p>
</blockquote>
<p>Um welches Ziel zu erreichen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1793692</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1793692</guid><dc:creator><![CDATA[vonwegenpräzise]]></dc:creator><pubDate>Sat, 17 Oct 2009 08:46:10 GMT</pubDate></item><item><title><![CDATA[Reply to Ganz präzise on Sat, 17 Oct 2009 10:09:58 GMT]]></title><description><![CDATA[<p>Ich wüsste nicht, was gegen &quot;if (!(a &amp; b))&quot; sprechen sollte, aber &quot;if ((a &amp; b) == false)&quot; dürfte gleichwertig, nur halt länger sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1793716</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1793716</guid><dc:creator><![CDATA[feigling]]></dc:creator><pubDate>Sat, 17 Oct 2009 10:09:58 GMT</pubDate></item><item><title><![CDATA[Reply to Ganz präzise on Sat, 17 Oct 2009 10:11:13 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">if(a &amp; b == 0)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1793717</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1793717</guid><dc:creator><![CDATA[abstuhl]]></dc:creator><pubDate>Sat, 17 Oct 2009 10:11:13 GMT</pubDate></item><item><title><![CDATA[Reply to Ganz präzise on Sat, 17 Oct 2009 11:51:16 GMT]]></title><description><![CDATA[<p>Da (a &amp; b) aber keinen boolschen Wert erzeugt, würde ich auf keinen Fall &quot;((a &amp; b) == false&quot; schreiben (da dort dann eine Promotion stattfindet).<br />
Auch &quot;!(a &amp; b)&quot; würde ich nicht schreiben (ähnlich wie bei strcmp(s1, s2)), da als Resultat eine Zahl rauskommt.</p>
<p>Mein Favorit wäre demnach auch:</p>
<pre><code class="language-cpp">if(a &amp; b == 0)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1793766</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1793766</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Sat, 17 Oct 2009 11:51:16 GMT</pubDate></item><item><title><![CDATA[Reply to Ganz präzise on Sat, 17 Oct 2009 11:54:24 GMT]]></title><description><![CDATA[<p>Einhellig ohne Klammern also. Das überrascht mich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1793768</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1793768</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sat, 17 Oct 2009 11:54:24 GMT</pubDate></item><item><title><![CDATA[Reply to Ganz präzise on Sat, 17 Oct 2009 12:02:16 GMT]]></title><description><![CDATA[<p>Th69 schrieb:</p>
<blockquote>
<p>Da (a &amp; b) aber keinen boolschen Wert erzeugt, würde ich auf keinen Fall &quot;((a &amp; b) == false&quot; schreiben (da dort dann eine Promotion stattfindet).<br />
Auch &quot;!(a &amp; b)&quot; würde ich nicht schreiben (ähnlich wie bei strcmp(s1, s2)), da als Resultat eine Zahl rauskommt.</p>
<p>Mein Favorit wäre demnach auch:</p>
<pre><code class="language-cpp">if(a &amp; b == 0)
</code></pre>
</blockquote>
<p>Das ist auch mein Favorit, da es sich hier nicht um eine true/false oder 1/0 Operation handelt, sondern um einen Bitfilter.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1793774</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1793774</guid><dc:creator><![CDATA[Tomahawk]]></dc:creator><pubDate>Sat, 17 Oct 2009 12:02:16 GMT</pubDate></item><item><title><![CDATA[Reply to Ganz präzise on Sat, 17 Oct 2009 12:38:15 GMT]]></title><description><![CDATA[<p>Th69 schrieb:</p>
<blockquote>
<pre><code class="language-cpp">if(a &amp; b == 0)
</code></pre>
</blockquote>
<p><code>==</code> hat aber Vorrang vor <code>&amp;</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1793800</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1793800</guid><dc:creator><![CDATA[Registrierter Troll]]></dc:creator><pubDate>Sat, 17 Oct 2009 12:38:15 GMT</pubDate></item><item><title><![CDATA[Reply to Ganz präzise on Sun, 18 Oct 2009 10:26:46 GMT]]></title><description><![CDATA[<p>Ups, ja stimmt, also noch mal, aber richtig (das kommt davon, wenn man einfach nur C&amp;P benutzt -):</p>
<pre><code class="language-cpp">if((a &amp; b) == 0)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1794129</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1794129</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Sun, 18 Oct 2009 10:26:46 GMT</pubDate></item><item><title><![CDATA[Reply to Ganz präzise on Sun, 18 Oct 2009 10:34:22 GMT]]></title><description><![CDATA[<p>Tut mir leid das ich eine fehlerhafte Copy &amp; Paste Vorlage bereitstellte. <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1794132</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1794132</guid><dc:creator><![CDATA[abstuhl]]></dc:creator><pubDate>Sun, 18 Oct 2009 10:34:22 GMT</pubDate></item></channel></rss>