aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/calc/calc-ext.el21
1 files changed, 16 insertions, 5 deletions
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 80899e78ca0..f1bbdfab370 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -198,6 +198,7 @@
198 (define-key calc-mode-map "bo" 'calc-or) 198 (define-key calc-mode-map "bo" 'calc-or)
199 (define-key calc-mode-map "bp" 'calc-pack-bits) 199 (define-key calc-mode-map "bp" 'calc-pack-bits)
200 (define-key calc-mode-map "br" 'calc-rshift-binary) 200 (define-key calc-mode-map "br" 'calc-rshift-binary)
201 (define-key calc-mode-map "bs" 'calc-symclip)
201 (define-key calc-mode-map "bt" 'calc-rotate-binary) 202 (define-key calc-mode-map "bt" 'calc-rotate-binary)
202 (define-key calc-mode-map "bu" 'calc-unpack-bits) 203 (define-key calc-mode-map "bu" 'calc-unpack-bits)
203 (define-key calc-mode-map "bw" 'calc-word-size) 204 (define-key calc-mode-map "bw" 'calc-word-size)
@@ -762,7 +763,7 @@ math-quarter-integer math-round math-setup-declarations math-sqr
762math-sqr-float math-trunc-fancy math-trunc-special) 763math-sqr-float math-trunc-fancy math-trunc-special)
763 764
764 ("calc-bin" calcFunc-and calcFunc-ash 765 ("calc-bin" calcFunc-and calcFunc-ash
765calcFunc-clip calcFunc-diff calcFunc-lsh calcFunc-not calcFunc-or 766calcFunc-clip calcFunc-diff calcFunc-symclip calcFunc-lsh calcFunc-not calcFunc-or
766calcFunc-rash calcFunc-rot calcFunc-rsh calcFunc-xor math-clip 767calcFunc-rash calcFunc-rot calcFunc-rsh calcFunc-xor math-clip
767math-compute-max-digits math-convert-radix-digits math-float-parts 768math-compute-max-digits math-convert-radix-digits math-float-parts
768math-format-bignum-binary math-format-bignum-hex 769math-format-bignum-binary math-format-bignum-hex
@@ -987,9 +988,9 @@ calc-find-root calc-poly-interp)
987calc-floor calc-idiv calc-increment calc-mant-part calc-max calc-min 988calc-floor calc-idiv calc-increment calc-mant-part calc-max calc-min
988calc-round calc-scale-float calc-sign calc-trunc calc-xpon-part) 989calc-round calc-scale-float calc-sign calc-trunc calc-xpon-part)
989 990
990 ("calc-bin" calc-and calc-binary-radix calc-clip calc-decimal-radix 991 ("calc-bin" calc-and calc-binary-radix calc-clip calc-complement-signed-mode
991calc-diff calc-hex-radix calc-leading-zeros calc-lshift-arith 992calc-decimal-radix calc-diff calc-hex-radix calc-symclip calc-leading-zeros
992calc-lshift-binary calc-not calc-octal-radix calc-or calc-radix 993calc-lshift-arith calc-lshift-binary calc-not calc-octal-radix calc-or calc-radix
993calc-rotate-binary calc-rshift-arith calc-rshift-binary calc-word-size 994calc-rotate-binary calc-rshift-arith calc-rshift-binary calc-word-size
994calc-xor) 995calc-xor)
995 996
@@ -2994,10 +2995,20 @@ If X is not an error form, return 1."
2994 (math-add int (math-div frac (math-pow radix (length fracs)))))))) 2995 (math-add int (math-div frac (math-pow radix (length fracs))))))))
2995 2996
2996 ;; Integer with explicit radix 2997 ;; Integer with explicit radix
2997 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]+\\)$" s) 2998 ((string-match "^\\([0-9]+\\)\\(#&?\\|\\^\\^\\)\\([0-9a-zA-Z]+\\)$" s)
2998 (math-read-radix (math-match-substring s 3) 2999 (math-read-radix (math-match-substring s 3)
2999 (string-to-number (math-match-substring s 1)))) 3000 (string-to-number (math-match-substring s 1))))
3000 3001
3002 ;; Complement signed with explicit radix
3003 ((string-match "^\\([0-9]+\\)\\(##\\)\\([0-9a-zA-Z]+\\)$" s)
3004 (let ((num (math-read-radix (math-match-substring s 3)
3005 (string-to-number (math-match-substring s 1)))))
3006 (if (and
3007 (Math-lessp num math-2-word-size)
3008 (<= (math-compare math-half-2-word-size num) 0))
3009 (math-sub num math-2-word-size)
3010 num)))
3011
3001 ;; C language hexadecimal notation 3012 ;; C language hexadecimal notation
3002 ((and (eq calc-language 'c) 3013 ((and (eq calc-language 'c)
3003 (string-match "^0[xX]\\([0-9a-fA-F]+\\)$" s)) 3014 (string-match "^0[xX]\\([0-9a-fA-F]+\\)$" s))