aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/calc
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/calc')
-rw-r--r--lisp/calc/calc-bin.el6
-rw-r--r--lisp/calc/calc-comb.el6
-rw-r--r--lisp/calc/calc-ext.el8
-rw-r--r--lisp/calc/calc-math.el2
4 files changed, 11 insertions, 11 deletions
diff --git a/lisp/calc/calc-bin.el b/lisp/calc/calc-bin.el
index c05a71a2d7f..a61cecf357c 100644
--- a/lisp/calc/calc-bin.el
+++ b/lisp/calc/calc-bin.el
@@ -420,7 +420,7 @@ the size of a Calc bignum digit.")
420 (let ((q (math-div-bignum-digit a math-bignum-digit-power-of-two))) 420 (let ((q (math-div-bignum-digit a math-bignum-digit-power-of-two)))
421 (if (<= w math-bignum-logb-digit-size) 421 (if (<= w math-bignum-logb-digit-size)
422 (list (logand (lognot (cdr q)) 422 (list (logand (lognot (cdr q))
423 (1- (lsh 1 w)))) 423 (1- (ash 1 w))))
424 (math-mul-bignum-digit (math-not-bignum (math-norm-bignum (car q)) 424 (math-mul-bignum-digit (math-not-bignum (math-norm-bignum (car q))
425 (- w math-bignum-logb-digit-size)) 425 (- w math-bignum-logb-digit-size))
426 math-bignum-digit-power-of-two 426 math-bignum-digit-power-of-two
@@ -529,7 +529,7 @@ the size of a Calc bignum digit.")
529 ((and (integerp a) (< a math-small-integer-size)) 529 ((and (integerp a) (< a math-small-integer-size))
530 (if (> w (logb math-small-integer-size)) 530 (if (> w (logb math-small-integer-size))
531 a 531 a
532 (logand a (1- (lsh 1 w))))) 532 (logand a (1- (ash 1 w)))))
533 (t 533 (t
534 (math-normalize 534 (math-normalize
535 (cons 'bigpos 535 (cons 'bigpos
@@ -542,7 +542,7 @@ the size of a Calc bignum digit.")
542 (let ((q (math-div-bignum-digit a math-bignum-digit-power-of-two))) 542 (let ((q (math-div-bignum-digit a math-bignum-digit-power-of-two)))
543 (if (<= w math-bignum-logb-digit-size) 543 (if (<= w math-bignum-logb-digit-size)
544 (list (logand (cdr q) 544 (list (logand (cdr q)
545 (1- (lsh 1 w)))) 545 (1- (ash 1 w))))
546 (math-mul-bignum-digit (math-clip-bignum (math-norm-bignum (car q)) 546 (math-mul-bignum-digit (math-clip-bignum (math-norm-bignum (car q))
547 (- w math-bignum-logb-digit-size)) 547 (- w math-bignum-logb-digit-size))
548 math-bignum-digit-power-of-two 548 math-bignum-digit-power-of-two
diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el
index 7c88230f86a..f1d3daeed93 100644
--- a/lisp/calc/calc-comb.el
+++ b/lisp/calc/calc-comb.el
@@ -580,7 +580,7 @@
580 ;; deduce a better value for RAND_MAX. 580 ;; deduce a better value for RAND_MAX.
581 (let ((i 0)) 581 (let ((i 0))
582 (while (< (setq i (1+ i)) 30) 582 (while (< (setq i (1+ i)) 30)
583 (if (> (lsh (math-abs (random)) math-random-shift) 4095) 583 (if (> (ash (math-abs (random)) math-random-shift) 4095)
584 (setq math-random-shift (1- math-random-shift)))))) 584 (setq math-random-shift (1- math-random-shift))))))
585 (setq math-last-RandSeed var-RandSeed 585 (setq math-last-RandSeed var-RandSeed
586 math-gaussian-cache nil)) 586 math-gaussian-cache nil))
@@ -592,11 +592,11 @@
592 (cdr math-random-table)) 592 (cdr math-random-table))
593 math-random-ptr2 (or (cdr math-random-ptr2) 593 math-random-ptr2 (or (cdr math-random-ptr2)
594 (cdr math-random-table))) 594 (cdr math-random-table)))
595 (logand (lsh (setcar math-random-ptr1 595 (logand (ash (setcar math-random-ptr1
596 (logand (- (car math-random-ptr1) 596 (logand (- (car math-random-ptr1)
597 (car math-random-ptr2)) 524287)) 597 (car math-random-ptr2)) 524287))
598 -6) 1023)) 598 -6) 1023))
599 (logand (lsh (random) math-random-shift) 1023))) 599 (logand (ash (random) math-random-shift) 1023)))
600 600
601 601
602;;; Produce a random digit in the range 0..999. 602;;; Produce a random digit in the range 0..999.
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 5feff23f72d..f983ebe414d 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -2294,14 +2294,14 @@ calc-kill calc-kill-region calc-yank))))
2294 (let ((a (math-trunc a))) 2294 (let ((a (math-trunc a)))
2295 (if (integerp a) 2295 (if (integerp a)
2296 a 2296 a
2297 (if (or (Math-lessp (lsh -1 -1) a) 2297 (if (or (Math-lessp most-positive-fixnum a)
2298 (Math-lessp a (- (lsh -1 -1)))) 2298 (Math-lessp a (- most-positive-fixnum)))
2299 (math-reject-arg a 'fixnump) 2299 (math-reject-arg a 'fixnump)
2300 (math-fixnum a))))) 2300 (math-fixnum a)))))
2301 ((and allow-inf (equal a '(var inf var-inf))) 2301 ((and allow-inf (equal a '(var inf var-inf)))
2302 (lsh -1 -1)) 2302 most-positive-fixnum)
2303 ((and allow-inf (equal a '(neg (var inf var-inf)))) 2303 ((and allow-inf (equal a '(neg (var inf var-inf))))
2304 (- (lsh -1 -1))) 2304 (- most-positive-fixnum))
2305 (t (math-reject-arg a 'fixnump)))) 2305 (t (math-reject-arg a 'fixnump))))
2306 2306
2307;;; Verify that A is an integer >= 0 and return A in integer form. [I N; - x] 2307;;; Verify that A is an integer >= 0 and return A in integer form. [I N; - x]
diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el
index 4b8abbf4f85..483907a325d 100644
--- a/lisp/calc/calc-math.el
+++ b/lisp/calc/calc-math.el
@@ -1697,7 +1697,7 @@ If this can't be done, return NIL."
1697 (while (not (Math-lessp x pow)) 1697 (while (not (Math-lessp x pow))
1698 (setq pows (cons pow pows) 1698 (setq pows (cons pow pows)
1699 pow (math-sqr pow))) 1699 pow (math-sqr pow)))
1700 (setq n (lsh 1 (1- (length pows))) 1700 (setq n (ash 1 (1- (length pows)))
1701 sum n 1701 sum n
1702 pow (car pows)) 1702 pow (car pows))
1703 (while (and (setq pows (cdr pows)) 1703 (while (and (setq pows (cdr pows))