I am implementing a while loop where a float variable changes value several times. I want the loop to stop when the value of the variable reaches 0. I included this line in my code:
while ( (f(c)!=0) && (ABS((b-a)/b)>=0.000005) )
It complies, but when it executes it keeps going longer than it should (i.e. it terminates when the 2nd condition is false. it should terminate before that--when the 1st condition becomes false).
Is there anyway that I can change my while statement to make my program run better.
I've tried using "f(c)!=0.00000" since the variable is a float, but this doesn't work either.