mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
305 B
20 lines
305 B
6 years ago
|
# ispowerof2
|
||
|
## Instructions
|
||
|
|
||
|
Write a function that determines if a given number is a power of 2.
|
||
|
|
||
|
This function returns true if the given number is a power of 2, otherwise it returns false.
|
||
|
|
||
|
Your function must be declare as follows:
|
||
|
|
||
|
## Expected function
|
||
|
|
||
|
```go
|
||
|
|
||
|
func Ispowerof2(n uint) bool {
|
||
|
|
||
|
}
|
||
|
|
||
|
```
|
||
|
|