You have in your while loop in your sqrt()
function a compareTo(100)
which (I suspect) is always returning 1 ie the absolute value of number minus the guess squared is always greater than 100.
Which after testing I see that it is, add this at the end of your loop and you'll see that the difference once you reach the root is still very large = 4733709254
At this point numOne
and numTwo
become the same value so guess
is always the same for each subsequent iteration also.
System.out.println("Squaring:" + guess.multiply(guess).toString() +
"; Substracting: " + number.subtract((guess.multiply(guess))).toString());
You also have c < 100
so if that comparison is always true then it will always print 100 lines.