<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Visual C++ Tips &#187; calculate log2</title>
	<atom:link href="http://weseetips.com/tag/calculate-log2/feed/" rel="self" type="application/rss+xml" />
	<link>http://weseetips.com</link>
	<description>Gold mine of Visual C++ tricks!</description>
	<lastBuildDate>Thu, 11 Mar 2010 09:09:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>How to calculate log2 of any number?</title>
		<link>http://weseetips.com/2008/09/10/how-to-calculate-log2-of-any-number/</link>
		<comments>http://weseetips.com/2008/09/10/how-to-calculate-log2-of-any-number/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 18:59:21 +0000</pubDate>
		<dc:creator>Jijo Raj</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Codeproject]]></category>
		<category><![CDATA[calculate log2]]></category>
		<category><![CDATA[get log2]]></category>
		<category><![CDATA[log2]]></category>

		<guid isPermaLink="false">http://weseetips.wordpress.com/?p=453</guid>
		<description><![CDATA[Few days back, my client give me one 4 inch long and 2 inch wide math equation to implement. Well, the equation contains log2 and while coding, my Visual Assist was not auto filling the log2 function. It just underlines the function by redline. When i checked the MSDN, I was shocked that log2 is [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-11" title="Icon Description" src="http://weseetips.wordpress.com/files/2008/03/icon_description.jpg?w=166" alt="" width="166" height="32" /><br />
Few days back, my client <span style="color:#0000ff;">give me one 4 inch long and 2 inch wide math equation</span> to implement. Well, the <span style="color:#0000ff;">equation contains log2</span> and while coding, my <span style="color:#0000ff;">Visual Assist was not auto filling the log2 function</span>. It just <span style="color:#0000ff;">underlines </span>the function <span style="color:#0000ff;">by redline</span>. When i checked the MSDN, <span style="color:#0000ff;">I was shocked that log2 is not available</span> as the <span style="color:#0000ff;">part of standard library</span>. So how to get the log2 of a number?</p>
<p><img class="alignnone size-full wp-image-459" title="log2" src="http://weseetips.wordpress.com/files/2008/09/log2.jpg" alt="" width="409" height="327" /></p>
<p><img class="alignnone size-medium wp-image-12" title="Icon How Can I Do It?" src="http://weseetips.wordpress.com/files/2008/03/icon_howcanidoit.jpg?w=220" alt="" width="220" height="32" /><br />
Log2 is pretty simple, nah? Its implementation as follows,</p>
<pre>#include &lt;math.h&gt;
...
// Calculates log2 of number.
double Log2( double n )
{
    // log(n)/log(2) is log2.
    return log( n ) / log( 2 );
}</pre>
<p><img class="alignnone size-medium wp-image-18" title="Icon Note" src="http://weseetips.wordpress.com/files/2008/03/icon_note.jpg?w=94" alt="" width="94" height="32" /><br />
<span style="color:#0000ff;">Its silly function</span>, But <span style="color:#0000ff;">I still blame standard library for not including it.</span> Because <span style="color:#0000ff;">I&#8217;m lazy</span>. <img src='http://weseetips.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><img class="alignnone size-medium wp-image-51" title="beginnerseries" src="http://weseetips.wordpress.com/files/2008/03/beginnerseries.jpg?w=215" alt="" width="215" height="32" /><br />
Targeted Audience &#8211; Beginners.</p>
]]></content:encoded>
			<wfw:commentRss>http://weseetips.com/2008/09/10/how-to-calculate-log2-of-any-number/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

