+ 2

Solution Needed

It's a babylonian method. when i give input 36 or 25 it shows 6 or 5 as output. Like a normal square root formula. But how it works? If anybody know about babylonian method please help me to understand this code. { float x = num; float y = 1; double e = 0.000001; while (x - y > e) { x = (x + y) / 2; y = num / x; } return x; } full code is below⬇️ https://code.sololearn.com/cn08RjQyRi63/?ref=app

30th Oct 2022, 12:22 PM
Mustakim Rahman
Mustakim Rahman - avatar
1 Odpowiedź