<?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: Evens and Odds</title>
	<atom:link href="http://blogs.mathworks.com/loren/2009/08/13/evens-and-odds/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren/2009/08/13/evens-and-odds/</link>
	<description>Loren Shure works on design of the MATLAB language at MathWorks. She writes here about once a week on MATLAB programming and related topics.</description>
	<lastBuildDate>Thu, 09 Feb 2012 04:19:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Joachim</title>
		<link>http://blogs.mathworks.com/loren/2009/08/13/evens-and-odds/#comment-30538</link>
		<dc:creator>Joachim</dc:creator>
		<pubDate>Tue, 18 Aug 2009 03:34:14 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2009/08/13/evens-and-odds/#comment-30538</guid>
		<description>Very interesting post, Loren. Unfortunately, I don&#039;t have an example application.

Just wanted to point out that it appears a bitwise logical AND comparison would be more efficient than a modulus operation. To compute the modulus, you have to do a division which tends to be costly computationally... So I find Urs&#039; code appealing from that perspective. Not 100% sure about Matlab though. What I have in mind is that, AFAIK, C compilers optimize (x%2) to (x&amp;1) if the two are equivalent on the architecture.</description>
		<content:encoded><![CDATA[<p>Very interesting post, Loren. Unfortunately, I don&#8217;t have an example application.</p>
<p>Just wanted to point out that it appears a bitwise logical AND comparison would be more efficient than a modulus operation. To compute the modulus, you have to do a division which tends to be costly computationally&#8230; So I find Urs&#8217; code appealing from that perspective. Not 100% sure about Matlab though. What I have in mind is that, AFAIK, C compilers optimize (x%2) to (x&amp;1) if the two are equivalent on the architecture.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emilie S.</title>
		<link>http://blogs.mathworks.com/loren/2009/08/13/evens-and-odds/#comment-30530</link>
		<dc:creator>Emilie S.</dc:creator>
		<pubDate>Fri, 14 Aug 2009 11:19:51 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2009/08/13/evens-and-odds/#comment-30530</guid>
		<description>This is very impressive indeed. Urs Schwarz&#039;s contribution appears very genius and I will be looking in to this isodd.</description>
		<content:encoded><![CDATA[<p>This is very impressive indeed. Urs Schwarz&#8217;s contribution appears very genius and I will be looking in to this isodd.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://blogs.mathworks.com/loren/2009/08/13/evens-and-odds/#comment-30528</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Fri, 14 Aug 2009 01:06:05 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2009/08/13/evens-and-odds/#comment-30528</guid>
		<description>One function that I often have to be careful with, is using HIST to count unique members of an array:
&lt;pre&gt;
[n,u]=hist(x,unique(x));
&lt;/pre&gt;
This works fine unless x has only one unique element.  There is a good submission on FEX that solves this problem but it would be nice to see a built-in version.

Also, anyone working with large integers (bigger than bitmax) should look at John D&#039;Errico&#039;s marvellous Variable Precision Integer toolbox.</description>
		<content:encoded><![CDATA[<p>One function that I often have to be careful with, is using HIST to count unique members of an array:</p>
<pre>
[n,u]=hist(x,unique(x));
</pre>
<p>This works fine unless x has only one unique element.  There is a good submission on FEX that solves this problem but it would be nice to see a built-in version.</p>
<p>Also, anyone working with large integers (bigger than bitmax) should look at John D&#8217;Errico&#8217;s marvellous Variable Precision Integer toolbox.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

