Thanks to this answer, I know that to get the $i$th bit of a number $n$, you can do $$\left\lfloor\frac{n}{2^i}\right\rfloor-2\left\lfloor\frac{n}{2^{i+1}}\right\rfloor$$ However, I need this formula to be meromorphic (I'm trying to create a function that I could apply the Argument Principle to). Of course, the floor function isn't meromorphic, so I need an approximation (hopefully with some kind of constant $k$ that I can change to decrease the error). I would also like for it to be efficient (the number of terms are constant or proportional with $\log_2(n)$)
I would make this question just about the floor function, however, if there's some other approximation that uses some other formula to find the $i$th bit, I'm all ears.