diff options
| author | Jay Belanger | 2009-11-20 00:55:53 +0000 |
|---|---|---|
| committer | Jay Belanger | 2009-11-20 00:55:53 +0000 |
| commit | 50a982d673ca5cf448b16e119472ddd2441b6f0f (patch) | |
| tree | bf7b59bf8121852e411720f6b3ac4d37939a2384 | |
| parent | 8768b1328ec244efd27e4a30a532258436f5c52b (diff) | |
| download | emacs-50a982d673ca5cf448b16e119472ddd2441b6f0f.tar.gz emacs-50a982d673ca5cf448b16e119472ddd2441b6f0f.zip | |
(math-format-twos-complement): Renamed from math-format-complement-signed.
(calc-radix): Rename `calc-complement-signed-mode' to
`calc-twos-complement-mode'.
(calc-octal-radix, calc-hex-radix): Add an argument for two's complement.
| -rw-r--r-- | lisp/calc/calc-bin.el | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lisp/calc/calc-bin.el b/lisp/calc/calc-bin.el index 9751fd5d018..a011b06c28a 100644 --- a/lisp/calc/calc-bin.el +++ b/lisp/calc/calc-bin.el | |||
| @@ -159,7 +159,7 @@ the size of a Calc bignum digit.") | |||
| 159 | (calc-do-refresh) | 159 | (calc-do-refresh) |
| 160 | (calc-refresh-evaltos) | 160 | (calc-refresh-evaltos) |
| 161 | (if (< n 0) | 161 | (if (< n 0) |
| 162 | (message "Binary word size is %d bits (2's complement)" (- n)) | 162 | (message "Binary word size is %d bits (two's complement)" (- n)) |
| 163 | (message "Binary word size is %d bits" n)))) | 163 | (message "Binary word size is %d bits" n)))) |
| 164 | 164 | ||
| 165 | 165 | ||
| @@ -174,13 +174,13 @@ the size of a Calc bignum digit.") | |||
| 174 | (if (and (>= n 2) (<= n 36)) | 174 | (if (and (>= n 2) (<= n 36)) |
| 175 | (progn | 175 | (progn |
| 176 | (calc-change-mode | 176 | (calc-change-mode |
| 177 | (list 'calc-number-radix 'calc-complement-signed-mode) | 177 | (list 'calc-number-radix 'calc-twos-complement-mode) |
| 178 | (list n (and (= n 2) arg)) t) | 178 | (list n (and (or (= n 2) (= n 8) (= n 16)) arg)) t) |
| 179 | ;; also change global value so minibuffer sees it | 179 | ;; also change global value so minibuffer sees it |
| 180 | (setq-default calc-number-radix calc-number-radix)) | 180 | (setq-default calc-number-radix calc-number-radix)) |
| 181 | (setq n calc-number-radix)) | 181 | (setq n calc-number-radix)) |
| 182 | (if calc-complement-signed-mode | 182 | (if calc-twos-complement-mode |
| 183 | (message "Number radix is %d, complement signed mode is on." n) | 183 | (message "Number radix is %d, two's complement mode is on." n) |
| 184 | (message "Number radix is %d" n)))) | 184 | (message "Number radix is %d" n)))) |
| 185 | 185 | ||
| 186 | (defun calc-decimal-radix () | 186 | (defun calc-decimal-radix () |
| @@ -191,13 +191,13 @@ the size of a Calc bignum digit.") | |||
| 191 | (interactive "P") | 191 | (interactive "P") |
| 192 | (calc-radix 2 arg)) | 192 | (calc-radix 2 arg)) |
| 193 | 193 | ||
| 194 | (defun calc-octal-radix () | 194 | (defun calc-octal-radix (&optional arg) |
| 195 | (interactive) | 195 | (interactive "P") |
| 196 | (calc-radix 8)) | 196 | (calc-radix 8 arg)) |
| 197 | 197 | ||
| 198 | (defun calc-hex-radix () | 198 | (defun calc-hex-radix (&optional arg) |
| 199 | (interactive) | 199 | (interactive "P") |
| 200 | (calc-radix 16)) | 200 | (calc-radix 16 arg)) |
| 201 | 201 | ||
| 202 | (defun calc-leading-zeros (n) | 202 | (defun calc-leading-zeros (n) |
| 203 | (interactive "P") | 203 | (interactive "P") |
| @@ -820,9 +820,9 @@ the size of a Calc bignum digit.") | |||
| 820 | calc-number-radix)))))) | 820 | calc-number-radix)))))) |
| 821 | math-radix-float-cache)))))))) | 821 | math-radix-float-cache)))))))) |
| 822 | 822 | ||
| 823 | ;;; Complement signed mode | 823 | ;;; Two's complement mode |
| 824 | 824 | ||
| 825 | (defun math-format-complement-signed (a) | 825 | (defun math-format-twos-complement (a) |
| 826 | "Format an integer in complement signed mode." | 826 | "Format an integer in complement signed mode." |
| 827 | (let* (;(calc-leading-zeros t) | 827 | (let* (;(calc-leading-zeros t) |
| 828 | (overflow nil) | 828 | (overflow nil) |