<?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: Signed versus unsigned integers</title>
	<atom:link href="http://embeddedgurus.com/stack-overflow/2009/05/signed-versus-unsigned-integers/feed/" rel="self" type="application/rss+xml" />
	<link>http://embeddedgurus.com/stack-overflow/2009/05/signed-versus-unsigned-integers/</link>
	<description>Thoughts on embedded systems by Nigel Jones</description>
	<lastBuildDate>Thu, 09 Feb 2012 07:32:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Nigel Jones</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/05/signed-versus-unsigned-integers/comment-page-1/#comment-3904</link>
		<dc:creator>Nigel Jones</dc:creator>
		<pubDate>Tue, 26 Apr 2011 17:54:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/05/09/signed-versus-unsigned-integers/#comment-3904</guid>
		<description>Hi TK. I&#039;m afraid I have to disagree with you. &#039;Integral types&#039; are not different to integer types - at least as far as the C language is concerned. See &lt;a href=&quot;http://en.wikipedia.org/wiki/Integral_data_types&quot; rel=&quot;nofollow&quot;&gt;this &lt;/a&gt; for example.</description>
		<content:encoded><![CDATA[<p>Hi TK. I&#8217;m afraid I have to disagree with you. &#8216;Integral types&#8217; are not different to integer types &#8211; at least as far as the C language is concerned. See <a href="http://en.wikipedia.org/wiki/Integral_data_types" rel="nofollow">this </a> for example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TK</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/05/signed-versus-unsigned-integers/comment-page-1/#comment-3900</link>
		<dc:creator>TK</dc:creator>
		<pubDate>Tue, 26 Apr 2011 13:49:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/05/09/signed-versus-unsigned-integers/#comment-3900</guid>
		<description>I found this discussion while sanitizing my code for release.  I stick to unsigned integer types as much as possible to avoid undefined/implementation-dependent behavior.  It simplifies the rules, a la MISRA.  Then I treat all signed operations as exceptions that need to be scrutinized more rigorously.  I noticed a typo that should be corrected:  The words &quot;integer&quot; and &quot;integral&quot; both pass through a spell-checker, but they are very different animals.  Only integers, be they signed/unsigned are under consideration.  If I had a dime for every time that I mistakenly swapped the two terms...  Anyhow, integrals belong to a completely different programming/engineering/mathematics discussion.  Please edit the article to avoid confusion.</description>
		<content:encoded><![CDATA[<p>I found this discussion while sanitizing my code for release.  I stick to unsigned integer types as much as possible to avoid undefined/implementation-dependent behavior.  It simplifies the rules, a la MISRA.  Then I treat all signed operations as exceptions that need to be scrutinized more rigorously.  I noticed a typo that should be corrected:  The words &#8220;integer&#8221; and &#8220;integral&#8221; both pass through a spell-checker, but they are very different animals.  Only integers, be they signed/unsigned are under consideration.  If I had a dime for every time that I mistakenly swapped the two terms&#8230;  Anyhow, integrals belong to a completely different programming/engineering/mathematics discussion.  Please edit the article to avoid confusion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GroovyD</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/05/signed-versus-unsigned-integers/comment-page-1/#comment-2603</link>
		<dc:creator>GroovyD</dc:creator>
		<pubDate>Tue, 09 Nov 2010 02:50:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/05/09/signed-versus-unsigned-integers/#comment-2603</guid>
		<description>i almost exclusively use unsigned unless i have to generate a signed result and only in those specific calculations i pay mind to the mixing of the datatypes (typically i convert unsigned to signed knowing the unsigned are small enough to convert without overflow).  Since I have started using unsigned it is surprising to me actually how little needs to be done signed.  In fact using unsigned is usually faster and cleaner since you so not have to check for &lt; 0 on array indexes.  I credit lint for pushing me in this direction.</description>
		<content:encoded><![CDATA[<p>i almost exclusively use unsigned unless i have to generate a signed result and only in those specific calculations i pay mind to the mixing of the datatypes (typically i convert unsigned to signed knowing the unsigned are small enough to convert without overflow).  Since I have started using unsigned it is surprising to me actually how little needs to be done signed.  In fact using unsigned is usually faster and cleaner since you so not have to check for &lt; 0 on array indexes.  I credit lint for pushing me in this direction.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel Jones</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/05/signed-versus-unsigned-integers/comment-page-1/#comment-222</link>
		<dc:creator>Nigel Jones</dc:creator>
		<pubDate>Fri, 15 May 2009 01:58:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/05/09/signed-versus-unsigned-integers/#comment-222</guid>
		<description>I&#039;m glad I&#039;m not alone! I&#039;ve heard from Jack Gannsle and so I expect he will mention this in next month&#039;s newsletter. It will be interesting to see what his readers think.</description>
		<content:encoded><![CDATA[<p>I&#8217;m glad I&#8217;m not alone! I&#8217;ve heard from Jack Gannsle and so I expect he will mention this in next month&#8217;s newsletter. It will be interesting to see what his readers think.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AndersH</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/05/signed-versus-unsigned-integers/comment-page-1/#comment-221</link>
		<dc:creator>AndersH</dc:creator>
		<pubDate>Thu, 14 May 2009 14:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/05/09/signed-versus-unsigned-integers/#comment-221</guid>
		<description>A very good article, as always! I&#039;m baffled, to say the least by the content of the article you quote...</description>
		<content:encoded><![CDATA[<p>A very good article, as always! I&#8217;m baffled, to say the least by the content of the article you quote&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter B</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/05/signed-versus-unsigned-integers/comment-page-1/#comment-220</link>
		<dc:creator>Peter B</dc:creator>
		<pubDate>Wed, 13 May 2009 01:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/05/09/signed-versus-unsigned-integers/#comment-220</guid>
		<description>Singed ints?  Whenever possible I use unsigned int.  But then again I do mostly assembly on $0.40 8-bit machines that don’t have enough flash ROM to use a debugger.  Has anybody looked at signed and unsigned 16-bit addition?  The code is the same.  100% the same.  In every compiler I’ve seen it’s the same.The fun stuff comes when signed 16-bit numbers are needed on an 8-bit machine.  I remember writing DTMF decode using the Goertzel Algorithm on an 8051.  PITA.  A compiler could not generate code that ran fast enough for the application.  Then later on a 72MHz ARM Cortex-M3 I used (software emulated) floating point.  Piece of cake.  And it was fast enough to handle 4 separate telephones.  (And the 32-bit machine only cost ~2x the fast 8051.)</description>
		<content:encoded><![CDATA[<p>Singed ints?  Whenever possible I use unsigned int.  But then again I do mostly assembly on $0.40 8-bit machines that don’t have enough flash ROM to use a debugger.  Has anybody looked at signed and unsigned 16-bit addition?  The code is the same.  100% the same.  In every compiler I’ve seen it’s the same.The fun stuff comes when signed 16-bit numbers are needed on an 8-bit machine.  I remember writing DTMF decode using the Goertzel Algorithm on an 8051.  PITA.  A compiler could not generate code that ran fast enough for the application.  Then later on a 72MHz ARM Cortex-M3 I used (software emulated) floating point.  Piece of cake.  And it was fast enough to handle 4 separate telephones.  (And the 32-bit machine only cost ~2x the fast 8051.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel Jones</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/05/signed-versus-unsigned-integers/comment-page-1/#comment-219</link>
		<dc:creator>Nigel Jones</dc:creator>
		<pubDate>Sun, 10 May 2009 11:36:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/05/09/signed-versus-unsigned-integers/#comment-219</guid>
		<description>Hi Steve.I&#039;ve sent an email to Jack Ganssle, pointing him to this posting. Since Jack has linked to this blog in the past I expect that there will be some sort of reply in the next newsletter.</description>
		<content:encoded><![CDATA[<p>Hi Steve.I&#8217;ve sent an email to Jack Ganssle, pointing him to this posting. Since Jack has linked to this blog in the past I expect that there will be some sort of reply in the next newsletter.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steve</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/05/signed-versus-unsigned-integers/comment-page-1/#comment-218</link>
		<dc:creator>steve</dc:creator>
		<pubDate>Sat, 09 May 2009 18:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/05/09/signed-versus-unsigned-integers/#comment-218</guid>
		<description>A very interesting and thought-provoking article!I prefer to use unsigned values as much as possible, mainly to avoid ambiguities (and hence Lint warnings) when doing masking and shifting, as you mention.Will you be sending any of your comments to Jack Ganssle for inclusion in his next newletter?I also think this would make an interesting discussion point on the &lt;i&gt;other&lt;/i&gt; &lt;a HREF=&quot;http://stackoverflow.com/&quot; rel=&quot;nofollow&quot;&gt;Stack Overflow&lt;/a&gt; website.</description>
		<content:encoded><![CDATA[<p>A very interesting and thought-provoking article!I prefer to use unsigned values as much as possible, mainly to avoid ambiguities (and hence Lint warnings) when doing masking and shifting, as you mention.Will you be sending any of your comments to Jack Ganssle for inclusion in his next newletter?I also think this would make an interesting discussion point on the <i>other</i> <a HREF="http://stackoverflow.com/" rel="nofollow">Stack Overflow</a> website.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

