diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-06-01 12:24:43 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-06-01 12:24:43 +0000 |
commit | 0d4219643dd807c0ceca07cd2601471ab0b59dc5 (patch) | |
tree | 7757daee50d8785cd34969d92d97044d5df5b50f /src/sqrt.c | |
parent | 9e19cd961fdd14d0d609619195d8a4474bea67a4 (diff) | |
download | mpfr-0d4219643dd807c0ceca07cd2601471ab0b59dc5.tar.gz |
[src/sqrt.c] fixed/improved comments
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@12747 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/sqrt.c')
-rw-r--r-- | src/sqrt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sqrt.c b/src/sqrt.c index 01688f962..0a73e9d81 100644 --- a/src/sqrt.c +++ b/src/sqrt.c @@ -37,13 +37,13 @@ mpfr_sqrt2_approx (mpfr_limb_ptr rp, mpfr_limb_srcptr np) __gmpfr_sqrt_limb (r1, h, l, x, np[1]); - /* now r1 = floor(sqrt(n1)) and h:l = n1^2 - r1^2 with h:l <= 2*r1, - thus h <= 1 */ + /* now r1 = floor(sqrt(2^64*n1)) and h:l = 2^64*n1 - r1^2 with h:l <= 2*r1, + thus h <= 1, and x is an approximation of 2^96/sqrt(np[1])-2^64 */ l += np[0]; h += (l < np[0]); - /* now h <= 2 */ + /* now 2^64*n1 + n0 - r1^2 = 2^64*h + l with h <= 2 */ /* divide by 2 */ l = (h << 63) | (l >> 1); |