In reply to Rick Wicklin.

Rick,
What about function X^2=0 ?

Here is an interesting question. If there were a funtion whose root is x=0 , and your seaching step is set as 0.1 , then your way is not going to work .