|
|
@ -8,7 +8,7 @@ This program must print `true` if the given number is a power of 2, otherwise it |
|
|
|
|
|
|
|
|
|
|
|
- If there is more than one or no argument the program should print a newline ("`\n`"). |
|
|
|
- If there is more than one or no argument the program should print a newline ("`\n`"). |
|
|
|
|
|
|
|
|
|
|
|
- Error cases have to be handled. |
|
|
|
- When there is only 1 argument, it will always be a positive valid int. |
|
|
|
|
|
|
|
|
|
|
|
### Usage : |
|
|
|
### Usage : |
|
|
|
|
|
|
|
|
|
|
@ -24,7 +24,5 @@ student@ubuntu:~/ispowerof2$ ./ispowerof2 |
|
|
|
|
|
|
|
|
|
|
|
student@ubuntu:~/ispowerof2$ ./ispowerof2 64 1024 |
|
|
|
student@ubuntu:~/ispowerof2$ ./ispowerof2 64 1024 |
|
|
|
|
|
|
|
|
|
|
|
student@ubuntu:~/ispowerof2$ ./ispowerof2 notanumber | cat -e |
|
|
|
|
|
|
|
strconv.Atoi: parsing "a": invalid syntax$ |
|
|
|
|
|
|
|
student@ubuntu:~/ispowerof2$ |
|
|
|
student@ubuntu:~/ispowerof2$ |
|
|
|
``` |
|
|
|
``` |
|
|
|