0

How I can Find square root in c++ without sqrt and cmath?

I need to find square root in c++ without use any Functions any one can tell me?

7th Jan 2022, 1:56 PM
ABUBAKAR ALHOMIDY
ABUBAKAR ALHOMIDY - avatar
4 Réponses
+ 1
You could implement the babylonian method next = (prev - num/prev)/2 Iterate that until either 'next' and 'prev' are near enough or 'next' and 'num' are Where 'num' is the number you want the sqrt of This method will always approach the +sqrt from above with positive initial guesses, and -sqrt from below with negative initial guesses The closer the initial guess is from the root the better 1 and num are equally good initial guesses
7th Jan 2022, 5:45 PM
Angelo
Angelo - avatar
7th Jan 2022, 2:50 PM
Azhagesanヾ(✿)
Azhagesanヾ(✿) - avatar
0
Can you give the code?
7th Jan 2022, 2:24 PM
ABUBAKAR ALHOMIDY
ABUBAKAR ALHOMIDY - avatar
0
Thanks for your?
7th Jan 2022, 2:52 PM
ABUBAKAR ALHOMIDY
ABUBAKAR ALHOMIDY - avatar