a=1;
b=2;
TOL=0.0001;
N0=20;
i=1;
FA=func(a);
while i<=N0
   p(i)=a+(b-a)/2;
   FP=func(p(i));
   if or(FP==0, (b-a)/2<TOL)
      display(p(i))
      break
   end
   i=i+1;
   if FA*FP>0
      a=p(i-1);
      FA=FP;
   else
      b=p(i-1);
   end
end

   
      