I have the following statement
while abs(k) >= 1
the above code is included inside a main loop
I observe though that when k=1; is outside the main loop the algorithm does not get stuck. When I include it inside the main loop after some iterations it gets stuck.
Would it be wrong to put it outiside loop?