<?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: 4.4 &#8212; Type conversion and casting</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 12:30:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: SamHocevar</title>
		<link>http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/comment-page-1/#comment-96886</link>
		<dc:creator>SamHocevar</dc:creator>
		<pubDate>Sat, 28 Jan 2012 14:40:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/#comment-96886</guid>
		<description>I mean &quot;&lt;cmath&gt;&quot; provides fmod. The blog engine ate my tags and there is no preview.</description>
		<content:encoded><![CDATA[<p>I mean &#8220;&lt;cmath&gt;&#8221; provides fmod. The blog engine ate my tags and there is no preview.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SamHocevar</title>
		<link>http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/comment-page-1/#comment-96885</link>
		<dc:creator>SamHocevar</dc:creator>
		<pubDate>Sat, 28 Jan 2012 14:39:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/#comment-96885</guid>
		<description>That is not really true. The % operator cannot be used with doubles, but  provides double fmod(double x, double y) which is modulus for doubles.</description>
		<content:encoded><![CDATA[<p>That is not really true. The % operator cannot be used with doubles, but  provides double fmod(double x, double y) which is modulus for doubles.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SamHocevar</title>
		<link>http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/comment-page-1/#comment-96884</link>
		<dc:creator>SamHocevar</dc:creator>
		<pubDate>Sat, 28 Jan 2012 14:28:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/#comment-96884</guid>
		<description>I would like to point out that &quot;int nValue = 10 * 2.7&quot; does not really work &quot;as expected&quot;. It is not possible to store the value 2.7 in a double. Instead, the value stored in the machine register is something like 2.7000000000000001776... (continuing to 51 digits). You are lucky that the IEEE rounding rules allow the computation to give 27 at the end, but in general you should never expect a floating-point computation on inexact values to give an exact result.

The value 2.5 can be represented exactly as a double, however. So you are guaranteed that 10 * 2.5 will be 25.</description>
		<content:encoded><![CDATA[<p>I would like to point out that &#8220;int nValue = 10 * 2.7&#8243; does not really work &#8220;as expected&#8221;. It is not possible to store the value 2.7 in a double. Instead, the value stored in the machine register is something like 2.7000000000000001776&#8230; (continuing to 51 digits). You are lucky that the IEEE rounding rules allow the computation to give 27 at the end, but in general you should never expect a floating-point computation on inexact values to give an exact result.</p>
<p>The value 2.5 can be represented exactly as a double, however. So you are guaranteed that 10 * 2.5 will be 25.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Function overloading &#171; Learn C++ Programming</title>
		<link>http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/comment-page-1/#comment-96848</link>
		<dc:creator>Function overloading &#171; Learn C++ Programming</dc:creator>
		<pubDate>Mon, 16 Jan 2012 09:43:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/#comment-96848</guid>
		<description>[...] If no exact match is found, C++ tries to find a match through promotion. In the lesson on type conversion and casting, we covered how certain types can be automatically promoted via internal type conversion to other [...]</description>
		<content:encoded><![CDATA[<p>[...] If no exact match is found, C++ tries to find a match through promotion. In the lesson on type conversion and casting, we covered how certain types can be automatically promoted via internal type conversion to other [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zingmars</title>
		<link>http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/comment-page-1/#comment-95751</link>
		<dc:creator>zingmars</dc:creator>
		<pubDate>Tue, 19 Jul 2011 11:05:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/#comment-95751</guid>
		<description>was using static_cast ever safe? :p</description>
		<content:encoded><![CDATA[<p>was using static_cast ever safe? :p</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Konda</title>
		<link>http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/comment-page-1/#comment-95719</link>
		<dc:creator>Konda</dc:creator>
		<pubDate>Sat, 16 Jul 2011 11:42:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/#comment-95719</guid>
		<description>Wait sorry about that, the &quot;int&quot; in the angled brackets after &quot;static_cast&quot; seems to disappear.</description>
		<content:encoded><![CDATA[<p>Wait sorry about that, the &#8220;int&#8221; in the angled brackets after &#8220;static_cast&#8221; seems to disappear.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Konda</title>
		<link>http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/comment-page-1/#comment-95718</link>
		<dc:creator>Konda</dc:creator>
		<pubDate>Sat, 16 Jul 2011 11:41:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/#comment-95718</guid>
		<description>&lt;PRE&gt;static_cast([float value here])&lt;/PRE&gt; fixed</description>
		<content:encoded><![CDATA[<pre>static_cast([float value here])</pre>
<p> fixed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Konda</title>
		<link>http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/comment-page-1/#comment-95717</link>
		<dc:creator>Konda</dc:creator>
		<pubDate>Sat, 16 Jul 2011 11:40:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/#comment-95717</guid>
		<description>Hello, I have a question: Is it safe to use static_cast([float value here]) to truncate a float value? And no, I&#039;m not talking about rounding.</description>
		<content:encoded><![CDATA[<p>Hello, I have a question: Is it safe to use static_cast([float value here]) to truncate a float value? And no, I&#8217;m not talking about rounding.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: surya</title>
		<link>http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/comment-page-1/#comment-95617</link>
		<dc:creator>surya</dc:creator>
		<pubDate>Wed, 22 Jun 2011 04:42:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/#comment-95617</guid>
		<description>thank you zingmars</description>
		<content:encoded><![CDATA[<p>thank you zingmars</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zingmars</title>
		<link>http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/comment-page-1/#comment-95613</link>
		<dc:creator>zingmars</dc:creator>
		<pubDate>Tue, 21 Jun 2011 15:17:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/44-type-conversion-and-casting/#comment-95613</guid>
		<description>This is what compiler does too - it does whatever you ask from it, and assigns the results to a memory location, and then you store it in p1.
And no - the line does not work. Firstly because apparently you can&#039;t do static cast on pointers (they&#039;re memory locations, not values or types or anything).
Also - one does not simply convert one class to another. It doesn&#039;t work that way.
Just my 2 cents.
So I guess the answer to the &#039;what does it hold&#039; is - nothing. It holds nothing because you can&#039;t do things this way.</description>
		<content:encoded><![CDATA[<p>This is what compiler does too &#8211; it does whatever you ask from it, and assigns the results to a memory location, and then you store it in p1.<br />
And no &#8211; the line does not work. Firstly because apparently you can&#8217;t do static cast on pointers (they&#8217;re memory locations, not values or types or anything).<br />
Also &#8211; one does not simply convert one class to another. It doesn&#8217;t work that way.<br />
Just my 2 cents.<br />
So I guess the answer to the &#8216;what does it hold&#8217; is &#8211; nothing. It holds nothing because you can&#8217;t do things this way.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

