Is there a more efficient way to compute the first digit of a number?
I need to compute the first digit of some large numbers. So far I've been converting them to strings, although it can be somewhat slow. For example:
sage: %timeit str(2^57885161) 1 loops, best of 3: 3.07 s per loop
Is there a faster way to to do this? For my purpose you can assume that all the numbers involved are powers of some small base.