Last active
November 11, 2020 15:34
-
-
Save abhimanyu-bitsgoa/89741f4081077ad141f0baa5d763fc9d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double sq(double num) | |
{ | |
double xn = num/2; | |
while(abs((xn*xn)-num)>eps) //eps is precision | |
{ | |
xn = (xn + num/xn)/2; | |
} | |
return xn; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Change abs typo