<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Useful hints: #1 &#8211; Odd/Even numbers (Modulo operator [%] and Bitwise And [&amp;])</title>
	<atom:link href="http://www.eoingriffin.com/code-hints/useful-hints-1-oddeven-numbers-modulo-operator/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eoingriffin.com/code-hints/useful-hints-1-oddeven-numbers-modulo-operator/</link>
	<description>Web/Multimedia Design &#38; Development Portfolio</description>
	<lastBuildDate>Mon, 14 Mar 2011 08:28:15 +0000</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Eoin</title>
		<link>http://www.eoingriffin.com/code-hints/useful-hints-1-oddeven-numbers-modulo-operator/comment-page-1/#comment-60</link>
		<dc:creator>Eoin</dc:creator>
		<pubDate>Mon, 14 Mar 2011 08:28:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.eoingriffin.com/?p=212#comment-60</guid>
		<description>That doesn&#039;t seem to be the case for modulo and bitwise &amp;. If you run a speed test, you&#039;ll find that modulo is significantly slower than the bitwise &amp;.
You could be right about the the &gt;&gt; and / 2 though. They seem to perform very similarly.</description>
		<content:encoded><![CDATA[<p>That doesn&#8217;t seem to be the case for modulo and bitwise &#038;. If you run a speed test, you&#8217;ll find that modulo is significantly slower than the bitwise &#038;.<br />
You could be right about the the >> and / 2 though. They seem to perform very similarly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PeWu</title>
		<link>http://www.eoingriffin.com/code-hints/useful-hints-1-oddeven-numbers-modulo-operator/comment-page-1/#comment-37</link>
		<dc:creator>PeWu</dc:creator>
		<pubDate>Sat, 04 Sep 2010 21:39:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.eoingriffin.com/?p=212#comment-37</guid>
		<description>The compiler will usually optimize (among others) &lt;i&gt;modulo 2&lt;/i&gt; and &lt;/i&gt;divide by 2&lt;/i&gt;, so you can safely write what you mean in your code instead of making the code unreadable.

So it&#039;s actually better to write &lt;b&gt;x/2&lt;/b&gt; instead of &lt;b&gt;x &gt;&gt; 1&lt;/b&gt; and &lt;b&gt;x%2&lt;/b&gt; instead of &lt;b&gt;x&amp;1&lt;/b&gt;.</description>
		<content:encoded><![CDATA[<p>The compiler will usually optimize (among others) <i>modulo 2</i> and divide by 2, so you can safely write what you mean in your code instead of making the code unreadable.</p>
<p>So it&#8217;s actually better to write <b>x/2</b> instead of <b>x &gt;&gt; 1</b> and <b>x%2</b> instead of <b>x&amp;1</b>.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

