finding nearest perfect square for a fractional number

Is it possible to have a clear definition for the nearest perfect square number for a fractional number? For example, let us consider a number 0.004. What is another decimal number closest to it, that is also a perfect square? Is it 0.0025? We know 0.0025 is a perfect square (0.05*0.05) but is it the closest one? Is there any way to find out? (PS : please suggest some tags for questions like these)

• How do you actually define perfect square for real/rational numbers. In the case of $\mathbb R$, every number $x \ge 0$ is a square, in case of $\mathbb Q$, the squares are dense. – martini Dec 5 '12 at 7:39
• Perhaps the OP is restricting attention o terminating decimals. But the squares of these are also dense. – André Nicolas Dec 5 '12 at 7:42
• Yes I am only talking about terminating decimals, otherwise we will probably have infinite choices – user13267 Dec 5 '12 at 8:28

Note that $$0.004=\frac{4}{1000}.$$ Now, let's "zoom in" one digit. Change the denominator to $10000$, and bring the numerator to the nearest perfect square integer to $40$ - that'd be $36$. $$0.0036=\frac{36}{10000}=\left(\frac{6}{100}\right)^2.$$ This is closer to $0.004$ than $0.0025$, for sure. But is it the closest? Let's try it again. What if we look for stuff of the form $(x/1000)^2$? We need the closest perfect square to $4000$ - that's $63^2=3969$. Now we have $$0.003969=\frac{3969}{10000}=\left(\frac{63}{1000}\right)^2.$$ That's even closer. Let's go one deeper... $$0.00399424=\frac{399424}{100000000}=\left(\frac{632}{10000}\right)^2.$$ Can you see what's happening here?
• @user13267 Exactly. This is what Andre meant above when he said that these squares are "dense": if we pick a small number $\epsilon$, no matter how tiny, there will always be some number of the form $(x/10^n)^2$ in the interval $0.04-\epsilon$ to $0.04+\epsilon$. – Alexander Gruber Dec 5 '12 at 9:40