+ 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
1 Answer
+ 2
Try some reading, maybe one of these will help you understand
https://www.cantorsparadise.com/a-modern-look-at-square-roots-in-the-babylonian-way-ccd48a5e8716
https://blogs.sas.com/content/iml/2016/05/16/babylonian-square-roots.html
https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method