{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

SquareRoot - y_old=y end y=-y*i break end y=(y x/y/2...

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

View Full Document Right Arrow Icon
function y=SquareRoot(x,e) % y_old=0; y=x; error=1; while error>=e if x==0 y=0; break end if x<0 while error>=e y=(y+-x/y)/2; error=abs((y-y_old)/y);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: y_old=y; end y=-y*i; break end % y=(y+x/y)/2; error=abs((y-y_old)/y); y_old=y; end end...
View Full Document

{[ snackBarMessage ]}