changeset 106042:af05336f9b9a

(calc-arithmetic-menu): Add item for `calc-symclip'. (calc-modes-menu): Add item for twos complement.
author Jay Belanger <jay.p.belanger@gmail.com>
date Mon, 16 Nov 2009 00:07:07 +0000
parents 05e547365764
children e3602466755b
files lisp/calc/calc-menu.el
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calc/calc-menu.el	Mon Nov 16 00:02:21 2009 +0000
+++ b/lisp/calc/calc-menu.el	Mon Nov 16 00:07:07 2009 +0000
@@ -165,6 +165,13 @@
                :keys "b c"
                :active (>= (calc-stack-size) 1)
                :help "Reduce (1:) modulo 2^wordsize"]
+              ["Clip (1:) to [-2^(w-1),2^(w-1))"
+               (progn
+                 (require 'calc-bin)
+                 (call-interactively 'calc-symclip))
+               :keys "b s"
+               :active (>= (calc-stack-size) 1)
+               :help "Reduce (1:) to [-2^(w-1),2^w)"]
               ["(2:) and (1:)"    
                (progn
                  (require 'calc-bin)
@@ -1133,6 +1140,14 @@
                :keys "d 2"
                :style radio
                :selected (= calc-number-radix 2)]
+              ["Twos complement"
+               (progn
+                 (require 'calc-bin)
+                 (call-interactively 
+                  (lambda () (interactive) (calc-binary-radix t))))
+               :keys "C-u d 2"
+               :style radio
+               :selected calc-complement-signed-mode]
               ["Octal"
                (progn
                  (require 'calc-bin)