]> git.eshelyaron.com Git - emacs.git/commitdiff
(math-scale-bignum-digit-size): Renamed from math-scale-bignum-3.
authorJay Belanger <jay.p.belanger@gmail.com>
Sun, 24 Jun 2007 19:46:53 +0000 (19:46 +0000)
committerJay Belanger <jay.p.belanger@gmail.com>
Sun, 24 Jun 2007 19:46:53 +0000 (19:46 +0000)
(math-isqrt-bignum): Use math-scale-bignum-digit-size and
math-bignum-digit-size.
(math-isqrt-small): Add another possible initial guess.

lisp/ChangeLog
lisp/calc/calc-math.el

index a59c7d623b41d776360e39a47bdd2155dcced078..f27fa90ec2573a9d8018a0709569d82423bcc8d0 100644 (file)
@@ -4,6 +4,14 @@
        Use math-read-number-simple to insert constants.
        (math-prime-test): Redo calculation of sum.
 
+       * calc/calc-misc.el (math-div2-bignum): Use math-bignum-digit-size.
+
+       * calc/calc-math.el (math-scale-bignum-digit-size): Renamed from
+       math-scale-bignum-3.
+       (math-isqrt-bignum): Use math-scale-bignum-digit-size and
+       math-bignum-digit-size.
+       (math-isqrt-small): Add another possible initial guess.
+
 2007-06-23  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
 
        * textmodes/bibtex.el (bibtex-entry-format): New options
index 610ed30410680a0b41f0a84423974c6808890f53..6ee7a49feabf688f36b8e1fd576ebd11e585cf72 100644 (file)
        (let* ((top (nthcdr (- len 2) a)))
          (math-isqrt-bignum-iter
           a
-          (math-scale-bignum-3
+          (math-scale-bignum-digit-size
            (math-bignum-big
             (1+ (math-isqrt-small
-                 (+ (* (nth 1 top) 1000) (car top)))))
+                 (+ (* (nth 1 top) math-bignum-digit-size) (car top)))))
            (1- (/ len 2)))))
       (let* ((top (nth (1- len) a)))
        (math-isqrt-bignum-iter
         a
-        (math-scale-bignum-3
+        (math-scale-bignum-digit-size
          (list (1+ (math-isqrt-small top)))
          (/ len 2)))))))
 
         (while (eq (car (setq a (cdr a))) 0))
         (null a))))
 
-(defun math-scale-bignum-3 (a n)   ; [L L S]
+(defun math-scale-bignum-digit-size (a n)   ; [L L S]
   (while (> n 0)
     (setq a (cons 0 a)
          n (1- n)))
   a)
 
 (defun math-isqrt-small (a)   ; A > 0.  [S S]
-  (let ((g (cond ((>= a 10000) 1000)
+  (let ((g (cond ((>= a 1000000) 10000)
+                 ((>= a 10000) 1000)
                 ((>= a 100) 100)
                 (t 10)))
        g2)