From 9a7852993c538212d5e14aa34c49ba7d990aca76 Mon Sep 17 00:00:00 2001 From: rodri Date: Sat, 6 Jan 2024 23:59:26 +0000 Subject: sqrt.c: add forgotten comments. --- sqrt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sqrt.c b/sqrt.c index 5a78693..281e73e 100644 --- a/sqrt.c +++ b/sqrt.c @@ -32,7 +32,11 @@ double 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); -- cgit v1.2.3