> for(x=x1;x <= x2;x++) > { > > if(eps >= 0) > { > > eps -= DeltaX; > } > } I didn't look thru how you got here, but EPS needs to be adjusted each iteration, else you will never stop taking just A steps once you start. Also, the point is to take an A *or* B step each iteration. ******************************************************************** Olin Lathrop, embedded systems consultant in Littleton Massachusetts (978) 742-9014, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics