I am trying to work out if a variable is in the power of 2 series (e.g. 2, 4, 8, 16, 32 etc). To do this I thought it would be best to take the log of the variable to base 2, if that number was an integer then the variable is within the series. However, I can't find a way to test if the number is an integer or a float/double. Is it possible to test this? If not is there another way to test if the variable is in the sequence?