I am writing a little something on the accuracy of of approximations of certain numbers. Currently, I'm looking for a way to find the number of digits a number $n$ (the approximation) is "good for" $p$ (the number to be approximated). For example, $22/7$ is "good for" 2 digits of $\pi$. On my trusty TI-84, I know I can take the difference ($|p-n|$) then take the last portion (the ᴇNN bit). For example:
$$\left|\pi-e^{\sqrt[3]{1.5}}\right|=4.91444797\text{e-}5$$
Thus, the digits $e^\sqrt[3]{1.5}$ is "good for" $\pi$ is $4$ (gained from $|-5|-1$). Is there a mathematical way to obtain, for example, $4$ in the previous scenario?
The answer is rather trivial, actually: $$-\left\lfloor\log(|p-n|)+1\right\rfloor.$$