# NOT RUN {
#
# Try and see whether 1,2,3 or 4 are powers of two!
#
IsPowerOfTwo(1:4)
# [1] 0 1 NA 2
#
# Yes, 1,2 and 4 are the 0, 1 and 2nd power of 2. However, 3 is not an
# integral power of two.
# }
Run the code above in your browser using DataLab