First look at the last digit. If it is 2,3,7, or 8 the number is not a
perfect square.
Then use an integer formulation of Newton's method. For input value x,
start with a guess y. If you can arrange for y to be about half the
number of digits in x, that is good.
Then repeatedly set y=(y*y+x)/(2*y)
When y converges, if y*y=x, x is a perfect square.

Don

On Dec 23 2012, 10:37 am, Anil Sharma <anilsharmau...@gmail.com>
wrote:
> please suggest some efficient solution to check perfect square condition .
> no matter how much large number is... eg..i/p-8949 o/p-93

-- 


Reply via email to