Suppose you have $r=n+f$ where $n\in\mathbb{N}$ and $f\in (0,1)$. I know that $r^2$ is an integer and I can also get as many digits of $f$ as I like, is there a way to recover the value of $n$? Thank you. **Edit 1:** This might be a slightly better question: Given a bound $R>r$, is there an algorithm to determine all values of $n$ such that $r^2$ is an integer? [Thank you Steven for the observation.]