Check if BigInteger is not a perfect square

Posted by Ender on Stack Overflow See other posts from Stack Overflow or by Ender
Published on 2010-04-21T18:26:05Z Indexed on 2010/04/21 19:13 UTC
Read the original article Hit count: 324

Filed under:
|
|

I have a BigInteger value, let's say it is 282 and is inside the variable x. I now want to write a while loop that states:

while b2 isn't a perfect square:
    a ? a + 1
    b2 ? a*a - N
endwhile

How would I do such a thing using BigInteger?

EDIT: The purpose for this is so I can write this method. As the article states one must check if b2 is not square.

© Stack Overflow or respective owner

Related posts about java

Related posts about biginteger