In bignum division when doing add-back because initial guess was too
authorChris Hanson <org/chris-hanson/cph>
Wed, 16 May 1990 22:42:55 +0000 (22:42 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 16 May 1990 22:42:55 +0000 (22:42 +0000)
large: if the add-back causes a carry it must be discarded.

v7/src/microcode/bignum.c
v7/src/microcode/version.h
v8/src/microcode/version.h

index f6c0bf5f7ebb1b44f46a799285ea947012012d5b..93bc768389758d3e8e70a627e70c77765445913c 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/bignum.c,v 9.30 1990/02/11 22:34:00 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/bignum.c,v 9.31 1990/05/16 22:42:04 cph Exp $
 
 Copyright (c) 1989, 1990 Massachusetts Institute of Technology
 
@@ -1208,7 +1208,10 @@ bignum_divide_subtract (v_start, v_end, guess, u_start)
        }
     }
   if (carry == 1)
-    (*u_scan) += 1;
+    {
+      bignum_digit_type sum = ((*u_scan) + carry);
+      (*u_scan) = ((sum < BIGNUM_RADIX) ? sum : (sum - BIGNUM_RADIX));
+    }
   return (guess - 1);
 }
 \f
index 23c4c4abd6fcae24c7b338374054a43d060180ce..e87010dbea308cc6eebfdfc96919f61da7a2c8f0 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.30 1990/04/17 22:20:34 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.31 1990/05/16 22:42:55 cph Exp $
 
 Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
 
@@ -46,7 +46,7 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     30
+#define SUBVERSION     31
 #endif
 
 #ifndef UCODE_TABLES_FILENAME
index eaf287986259ba76ff0a6fbd2130c32b71570f22..3fe71f40ce1bf62ba57261e938781a1f0705c716 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.30 1990/04/17 22:20:34 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.31 1990/05/16 22:42:55 cph Exp $
 
 Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
 
@@ -46,7 +46,7 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     30
+#define SUBVERSION     31
 #endif
 
 #ifndef UCODE_TABLES_FILENAME