what would be the way to calculate the square root of a number e.g. A with precision E with formula X(0)=(A+1)/2, X(i)=(X(i-1) + A/X(i-1))/2, i=1,2,... ? Tnx!
You can do it with a predicate of 4 arguments my_square_root/4 .
arg 1 : the number you're looking for the square_root.
arg 2 : epsilon
arg 3 : the current computed value of the square root
arg 3 : the final result
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.