+ 2

Challenge: approximate square root

The easy way for approximately finding the square root of a given positive integer x is: 1. find y, with x = y*y +c 2. solve sqrt(x) = y + c/(2*y) (x, y, c are positive integers) Write program for finding square root of a given integer with this method (please don't use standard methods, like pow(.,.), or Math.pow and so on...). if you get bored, you can find the integer between 1 and 100 that has the biggest difference between "real" square root (computed with e.g. Math.pow(x,0.5)) and the square

29th Oct 2017, 7:14 PM
Petros Simidyan
Petros Simidyan - avatar
1 Respuesta
4th Nov 2017, 10:46 AM
Daniel Bausá Llamazares
Daniel Bausá Llamazares - avatar