floorLog(b,x) computes floor(logb(x)), correcting occasional errors due to rounding.
i1 : floor( log_3 3^5 ) o1 = 4
i2 : floorLog( 3, 3^5 ) o2 = 5