While comparing stupendously large numbers it can be useful to take a logarithm, or even iterations of logarithms, of the number to reduce its to 'human-sized scale'. In the context of computer programming some languages, such as Python, will default to having arbitrary integer sizes but not arbitrary floating point precision. Sometimes the default float precision prohibits the casting of a sufficiently-large integer to float, which happens with most implementations of logarithmic functions.
While listening to Diggy Diggy Hole, I was inspired to define the following iterative function:
def dig(n):
count = 0
while len(str(n)) > 1:
n = len(str(n))
count += 1
return count
This function easily avoids casting to floats and still induces a partial order on the size of integers. By default I am assuming base 10 in dig, but the general idea should apply to different bases if it is desired.
I'm very doubtful that I'm the first person to think of this function, but the appropriate search engine terms are evading me. What is this function conventionally called?