According to your code, you have a while loop that is essentially

while(true){
//
}
because you never change the closeEnough variable. Possible fix:


if ( (XX - X)/X < 0.00001)
{