def get_MSB(self, b, n):
        p = Decimal(n) * Decimal(b).log10()
        f = Decimal(p) - Decimal(math.floor(p))
        return Decimal(10) ** f
Use Decimal() otherwise only works for small numbers
dataset/ETHPy150Open algorhythms/HackerRankAlgorithms/Journey to Mars.py/Solution.get_MSB