squareroot_313 - elseif a < 0 a = a*(-1); while...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
%Problem 3.13 % function squareroot_313(a, E) f x = 0; x err = 1; e xold = 1; x if a > 0 i while err > E x = (xold + a/xold)/2; err = abs((x - xold)/x); xold = x; end x err
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: elseif a < 0 a = a*(-1); while err > E x = (xold + a/xold)/2; err = abs((x - xold)/x); xold = x; end x*1j err else x = 0 err = 0 end e...
View Full Document

Ask a homework question - tutors are online