Hey guys.

I've written a little program that finds the root of an equation using either the bisection or newtons method and it works great.

At the moment it is set up to do 25 iterations of each equation by which time an answer if often found to 6 decimal places.

I would like to stop the iterations if an answer if found before that.

So the question is, how do I compare a double to zero but to only 6 decimal places?

So that 0.0000001 == 0.000000 is true

Thanks