<?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: 2.5 &#8212; Floating point numbers</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/</link>
	<description></description>
	<lastBuildDate>Thu, 09 Sep 2010 12:59:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: C++ Tutorial and Online Ebook</title>
		<link>http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/comment-page-1/#comment-87424</link>
		<dc:creator>C++ Tutorial and Online Ebook</dc:creator>
		<pubDate>Wed, 30 Jun 2010 01:10:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=46#comment-87424</guid>
		<description>[...] 2.5 Floating point numbers [...]</description>
		<content:encoded><![CDATA[<p>[...] 2.5 Floating point numbers [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: supriya</title>
		<link>http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/comment-page-1/#comment-83718</link>
		<dc:creator>supriya</dc:creator>
		<pubDate>Wed, 28 Apr 2010 09:50:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=46#comment-83718</guid>
		<description>&lt;pre&gt;
/* Program to know real value of fTotal */

#include &lt;iostream.h&gt;
#include &lt;conio.h&gt;

void main()
{
clrscr();

float fValue1 = 1.345f;
float fValue2 = 1.123f;
float fTotal = fValue1 + fValue2; // should be 2.468

if (fTotal == 2.468f) // use 2.468f,it will work properly.
{
cout &lt;&lt; &quot;n fTotal is 2.468&quot;;
}
else
{
cout &lt;&lt; &quot;n fTotal is not 2.468&quot;;
}

printf(&quot;n The real value of fTotal is %0.7f&quot;, fTotal);
getch();
}

/* End of Pgram */
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<pre>
/* Program to know real value of fTotal */

#include &lt;iostream.h&gt;
#include &lt;conio.h&gt;

void main()
{
clrscr();

float fValue1 = 1.345f;
float fValue2 = 1.123f;
float fTotal = fValue1 + fValue2; // should be 2.468

if (fTotal == 2.468f) // use 2.468f,it will work properly.
{
cout &lt;&lt; &quot;n fTotal is 2.468&quot;;
}
else
{
cout &lt;&lt; &quot;n fTotal is not 2.468&quot;;
}

printf(&quot;n The real value of fTotal is %0.7f&quot;, fTotal);
getch();
}

/* End of Pgram */
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: SleepyHead</title>
		<link>http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/comment-page-1/#comment-79043</link>
		<dc:creator>SleepyHead</dc:creator>
		<pubDate>Thu, 25 Feb 2010 09:45:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=46#comment-79043</guid>
		<description>I&#039;m confused by your use of the term &#039;real number&#039;.

In mathematics a real number is any number which isn&#039;t an imaginary number, which means that both C++ integer and floating-point data-types can hold real numbers, and the only difference between them is that floating-point data-types can represent decimal fractions, as opposed to integer data-types which can only hold natural numbers (aka counting numbers, or whole numbers).


Also - a general stylistic point - you&#039;ve often used &quot;it&#039;s&quot; where &quot;its&quot; is the correct word to use, cf. http://www.buckingham.ac.uk/english/guide/its.html.</description>
		<content:encoded><![CDATA[<p>I&#8217;m confused by your use of the term &#8216;real number&#8217;.</p>
<p>In mathematics a real number is any number which isn&#8217;t an imaginary number, which means that both C++ integer and floating-point data-types can hold real numbers, and the only difference between them is that floating-point data-types can represent decimal fractions, as opposed to integer data-types which can only hold natural numbers (aka counting numbers, or whole numbers).</p>
<p>Also &#8211; a general stylistic point &#8211; you&#8217;ve often used &#8220;it&#8217;s&#8221; where &#8220;its&#8221; is the correct word to use, cf. <a href="http://www.buckingham.ac.uk/english/guide/its.html" rel="nofollow">http://www.buckingham.ac.uk/english/guide/its.html</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toni</title>
		<link>http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/comment-page-1/#comment-76738</link>
		<dc:creator>Toni</dc:creator>
		<pubDate>Tue, 19 Jan 2010 00:08:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=46#comment-76738</guid>
		<description>hi there, can you give me an example of addition with no outputs?</description>
		<content:encoded><![CDATA[<p>hi there, can you give me an example of addition with no outputs?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sanjiv</title>
		<link>http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/comment-page-1/#comment-70165</link>
		<dc:creator>sanjiv</dc:creator>
		<pubDate>Mon, 12 Oct 2009 06:22:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=46#comment-70165</guid>
		<description>&lt;pre&gt; 
 int intVar = 1500000000; 1st instance needs to be declared correctly as

 unsigned int intVar = 1500000000;

Gets the desired results... on compiling
&lt;/pre&gt;

Guess all authors are prone to typo errors.</description>
		<content:encoded><![CDATA[<pre>
 int intVar = 1500000000; 1st instance needs to be declared correctly as

 unsigned int intVar = 1500000000;

Gets the desired results... on compiling
</pre>
<p>Guess all authors are prone to typo errors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sanjiv</title>
		<link>http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/comment-page-1/#comment-69936</link>
		<dc:creator>sanjiv</dc:creator>
		<pubDate>Thu, 08 Oct 2009 07:22:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=46#comment-69936</guid>
		<description>your C ++ compiler has a tendency to roundoff 8th precision onwards.
For any value lesser then 8;
It will display 1 lesser than called for.</description>
		<content:encoded><![CDATA[<p>your C ++ compiler has a tendency to roundoff 8th precision onwards.<br />
For any value lesser then 8;<br />
It will display 1 lesser than called for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sanjiv</title>
		<link>http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/comment-page-1/#comment-69888</link>
		<dc:creator>sanjiv</dc:creator>
		<pubDate>Wed, 07 Oct 2009 05:50:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=46#comment-69888</guid>
		<description>&lt;pre&gt; 
# include &lt;iostream&gt;

using namespace std;
                
                int main()
                          {
                           int intVar = 1500000000;
                           intVar = (intVar * 10) / 10;
                           cout &lt;&lt; &quot;intVar :&quot;  &lt;&lt; intVar &lt;&lt; endl; 
                           
                           intVar = 1500000000;
                           intVar = (static_cast&lt;double&gt;(intVar) * 10) / 10;
                           cout &lt;&lt; &quot;intVar :&quot; &lt;&lt; intVar &lt;&lt; endl;  
                           
                           system(&quot;pause&quot;);
                           return 0;     
                          }
/*devc++ 4.9.9.2 compiler instead of printing error 
value is displaying assigned value directly in the first
 instance.where am I going wrong OR is the new 
DEV C++ compiler which is the responsible for this... */

&lt;!--formatted--&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<pre>
# include &lt;iostream&gt;

using namespace std;

                int main()
                          {
                           int intVar = 1500000000;
                           intVar = (intVar * 10) / 10;
                           cout &lt;&lt; &quot;intVar :&quot;  &lt;&lt; intVar &lt;&lt; endl; 

                           intVar = 1500000000;
                           intVar = (static_cast&lt;double&gt;(intVar) * 10) / 10;
                           cout &lt;&lt; &quot;intVar :&quot; &lt;&lt; intVar &lt;&lt; endl;  

                           system(&quot;pause&quot;);
                           return 0;
                          }
/*devc++ 4.9.9.2 compiler instead of printing error
value is displaying assigned value directly in the first
 instance.where am I going wrong OR is the new
DEV C++ compiler which is the responsible for this... */

<!--formatted--></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeremy</title>
		<link>http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/comment-page-1/#comment-67561</link>
		<dc:creator>jeremy</dc:creator>
		<pubDate>Tue, 01 Sep 2009 02:32:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=46#comment-67561</guid>
		<description>In decimal, .1 is tenths, .01 is hundredths, .001 is thousandths and so on. Likewise, in binary, .1 is halves, .01 is quarters, .001 is eights, and so on. 
0.000110011... would be equal to 1/16 + 1/32 + 1/256 + 1/512 + ...</description>
		<content:encoded><![CDATA[<p>In decimal, .1 is tenths, .01 is hundredths, .001 is thousandths and so on. Likewise, in binary, .1 is halves, .01 is quarters, .001 is eights, and so on.<br />
0.000110011&#8230; would be equal to 1/16 + 1/32 + 1/256 + 1/512 + &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Slade</title>
		<link>http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/comment-page-1/#comment-64621</link>
		<dc:creator>Slade</dc:creator>
		<pubDate>Mon, 20 Jul 2009 01:52:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=46#comment-64621</guid>
		<description>Sorry after include it is suppsed to say io stream in angled brackets</description>
		<content:encoded><![CDATA[<p>Sorry after include it is suppsed to say io stream in angled brackets</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Slade</title>
		<link>http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/comment-page-1/#comment-64620</link>
		<dc:creator>Slade</dc:creator>
		<pubDate>Mon, 20 Jul 2009 01:51:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=46#comment-64620</guid>
		<description>In the code example right after &quot;rounding errors,&quot; why is there no &quot;#include &quot; when there is a cout later and also &quot;using namespace std&quot;? Is it a miss type or is there a reason...?</description>
		<content:encoded><![CDATA[<p>In the code example right after &#8220;rounding errors,&#8221; why is there no &#8220;#include &#8221; when there is a cout later and also &#8220;using namespace std&#8221;? Is it a miss type or is there a reason&#8230;?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
