Guest User

Untitled

a guest
Oct 23rd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. function output = sqrtIter(x,errorbound)
  2. % sqrt to specified accuracy
  3. guess = round(x/2);
  4. while abs(guess*guess-x)>errorbound
  5. guess=(guess+x/guess)/2;
  6. end
  7. output = guess;
Add Comment
Please, Sign In to add comment