Google
 
Webcprogramming.com




An Affiliate of AIHorizon




log2()

Prototype: double log2(double anumber);
Header File: math.h (C) or cmath (C++)
Explanation: Log2 returns the base 2 logarithm for anumber, as long as it is not negative, or zero.



//Example gives the log base 2 of 32
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    cout<<log2(32);
}
Other Functions

-----
Interested in advertising with us?
Please read our privacy policy.
Copyright © 1997-2005 Cprogramming.com. All rights reserved.

Geodesy Designs