How can I calculate log base 2 in c++?
<p>Here is my code.</p>

<pre><code>#include &lt;iostream&gt;
#include&lt;stdlib.h&gt;
#include&lt;stdio.h&gt;
#include&lt;conio.h&gt;
#include&lt;math.h&gt;
#include &lt;cmath&gt;
#include &lt;functional&gt;
using namespace std;
void main()
{
    cout&lt;&lt;log2(3.0)&lt;&lt;endl;

}
</code></pre>

<p>But above code gives error. Error code is : error C3861: 'log2': identifier not found.
How can i calculate log2 using c++?</p>
