Just for the sake of presenting another idea - you could also use the modkeyword so that
if (Log(4,2) mod 1 = 0)'this would execute since it's trueif (Log(5,2) mod 1 = 0)'this would not since it's false