Search
 
SCRIPT & CODE EXAMPLE
 

CPP

power of two c++

bool IsPowerOfTwo(int x) {
    return x && ((x & (x - 1)) == 0);
}
Comment

c++ power of two

int xSquared = pow(x, 2);
Comment

PREVIOUS NEXT
Code Example
Cpp :: how to print a text in c++ 
Cpp :: c++ ternary operator 
Cpp :: c++ min int 
Cpp :: print duplicate characters from string in c++ 
Cpp :: reverse function in cpp array 
Cpp :: currency converter c++ 
Cpp :: how to add external library in clion 
Cpp :: how to know datatype of something in c++ 
Cpp :: cpp func as const 
Cpp :: cpp float 
Cpp :: new c++ 
Cpp :: c include 
Cpp :: how to initialize vector 
Cpp :: how to change colour image to grey in opencv c++ 
Cpp :: C++ Conditions and If Statements 
Cpp :: double to float c++ 
Cpp :: c++ lettura file 
Cpp :: how to find the length of an array in cpp 
Cpp :: c++ program to convert character to ascii 
Cpp :: insert element in array c++ 
Cpp :: how to make a square root function in c++ without stl 
Cpp :: prime or not in cpp 
Cpp :: opencv c++ feature detection 
Cpp :: CRED Coins codechef solution in c++ 
Cpp :: loop c++ 
Cpp :: string erase 
Cpp :: c++ map lookup 
Cpp :: c++ define constant in class header 
Cpp :: c/c++ windows api socket wrappers 
Cpp :: c++ include < vs "" 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =