Square root implementation | Sololearn: Learn to code for FREE!


Square root implementation

I am trying to implement a square root function implementation. My code seems to work, except that it does not output the answer when I put a very large number as input. Any suggestions? https://code.sololearn.com/cgq8cbxmOqSp/#cpp

8/20/2020 7:41:09 PM

Edward Finkelstein

4 Answers

New Answer


I fixed it!


Coder Kitten I changed my code so that the range depends on the function argument. It seems to be imprecise after the second decimal, and it doesn't seem to work for numbers between 0 and 1. I made this code because I was trying to understand how people who made sqrt() function implemented it. Maybe you know a better way?