  function s = MySqrt(A)
% A is a non-negative real number and s is an approximation
% to its square root.

  if A == 0
     s = 0;
  else 
     L = A; W = 1;
     while abs(L-W) >  (10^-12)*min(L,W)
         L = (L+W)/2; W = A/L;
     end
     s = L;
  end
      
