[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/lisp/calc calc-bin.el
From: |
Jay Belanger |
Subject: |
[Emacs-diffs] emacs/lisp/calc calc-bin.el |
Date: |
Fri, 20 Nov 2009 00:55:53 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Jay Belanger <jpb> 09/11/20 00:55:53
Modified files:
lisp/calc : calc-bin.el
Log message:
(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.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/calc/calc-bin.el?cvsroot=emacs&r1=1.27&r2=1.28
Patches:
Index: calc-bin.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/calc/calc-bin.el,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- calc-bin.el 16 Nov 2009 23:29:20 -0000 1.27
+++ calc-bin.el 20 Nov 2009 00:55:53 -0000 1.28
@@ -159,7 +159,7 @@
(calc-do-refresh)
(calc-refresh-evaltos)
(if (< n 0)
- (message "Binary word size is %d bits (2's complement)" (- n))
+ (message "Binary word size is %d bits (two's complement)" (- n))
(message "Binary word size is %d bits" n))))
@@ -174,13 +174,13 @@
(if (and (>= n 2) (<= n 36))
(progn
(calc-change-mode
- (list 'calc-number-radix 'calc-complement-signed-mode)
- (list n (and (= n 2) arg)) t)
+ (list 'calc-number-radix 'calc-twos-complement-mode)
+ (list n (and (or (= n 2) (= n 8) (= n 16)) arg)) t)
;; also change global value so minibuffer sees it
(setq-default calc-number-radix calc-number-radix))
(setq n calc-number-radix))
- (if calc-complement-signed-mode
- (message "Number radix is %d, complement signed mode is on." n)
+ (if calc-twos-complement-mode
+ (message "Number radix is %d, two's complement mode is on." n)
(message "Number radix is %d" n))))
(defun calc-decimal-radix ()
@@ -191,13 +191,13 @@
(interactive "P")
(calc-radix 2 arg))
-(defun calc-octal-radix ()
- (interactive)
- (calc-radix 8))
+(defun calc-octal-radix (&optional arg)
+ (interactive "P")
+ (calc-radix 8 arg))
-(defun calc-hex-radix ()
- (interactive)
- (calc-radix 16))
+(defun calc-hex-radix (&optional arg)
+ (interactive "P")
+ (calc-radix 16 arg))
(defun calc-leading-zeros (n)
(interactive "P")
@@ -820,9 +820,9 @@
calc-number-radix))))))
math-radix-float-cache))))))))
-;;; Complement signed mode
+;;; Two's complement mode
-(defun math-format-complement-signed (a)
+(defun math-format-twos-complement (a)
"Format an integer in complement signed mode."
(let* (;(calc-leading-zeros t)
(overflow nil)