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.
16 lines
261 B
16 lines
261 B
6 years ago
|
## ispowerof2
|
||
|
|
||
|
### Instructions
|
||
6 years ago
|
|
||
|
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.
|
||
|
|
||
|
## Expected function
|
||
|
|
||
|
```go
|
||
6 years ago
|
func Ispowerof2(n uint) bool {
|
||
6 years ago
|
|
||
|
}
|
||
|
```
|