<?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"
	>
<channel>
	<title>Comments on: 2.4 &#8212; Integers</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/24-integers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/24-integers/</link>
	<description></description>
	<pubDate>Thu, 24 Jul 2008 16:31:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Learn C++ - &#187; 2.3 &#8212; Variable sizes and the sizeof operator</title>
		<link>http://www.learncpp.com/cpp-tutorial/24-integers/#comment-12630</link>
		<dc:creator>Learn C++ - &#187; 2.3 &#8212; Variable sizes and the sizeof operator</dc:creator>
		<pubDate>Wed, 23 Apr 2008 02:27:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=44#comment-12630</guid>
		<description>[...]  2.4 â€” Integers [...]</description>
		<content:encoded><![CDATA[<p>[...]  2.4 â€” Integers [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learn C++ - &#187; 2.5 &#8212; Floating point numbers</title>
		<link>http://www.learncpp.com/cpp-tutorial/24-integers/#comment-12598</link>
		<dc:creator>Learn C++ - &#187; 2.5 &#8212; Floating point numbers</dc:creator>
		<pubDate>Wed, 23 Apr 2008 01:45:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=44#comment-12598</guid>
		<description>[...] 2007      Prev/Next Posts   &#171; 2.4 &#8212; Integers &#124; Home &#124; Break Time &#8212; Dice Wars &#187;     Saturday, June 9th, 2007 at 12:07 [...]</description>
		<content:encoded><![CDATA[<p>[...] 2007      Prev/Next Posts   &laquo; 2.4 &#8212; Integers | Home | Break Time &#8212; Dice Wars &raquo;     Saturday, June 9th, 2007 at 12:07 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/24-integers/#comment-11320</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 10 Apr 2008 01:53:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=44#comment-11320</guid>
		<description>I forgot to mention: if you use an unsigned long, you have to use the U suffix for the literal:

long nMyNumber = 2147483648U;

This tells the compiler to treat the literal as an unsigned number instead of a signed one.</description>
		<content:encoded><![CDATA[<p>I forgot to mention: if you use an unsigned long, you have to use the U suffix for the literal:</p>
<p>long nMyNumber = 2147483648U;</p>
<p>This tells the compiler to treat the literal as an unsigned number instead of a signed one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lal</title>
		<link>http://www.learncpp.com/cpp-tutorial/24-integers/#comment-11244</link>
		<dc:creator>Lal</dc:creator>
		<pubDate>Wed, 09 Apr 2008 04:56:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=44#comment-11244</guid>
		<description>Thanks Alex,

Double works but unsigned long does not, i get this error for unsigned long
warning: decimal integer constant is so large that it is unsigned</description>
		<content:encoded><![CDATA[<p>Thanks Alex,</p>
<p>Double works but unsigned long does not, i get this error for unsigned long<br />
warning: decimal integer constant is so large that it is unsigned</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/24-integers/#comment-11190</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Tue, 08 Apr 2008 04:09:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=44#comment-11190</guid>
		<description>You are encountering this behavior because 2147483647 is the maximum signed long value.  If you need a larger number, you have a couple of options:
1) Use an unsigned long
2) Use a double (covered in the next lesson)

Whenever you're working with floating point values (floats and doubles and long doubles), make sure you add a .0 suffix if your value is a whole number:

double dValue = 2147483648.0;</description>
		<content:encoded><![CDATA[<p>You are encountering this behavior because 2147483647 is the maximum signed long value.  If you need a larger number, you have a couple of options:<br />
1) Use an unsigned long<br />
2) Use a double (covered in the next lesson)</p>
<p>Whenever you&#8217;re working with floating point values (floats and doubles and long doubles), make sure you add a .0 suffix if your value is a whole number:</p>
<p>double dValue = 2147483648.0;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lal</title>
		<link>http://www.learncpp.com/cpp-tutorial/24-integers/#comment-11139</link>
		<dc:creator>Lal</dc:creator>
		<pubDate>Mon, 07 Apr 2008 12:32:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=44#comment-11139</guid>
		<description>Hi Alex,

First of all thank you very much for such a great tutorial.

I have a small question, I am unable to an value more than 2,147,483,647 if though I am declaring the variable as double, long double, unsigned int. I dont understand why, I have just started learning C++ and I find your tutorial very informative.

Thanks
Lal

#include    
  
int main()   
{   
	long double nshort;
	nshort=2147483648;
	cout &#60;&#60; "short:" &#60;&#60; sizeof(nshort) &#60;&#60; " bytes" &#60;&#60; endl; 
        cout &#60;&#60;"\n" &#60;&#60; nshort;

}</description>
		<content:encoded><![CDATA[<p>Hi Alex,</p>
<p>First of all thank you very much for such a great tutorial.</p>
<p>I have a small question, I am unable to an value more than 2,147,483,647 if though I am declaring the variable as double, long double, unsigned int. I dont understand why, I have just started learning C++ and I find your tutorial very informative.</p>
<p>Thanks<br />
Lal</p>
<p>#include    </p>
<p>int main()<br />
{<br />
	long double nshort;<br />
	nshort=2147483648;<br />
	cout &lt;&lt; &#8220;short:&#8221; &lt;&lt; sizeof(nshort) &lt;&lt; &#8221; bytes&#8221; &lt;&lt; endl;<br />
        cout &lt;&lt;&#8221;\n&#8221; &lt;&lt; nshort;</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/24-integers/#comment-7579</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sat, 09 Feb 2008 21:10:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=44#comment-7579</guid>
		<description>That's just a mistake on my part.  You are correct.  I'll fix up the examples.</description>
		<content:encoded><![CDATA[<p>That&#8217;s just a mistake on my part.  You are correct.  I&#8217;ll fix up the examples.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jefferson</title>
		<link>http://www.learncpp.com/cpp-tutorial/24-integers/#comment-7576</link>
		<dc:creator>Jefferson</dc:creator>
		<pubDate>Sat, 09 Feb 2008 20:41:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=44#comment-7576</guid>
		<description>Alex, I see that you used &lt;code&gt;iostream.h&lt;/code&gt; in this page's examples instead of &lt;code&gt;iostream&lt;/code&gt;. Is this intentional? I thought you said earlier that &lt;code&gt;iostream.h&lt;/code&gt; did not support namespaces.</description>
		<content:encoded><![CDATA[<p>Alex, I see that you used <code>iostream.h</code> in this page&#8217;s examples instead of <code>iostream</code>. Is this intentional? I thought you said earlier that <code>iostream.h</code> did not support namespaces.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: C++ Student</title>
		<link>http://www.learncpp.com/cpp-tutorial/24-integers/#comment-7107</link>
		<dc:creator>C++ Student</dc:creator>
		<pubDate>Sat, 02 Feb 2008 20:27:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=44#comment-7107</guid>
		<description>Another great set of examples, thanks.</description>
		<content:encoded><![CDATA[<p>Another great set of examples, thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Da Lunatic</title>
		<link>http://www.learncpp.com/cpp-tutorial/24-integers/#comment-6129</link>
		<dc:creator>Chris Da Lunatic</dc:creator>
		<pubDate>Wed, 16 Jan 2008 04:02:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=44#comment-6129</guid>
		<description>Fun fact: The old Final Fantasy games on the NES only allowed your stats to go up to 255 because they used a 1 byte unsigned variable to store stats. It would be neat to see someone allude this in a modern game... especially when memory isn't a huge issue anymore. :)</description>
		<content:encoded><![CDATA[<p>Fun fact: The old Final Fantasy games on the NES only allowed your stats to go up to 255 because they used a 1 byte unsigned variable to store stats. It would be neat to see someone allude this in a modern game&#8230; especially when memory isn&#8217;t a huge issue anymore. :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
