MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / isPowerOfFour

Method isPowerOfFour

CPP/PowerOfFour.cpp:11–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9 return std::floor(k) == k;
10}
11 bool isPowerOfFour(int n) {
12 if(n<=0){
13 return false;
14 }
15 if(n==1){
16 return true;
17 }
18 if(n%4!=0){
19 return false;
20 }
21 else{
22 if(is_integer(value4(n))){
23 return true;
24 }
25 else{
26 return false;
27 }
28 }
29 }
30};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected