Function to check number is power of two