What is the correspondence between the number of significant figures in base 10 and base 2?
Or in other words, if two decimal numbers are equal to $N_{10}$ significant figures, what is the number of significant figures, $N_{2}$, to which I need to compare them in binary, so that I get the same result?
Example: Let $N_{10} = 2$, i.e. we will be comparing to $2$ significant figures in base 10. In this case: $$ 100 = 102 \text{ (both round to 100)} $$ $$ 105 = 114 \text{ (both round to 110)} $$ In binary $100_{10} = 1100100_{2}, 102_{10} = 1100110_{2}, 105_{10} = 1101001_{2}, 114_{10} = 1110010_{2}$. From this particular example, it appears that $N_{2} = 3$.
Why I ask this: I am trying to implement efficient equality comparison which respects number of significant figures. Ultimately, I would want it to achieve everything in binary using cheap shift operations.
For fixed $N_{10}$, no such $N_2$ exists.
Proof:
Given a tentative $N_2$, set $n = 2^{N_2} + 1$ (two $1$s with $(N_2 - 1)$ $0$s between). Then in base $2$, $n\cdot 2^k$ always rounds up to $(n+1)\cdot 2^k$. However $n\cdot 2^k - 1$ rounds down to $(n-1)\cdot 2^k$. Since $n\cdot 2^k$ and $n\cdot 2^k - 1$ round to the same $N_{10}$ significant digits in base $10$ for at least one $k$, $N_2$ does not work.