Actually, even with options strict on or off, you still going to have issues.
I would not worry, and just do a round (rounds up), or floor (removes the decimal part).
Hence, I would use this:
Dim a, b As Integer
a = 200
b = 2
Debug.Print(Math.Floor(Math.Log(a) / Math.Log(b)))
I would not bother or mess with using "\" trying to force integer math here.
So, what is actually going on?
Well, you have this:
Math.Log(a) \ Math.Log(b)
Which becomes this:
(5.29831736654804 \ 0.693147180559945)
and with the "back slash", and force to integer?
Then the values are converted BEFORE the divide occurs. So, we have this now:
(5 \ 1)
THEN the divide occurs and we get 5.
You can turn off automatic casting, and force strong typing, but you WILL STILL get the same answer - the one you NOT looking for.
So, this fails due to using the "convert to integers" BEFORE we divide here (the "\" option).
You want to divide the 2 numbers and THEN convert to integer.
So, just let a "normal" divide occur and do NOT convert the 2 values to integers BEFORE we divide them. You looking to do a plain Jane regular divide and then drop the fractional part. So, what you looking for is a VERY different goal here, and one in which we don't want to convert EACH number to integer BEFORE we do the divide.
So, using a "regular" decimal divide, then we get this:
(5.29831736654804 / 0.693147180559945)
Then this:
(7.643856189774732)
And then we want either:
Math.Round(7.643856189774732)
Which gives 8,
Or we want
Math.Floor(7.643856189774732)
Which gives 7 (it does not round up).
So, allow the expression to have "regular" decimal math, and then chop off the decimal (fraction) part AFTER the plain Jane good old fashion division occurs here. As noted, the "\" does NOT JUST return an integer result, but converts BOTH values to integer BEFORE the divide occurs, and that is a Mount Everest of a different issue, and one you did not expect. And what is worse, that converting to integer also will round up or down based expression being > 0.5 for the decimal part.
So, not only are the 2 expressions being converted to integer, but EVEN WORSE is the 2 expressions will round up or down BEFORE the divide occurs!!! So "\" does MUCH MORE then just say produce an integer result, it ALSO converts the two values to integers, and uses up or down rounding before the divide!
This of course can be handy if that's what you looking to achieve, and in this case you are not.