1
$\begingroup$

I know a similar question was asked before, but I wanted to know if this can be extended to any number system by a generic formula.

For example, given a number X in number system A, how many digits would it have in number system B? I'm looking for a sort of universal formula in terms of X, A and B.

Thanks

1 Answers 1

1

As J. M. said in a comment to the question you ask, an integer $X$ has $\lfloor 1+\log_B X\rfloor$ base-$B$ digits. Going from base $A$ to base $B$ the number of digits is multiplied by $\frac{\log A}{\log B}$ but that is approximate due to the 1 and the floor function.

  • 0
    I had a typo, now fixed. It should be 100*log(10)/log(2). You can check with smaller numbers. A three digit number ranges from 100 to 999. In base 2 this ranges from 7 to 10 bits. And log (10)/log(2) is about 1/.30103=3.322011-02-23