From 4a8b0b3c1ab478ad2517369af4339b9a07f4412a Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Sun, 4 Jun 2000 00:49:45 +0200 Subject: Correct two formulas in comments. --- mpz/bin_ui.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mpz/bin_ui.c b/mpz/bin_ui.c index 4c1c571b6..216f7ef41 100644 --- a/mpz/bin_ui.c +++ b/mpz/bin_ui.c @@ -28,8 +28,8 @@ MA 02111-1307, USA. */ In fact consider calling mpz_bin_uiui() when the arguments fit, leaving the code here only for big n. - For the identity bin(n,k) = bin(-n+k-1,k) see Knuth vol 1 section 1.2.6 - part G. */ + For the identity bin(n,k) = (-1)^k * bin(-n+k-1,k) see Knuth vol 1 + section 1.2.6 part G. */ void #if __STDC__ @@ -48,7 +48,7 @@ mpz_bin_ui (r, n, k) if (mpz_sgn (n) < 0) { - /* bin(n,k) = bin(-n+k-1,k), and set ni = -n+k-1 - k = -n-1 */ + /* bin(n,k) = (-1)^k * bin(-n+k-1,k), and set ni = -n+k-1 - k = -n-1 */ mpz_init (ni); mpz_neg (ni, n); mpz_sub_ui (ni, ni, 1L); -- cgit v1.2.1