Advertisement
STANAANDREY

babylon sqr

Mar 31st, 2023
1,207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.14 KB | None | 0 0
  1. disp(babylonsqr(64, 10))
  2.  
  3. function guess=babylonsqr(x, k)
  4.     guess = 1;
  5.      for i=1:k
  6.         guess = (guess + (x/guess))/2;
  7.      end
  8. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement