shithub: brokentoys

Download patch

ref: 9a7852993c538212d5e14aa34c49ba7d990aca76
parent: 97f4b9b97c470501d25ac82cad771bdff75e9b59
author: rodri <rgl@antares-labs.eu>
date: Sat Jan 6 18:59:26 EST 2024

sqrt.c: add forgotten comments.

--- a/sqrt.c
+++ b/sqrt.c
@@ -32,7 +32,11 @@
 		return 0;
 
 	x0 = -1;
-	x = n > 1? n/2: 1;
+	x = n > 1? n/2: 1;	/* initial estimate */
+	/*
+	 * take advantage of the computer's discreteness
+	 * to get the most accurate result.
+	 */
 	while(x0 != x){
 		x0 = x;
 		x = 0.5*(x0 + n/x0);