summaryrefslogtreecommitdiff
path: root/lisp/calculator.el
diff options
context:
space:
mode:
authorEli Barzilay <eli@barzilay.org>2015-11-24 13:39:17 -0500
committerEli Barzilay <eli@barzilay.org>2015-11-29 12:49:06 -0500
commite875e68b325f1d621a21798d4c4244790ecaf77f (patch)
treee65b5b571b455cfd5bba1b4dd76e090b2b1dd837 /lisp/calculator.el
parent5d74a02eb7c063aeea8f16ea2dcd4dd8b5ee85a1 (diff)
downloademacs-e875e68b325f1d621a21798d4c4244790ecaf77f.tar.gz
* lisp/calculator.el: improve radix modes
Fix prompt for some input radix with decimal output (eg, "BD" instead of the incorrect "B="); also, some minor docstring tweaks for these.
Diffstat (limited to 'lisp/calculator.el')
-rw-r--r--lisp/calculator.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/lisp/calculator.el b/lisp/calculator.el
index b1cda28bd25..55ef461990c 100644
--- a/lisp/calculator.el
+++ b/lisp/calculator.el
@@ -621,16 +621,17 @@ argument.
hex/oct/bin modes can be set for input and for display separately.
Another toggle-able mode is for using degrees instead of radians for
trigonometric functions.
-The keys to switch modes are (`X' is shortcut for `H'):
+The keys to switch modes are (both `H' and `X' are for hex):
* `D' switch to all-decimal mode, or toggle degrees/radians
* `B' `O' `H' `X' binary/octal/hexadecimal modes for input & display
* `i' `o' followed by one of `D' `B' `O' `H' `X' (case
insensitive) sets only the input or display radix mode
The prompt indicates the current modes:
-* \"D=\": degrees mode;
-* \"?=\": (? is B/O/H) this is the radix for both input and output;
-* \"=?\": (? is B/O/H) the display radix (when input is decimal);
-* \"??\": (? is D/B/O/H) 1st char for input radix, 2nd for display.
+* \"==\": decimal mode (using radians);
+* \"D=\": decimal mode using degrees;
+* \"?=\": ? is B/O/H, the radix for both input and output;
+* \"=?\": ? is B/O/H, the display radix (with decimal input);
+* \"??\": ? is D/B/O/H, 1st char for input radix, 2nd for display.
Also, the quote key can be used to switch display modes for decimal
numbers (double-quote rotates back), and the two brace characters
@@ -831,7 +832,7 @@ The result should not exceed the screen width."
(cond ((or in-r out-r)
(concat (or in-r "=")
(if (equal in-r out-r) "="
- (or out-r "="))))
+ (or out-r "D"))))
(calculator-deg "D=")
(t "=="))))
(expr
@@ -1555,8 +1556,8 @@ registers."
* I inverse the next trig function \
* \\='/\"/{/} - display/display args
* D - switch to all-decimal, or toggle deg/rad mode
-* B/O/H/X - binary/octal/hex mode for i/o (X is a shortcut for H)
-* i/o - prefix for d/b/o/x - set only input/output modes
+* B/O/H/X - binary/octal/hex mode for i/o (both H and X are for hex)
+* i/o - prefix for D/B/O/X - set only input/output modes
* enter/= - evaluate current expr. * s/g - set/get a register
* space - evaluate & save on list * l/v - list total/average
* up/down/C-p/C-n - browse saved * C-delete - clear all saved