;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:36:49 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/calculator.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`calculator.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\204 \301\302M\210\303\304M\210\305\306\307\310\311\312\313\314\315\316\315\317&\207" [fboundp defgroup (macro . #[(&rest forms) "\300\207" [nil] 1]) defcustom (macro . #[(s v d &rest r) "\303	\nF\207" [s v d defvar] 4]) custom-declare-group calculator nil "Simple Emacs calculator." :prefix "calculator" :version "21.1" :group tools convenience] 12)
#@136 *Run `calculator' electrically, in the echo area.
Electric mode saves some place but changes the way you interact with the
calculator.
(custom-declare-variable 'calculator-electric-mode 'nil '(#$ . -998) :type 'boolean :group 'calculator)
#@98 *Make `calculator' create a menu.
Note that this requires easymenu.  Must be set before loading.
(custom-declare-variable 'calculator-use-menu 't '(#$ . -1243) :type 'boolean :group 'calculator)
#@49 *If non-nil, set escape to exit the calculator.
(custom-declare-variable 'calculator-bind-escape 'nil '(#$ . -1444) :type 'boolean :group 'calculator)
#@96 *Value is either 'prefix or 'postfix.
This determines the default behavior of unary operators.
(custom-declare-variable 'calculator-unary-style ''postfix '(#$ . -1601) :type '(choice (const prefix) (const postfix)) :group 'calculator)
#@214 *The prompt used by the Emacs calculator.
It should contain a "%s" somewhere that will indicate the i/o radixes,
this string will be a two-character string as described in the
documentation for `calculator-mode'.
(custom-declare-variable 'calculator-prompt '"Calc=%s> " '(#$ . -1843) :type 'string :group 'calculator)
#@215 *The calculator's number of digits used for standard display.
Used by the `calculator-standard-display' function - it will use the
format string "%.NC" where this number is N and C is a character given
at runtime.
(custom-declare-variable 'calculator-number-digits '3 '(#$ . -2168) :type 'integer :group 'calculator)
#@230 *Non-nil value means delete all redundant zero decimal digits.
If this value is not t, and not nil, redundant zeros are removed except
for one and if it is nil, nothing is removed.
Used by the `calculator-remove-zeros' function.
(custom-declare-variable 'calculator-remove-zeros 't '(#$ . -2492) :type '(choice (const t) (const leave-decimal) (const nil)) :group 'calculator)
#@922 *A displayer specification for numerical values.
This is the displayer used to show all numbers in an expression.  Result
values will be displayed according to the first element of
`calculator-displayers'.

The displayer is a symbol, a string or an expression.  A symbol should
be the name of a one-argument function, a string is used with a single
argument and an expression will be evaluated with the variable `num'
bound to whatever should be displayed.  If it is a function symbol, it
should be able to handle special symbol arguments, currently 'left and
'right which will be sent by special keys to modify display parameters
associated with the displayer function (for example to change the number
of digits displayed).

An exception to the above is the case of the list (std C) where C is a
character, in this case the `calculator-standard-displayer' function
will be used with this character for a format string.
(custom-declare-variable 'calculator-displayer ''(std 110) '(#$ . -2875))
#@360 *A list of displayers.
Each element is a list of a displayer and a description string.  The
first element is the one which is currently used, this is for the display
of result values not values in expressions.  A displayer specification
is the same as the values that can be stored in `calculator-displayer'.

`calculator-rotate-displayer' rotates this list.
(custom-declare-variable 'calculator-displayers ''(((std 110) "Standard display, decimal point or scientific") (calculator-eng-display "Eng display") ((std 102) "Standard display, decimal point") ((std 101) "Standard display, scientific") ("%S" "Emacs printer")) '(#$ . -3877) :type 'sexp :group 'calculator)
#@194 *If non-nil, convert pasted integers so they have a decimal point.
This makes it possible to paste big integers since they will be read as
floats, otherwise the Emacs reader will fail on them.
(custom-declare-variable 'calculator-paste-decimals 't '(#$ . -4552) :type 'boolean :group 'calculator)
#@198 *If non-nil, this is any value that can be used for
`calculator-displayer', to format a string before copying it with
`calculator-copy'.  If nil, then `calculator-displayer's normal value is
used.
(custom-declare-variable 'calculator-copy-displayer 'nil '(#$ . -4856))
#@106 *If non-nil, show negative numbers in 2s complement in radix modes.
Otherwise show as a negative number.
(custom-declare-variable 'calculator-2s-complement 'nil '(#$ . -5132) :type 'boolean :group 'calculator)
#@55 *List of hook functions for `calculator-mode' to run.
(custom-declare-variable 'calculator-mode-hook 'nil '(#$ . -5348) :type 'hook :group 'calculator)
#@317 *An association list of user-defined register bindings.
Each element in this list is a list of a character and a number that
will be stored in that character's register.

For example, use this to define the golden ratio number:
  (setq calculator-user-registers '((?g .  1.61803398875)))
before you load calculator.
(custom-declare-variable 'calculator-user-registers 'nil '(#$ . -5507) :type '(repeat (cons character number)) :set '(lambda (_ val) (and (boundp 'calculator-registers) (setq calculator-registers (append val calculator-registers))) (setq calculator-user-registers val)) :group 'calculator)
#@1215 *A list of additional operators.
This is a list in the same format as specified in the documentation for
`calculator-operators', that you can use to bind additional calculator
operators.  It is probably not a good idea to modify this value with
`customize' since it is too complex...

Examples:

* A very simple one, adding a postfix "x-to-y" conversion keys, using
  t as a prefix key:

  (setq calculator-user-operators
        '(("tf" cl-to-fr (+ 32 (/ (* X 9) 5)) 1)
          ("tc" fr-to-cl (/ (* (- X 32) 5) 9) 1)
          ("tp" kg-to-lb (/ X 0.453592)       1)
          ("tk" lb-to-kg (* X 0.453592)       1)
          ("tF" mt-to-ft (/ X 0.3048)         1)
          ("tM" ft-to-mt (* X 0.3048)         1)))

* Using a function-like form is very simple, X for an argument (Y the
  second in case of a binary operator), TX is a truncated version of X
  and F does a recursive call, Here is a [very inefficient] Fibonacci
  number calculation:

  (add-to-list 'calculator-user-operators
               '("F" fib (if (<= TX 1)
                         1
                         (+ (F (- TX 1)) (F (- TX 2)))) 0))

  Note that this will be either postfix or prefix, according to
  `calculator-unary-style'.
(custom-declare-variable 'calculator-user-operators 'nil '(#$ . -6121) :type '(repeat (list string symbol sexp integer integer)) :group 'calculator)
#@418 A list of initial operators.
This is a list in the same format as `calculator-operators'.  Whenever
`calculator' starts, it looks at the value of this variable, and if it
is not empty, its contents is prepended to `calculator-operators' and
the appropriate key bindings are made.

This variable is then reset to nil.  Don't use this if you want to add
user-defined operators, use `calculator-user-operators' instead.
(defvar calculator-initial-operators '(("=" = identity 1 -1) (nobind "+" + + 2 4) (nobind "-" - - 2 4) (nobind "+" + + -1 9) (nobind "-" - - -1 9) ("(" \( identity -1 -1) (")" \) identity 1 10) ("|" or (logior TX TY) 2 2) ("#" xor (logxor TX TY) 2 2) ("&" and (logand TX TY) 2 3) ("*" * * 2 5) ("/" / / 2 5) ("\\" div (/ TX TY) 2 5) ("%" rem (% TX TY) 2 5) ("L" log log 2 6) ("S" sin (sin DX) x 6) ("C" cos (cos DX) x 6) ("T" tan (tan DX) x 6) ("IS" asin (D (asin X)) x 6) ("IC" acos (D (acos X)) x 6) ("IT" atan (D (atan X)) x 6) ("Q" sqrt sqrt x 7) ("^" ^ expt 2 7) ("!" ! calculator-fact x 7) (";" 1/ (/ 1 X) 1 7) ("_" - - 1 8) ("~" ~ (lognot TX) x 8) (">" repR calculator-repR 1 8) ("<" repL calculator-repL 1 8) ("v" avg (/ (apply '+ L) (length L)) 0 8) ("l" tot (apply '+ L) 0 8)) (#$ . 7491))
#@1235 The calculator operators, each a list with:

1. The key that is bound to for this operation (usually a string);

2. The displayed symbol for this function;

3. The function symbol, or a form that uses the variables `X' and `Y',
   (if it is a binary operator), `TX' and `TY' (truncated integer
   versions), `DX' (converted to radians if degrees mode is on), `D'
   (function for converting radians to degrees if deg mode is on), `L'
   (list of saved values), `F' (function for recursive iteration calls)
   and evaluates to the function value - these variables are capital;

4. The function's arity, optional, one of: 2 => binary, -1 => prefix
   unary, +1 => postfix unary, 0 => a 0-arg operator func, non-number =>
   postfix/prefix as determined by `calculator-unary-style' (the
   default);

5. The function's precedence - should be in the range of 1 (lowest) to
   9 (highest) (optional, defaults to 1);

It it possible have a unary prefix version of a binary operator if it
comes later in this list.  If the list begins with the symbol 'nobind,
then no key binding will take place - this is only useful for predefined
keys.

Use `calculator-user-operators' to add operators to this list, see its
documentation for an example.
(defvar calculator-operators nil (#$ . 8716))
#@43 Stack contents - operations and operands.
(defvar calculator-stack nil (#$ . 10002))
#@45 Current number being entered (as a string).
(defvar calculator-curnum nil (#$ . 10093))
#@50 Cons of the stack and its string representation.
(defvar calculator-stack-display nil (#$ . 10187))
#@69 A table to convert input characters to corresponding radix symbols.
(defvar calculator-char-radix '((68) (66 . bin) (79 . oct) (72 . hex) (88 . hex)) (#$ . 10293))
#@66 The mode for display, one of: nil (decimal), 'bin, 'oct or 'hex.
(defvar calculator-output-radix nil (#$ . 10463))
#@64 The mode for input, one of: nil (decimal), 'bin, 'oct or 'hex.
(defvar calculator-input-radix nil (#$ . 10584))
#@66 Non-nil if trig functions operate on degrees instead of radians.
(defvar calculator-deg nil (#$ . 10702))
#@35 A list of saved values collected.
(defvar calculator-saved-list nil (#$ . 10814))
#@42 The pointer to the current saved number.
(defvar calculator-saved-ptr 0 (#$ . 10902))
#@60 Bound to t when a value should be added to the saved-list.
(defvar calculator-add-saved nil (#$ . 10994))
#@68 When non-nil, we see something that the next digit should replace.
(defvar calculator-display-fragile nil (#$ . 11106))
#@32 The current calculator buffer.
(defvar calculator-buffer nil (#$ . 11232))
#@50 Internal value used by `calculator-eng-display'.
(defvar calculator-eng-extra nil (#$ . 11313))
#@50 Internal value used by `calculator-eng-display'.
(defvar calculator-eng-tmp-show nil (#$ . 11415))
#@98 The last binary operation and its arguments.
Used for repeating operations in calculator-repR/L.
(defvar calculator-last-opXY nil (#$ . 11520))
#@53 The association list of calculator register values.
(defvar calculator-registers (byte-code "\303\304	B\305\nBD\"\207" [calculator-user-registers e pi append 101 112] 5) (#$ . 11670))
#@23 Saved global key map.
(defvar calculator-saved-global-map nil (#$ . 11861))
#@57 Used to hack restarting with the electric mode changed.
(defvar calculator-restart-other-mode nil (#$ . 11943))
#@25 The calculator key map.
(defvar calculator-mode-map nil (#$ . 12061))
(byte-code "\204\211\306 \307	\310\"\210\311	\312\313#\210\311	\314\313#\210\315\n@@\316\n@A!\2036 \311	@\f#\210A\211\204( *\nA\211\204 )\203R \311	\317\320#\210\311	\321\320#\210\202X \311	\322\320#\210@\204c \311	\323\324#\210A\203\206\325\326!\204\206\327\330\331\"\332BC\326DBD\333\326\334\335#\210\325\326!\204\214 \313\336\326	\335\337\340\341\342\343\341\344\345\341\346B\347\350\"B\351\352\"\353B\354\355\"B\356\357\"B\360\361\"B\362\363\"\364B\365\366\"B\367\370\"B\371\372\"B\373\374\"B\375\376\"B\377\201F \"\201G B\201H \201I \"B\201J \201K \"B\201L \201M \"B\201N \201O \"\257\201P \201Q \201R \201S \201T \201U \341B\201V \201W \"B\201X \201Y \"\257	\201Z \201[ \201\\ \201] \341\201^ \327\201_ C\"\201` \201^ \327\201a C\"\201b \327\201c C\"#BC\"BBBB\201d \201^ \327\201e E\"\201f \"B\201g BBBBBBBBBBBBBB$\210*	)\313\207" [calculator-mode-map map p keys func calculator-bind-escape make-sparse-keymap suppress-keymap t define-key "i" nil "o" ((calculator-open-paren "[") (calculator-close-paren "]") (calculator-op-or-exp "+" "-" [kp-add] [kp-subtract]) (calculator-digit "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "d" "f" [kp-0] [kp-1] [kp-2] [kp-3] [kp-4] [kp-5] [kp-6] [kp-7] [kp-8] [kp-9]) (calculator-op [kp-divide] [kp-multiply]) (calculator-decimal "." [kp-decimal]) (calculator-exp "e") (calculator-dec/deg-mode "D") (calculator-set-register "s") (calculator-get-register "g") (calculator-radix-mode "H" "X" "O" "B") (calculator-radix-input-mode "id" "ih" "ix" "io" "ib" "iD" "iH" "iX" "iO" "iB") (calculator-radix-output-mode "od" "oh" "ox" "oo" "ob" "oD" "oH" "oX" "oO" "oB") (calculator-rotate-displayer "'") (calculator-rotate-displayer-back "\"") (calculator-displayer-pref "{") (calculator-displayer-next "}") (calculator-saved-up [up] [16]) (calculator-saved-down [down] [14]) (calculator-quit "q" [7]) (calculator-enter [enter] [linefeed] [kp-enter] [return] [13] [10]) (calculator-save-on-list " " [space]) (calculator-clear-saved [3] [(control delete)]) (calculator-save-and-quit [(control return)] [(control kp-enter)]) (calculator-paste [insert] [(shift insert)] [mouse-2]) (calculator-clear [delete] [127] [4]) (calculator-help [104] [63] [f1] [help]) (calculator-copy [(control insert)]) (calculator-backspace [backspace])) reverse [27] calculator-quit [escape] [27 27 27] [8] calculator-backspace boundp calculator-menu mapcar #[(x) "\301@\302\3038D\304\305\306\3038\307\310\311\312\313A@DE\311\314\313A@DEE&\301@\315P\316\3038D\306\317\3038\227P\304\305\307\311\312\313A@DE&\301@\320P\321\3038D\306\322\3038\227P\304\305\307\311\314\313A@DE&E\207" [x vector calculator-radix-mode 2 :style radio :keys :selected and eq calculator-input-radix quote calculator-output-radix " Input" calculator-radix-input-mode "i" " Output" calculator-radix-output-mode "o"] 14] (("Decimal" nil "D") ("Binary" bin "B") ("Octal" oct "O") ("Hexadecimal" hex "H")) (lambda (name key) `[,name (calculator-op ,key) :keys ,key]) put variable-documentation "Calculator menu." easy-menu-do-define "Calculator" ["Help" (let ((last-command 'calculator-help)) (calculator-help)) :keys "?"] "---" ["Copy" calculator-copy] ["Paste" calculator-paste] ["Electric mode" (progn (calculator-quit) (setq calculator-restart-other-mode t) (run-with-timer 0.1 nil '(lambda nil (message nil))) (calculator)) :active (not calculator-electric-mode)] ["Normal mode" (progn (setq calculator-restart-other-mode t) (calculator-quit)) :active calculator-electric-mode] "Functions" "Repeat-right" ">" "Repeat-left" "<" "------General------" "Reciprocal" ";" "Log" "L" "Square-root" "Q" "Factorial" "!" "------Trigonometric------" "Sinus" "S" "Cosine" "C" "Tangent" "T" "Inv-Sinus" "IS" "Inv-Cosine" "IC" "Inv-Tangent" window-system calculator-use-menu op radix-selectors current-load-list calculator-displayers "IT" "------Bitwise------" "Or" "|" "Xor" "#" "And" "&" "Not" "~" "Saved List" ["Eval+Save" calculator-save-on-list] ["Prev number" calculator-saved-up] ["Next number" calculator-saved-down] ["Delete current" calculator-clear :active (and calculator-display-fragile calculator-saved-list (= (car calculator-stack) (nth calculator-saved-ptr calculator-saved-list)))] ["Delete all" calculator-clear-saved] "List-total" "l" "List-average" "v" ("Registers" ["Get register" calculator-get-register] ["Set register" calculator-set-register]) "Modes" ["Radians" (progn (and (or calculator-input-radix calculator-output-radix) (calculator-radix-mode "D")) (and calculator-deg (calculator-dec/deg-mode))) :keys "D" :style radio :selected (not (or calculator-input-radix calculator-output-radix calculator-deg))] ["Degrees" (progn (and (or calculator-input-radix calculator-output-radix) (calculator-radix-mode "D")) (or calculator-deg (calculator-dec/deg-mode))) :keys "D" :style radio :selected (and calculator-deg (not (or calculator-input-radix calculator-output-radix)))] append car "Seperate I/O" #[(x) "A@\207" [x] 1] ("---") #[(x) "\3018\207" [x 2] 2] "Decimal Display" #[(d) "\302\211A@)\303\304DD\"\207" [d x vector calculator-rotate-displayer quote] 6] ("---" ["Change Prev Display" calculator-displayer-prev] ["Change Next Display" calculator-displayer-next]) ("---" ["Copy+Quit" calculator-save-and-quit] ["Quit" calculator-quit])] 36)
#@4542 A [not so] simple calculator for Emacs.

This calculator is used in the same way as other popular calculators
like xcalc or calc.exe - but using an Emacs interface.

Expressions are entered using normal infix notation, parens are used as
normal.  Unary functions are usually postfix, but some depends on the
value of `calculator-unary-style' (if the style for an operator below is
specified, then it is fixed, otherwise it depends on this variable).
`+' and `-' can be used as either binary operators or prefix unary
operators.  Numbers can be entered with exponential notation using `e',
except when using a non-decimal radix mode for input (in this case `e'
will be the hexadecimal digit).

Here are the editing keys:
* `RET' `='      evaluate the current expression
* `C-insert'     copy the whole current expression to the `kill-ring'
* `C-return'     evaluate, save result the `kill-ring' and exit
* `insert'       paste a number if the one was copied (normally)
* `delete' `C-d' clear last argument or whole expression (hit twice)
* `backspace'    delete a digit or a previous expression element
* `h' `?'        pop-up a quick reference help
* `ESC' `q'      exit (`ESC' can be used if `calculator-bind-escape' is
                 non-nil, otherwise use three consecutive `ESC's)

These operators are pre-defined:
* `+' `-' `*' `/' the common binary operators
* `\' `%'         integer division and reminder
* `_' `;'         postfix unary negation and reciprocal
* `^' `L'         binary operators for x^y and log(x) in base y
* `Q' `!'         unary square root and factorial
* `S' `C' `T'     unary trigonometric operators - sin, cos and tan
* `|' `#' `&' `~' bitwise operators - or, xor, and, not

The trigonometric functions can be inverted if prefixed with an `I', see
below for the way to use degrees instead of the default radians.

Two special postfix unary operators are `>' and `<': whenever a binary
operator is performed, it is remembered along with its arguments; then
`>' (`<') will apply the same operator with the same right (left)
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'):
* `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.

Also, the quote character can be used to switch display modes for
decimal numbers (double-quote rotates back), and the two brace
characters ("{" and "}" change display parameters that these
displayers use (if they handle such).

Values can be saved for future reference in either a list of saved
values, or in registers.

The list of saved values is useful for statistics operations on some
collected data.  It is possible to navigate in this list, and if the
value shown is the current one on the list, an indication is displayed
as "[N]" if this is the last number and there are N numbers, or
"[M/N]" if the M-th value is shown.
* `SPC'            evaluate the current value as usual, but also adds
                   the result to the list of saved values
* `l' `v'          computes total / average of saved values
* `up' `C-p'       browse to the previous value in the list
* `down' `C-n'     browse to the next value in the list
* `delete' `C-d'   remove current value from the list (if it is on it)
* `C-delete' `C-c' delete the whole list

Registers are variable-like place-holders for values:
* `s' followed by a character attach the current value to that character
* `g' followed by a character fetches the attached value

There are many variables that can be used to customize the calculator.
Some interesting customization variables are:
* `calculator-electric-mode'  use only the echo-area electrically.
* `calculator-unary-style'    set most unary ops to pre/postfix style.
* `calculator-user-registers' to define user-preset registers.
* `calculator-user-operators' to add user-defined operators.
See the documentation for these variables, and "calculator.el" for
more information.

\{calculator-mode-map}
(defalias 'calculator-mode #[nil "\303 \210\304\305\306\n!\210\307\310!\207" [major-mode mode-name calculator-mode-map kill-all-local-variables calculator-mode "Calculator" use-local-map run-hooks calculator-mode-hook] 2 (#$ . 17455) nil])
#@93 Run the Emacs calculator.
See the documentation for `calculator-mode' for more information.
(defalias 'calculator #[nil "\203 	?\n\203 \306\n!\210\307\306!\210	\203 \310\213\210\202h \311\312!\313\f!\204O \307\314\315\316\317\320!\203C \321\320\322!\323\"\203C \324\202D \325!!\210\326\f!\210*\202[ p\f=\204[ \315\313\f!!\210\327 \210\330\331 \210\332\333!\210\205r 	\205r \334 \207" [calculator-restart-other-mode calculator-electric-mode calculator-initial-operators calculator-user-operators calculator-buffer window-min-height calculator-add-operators nil ((byte-code "\306\307!\210\310\311!\210\311\211\312\311\313\314 !\315\314 !\210\316 \210\317 \210\320 \321 \321 \322\311!\210\323!\210\324\216\325\326\215\210-\311\207" [garbage-collection-messages echo-keystrokes old-l-map old-g-map calculator-buffer calculator-saved-global-map require electric message nil 0 window-buffer minibuffer-window select-window calculator-reset calculator-update-display current-local-map current-global-map use-local-map use-global-map ((byte-code "\203 \303\304\215\210\305	!\210\306\n!\207" [calculator-buffer old-l-map old-g-map calculator-done (calculator-quit) use-local-map use-global-map] 2)) calculator-done (byte-code "\300\301\302\303\304$\207" [Electric-command-loop calculator-done (lambda nil 'noprompt) nil #[(x y) "\300 \207" [calculator-update-display] 1]] 5) calculator-mode-map] 4)) get-buffer-create "*calculator*" get-buffer-window 2 select-window split-window-vertically fboundp face-attr-construct plist-get modeline :box -3 -2 switch-to-buffer calculator-mode t calculator-reset message "Hit `?' For a quick help screen." calculator split-window-keep-point buffer-read-only] 5 (#$ . 22244) nil])
#@33 Return OP's arity, 2, +1 or -1.
(defalias 'calculator-op-arity #[(op) "\3038\206 \304\211\247\203 	\202 \n\305=\203 \306\202 \307)\207" [op arity calculator-unary-style 3 x postfix 1 -1] 3 (#$ . 23985)])
#@83 Return OP's precedence for reducing when inserting into the stack.
Defaults to 1.
(defalias 'calculator-op-prec #[(op) "\3018\206 \302\207" [op 4 1] 2 (#$ . 24202)])
#@173 This function handles operator addition.
Adds MORE-OPS to `calculator-operator', called initially to handle
`calculator-initial-operators' and `calculator-user-operators'.
(defalias 'calculator-add-operators #[(more-ops) "\306	\203] 	@@\307=\204C \310	@@T\211\nGW\203< \311\312\f\n\313TO\"!\204 \314\f\n\313TO\306#\210\nG\211\202 \314\f\n\315#\210*	@@\307=\203Q 	@A\202S 	@B	A\211\204 \316\237\"\211)\207" [added-ops more-ops key i calculator-mode-map calculator-operators nil nobind -1 keymapp lookup-key 0 define-key calculator-op append] 7 (#$ . 24377)])
#@29 Reset calculator variables.
(defalias 'calculator-reset #[nil "\204\f \305\305\305\305\305\306 \207" [calculator-restart-other-mode calculator-stack calculator-curnum calculator-stack-display calculator-display-fragile nil calculator-update-display] 1 (#$ . 24958)])
#@79 Return a string to display.
The string is set not to exceed the screen width.
(defalias 'calculator-get-prompt #[nil "\306	\204\n \n\2036 	\n=\203 \307\310	\"@!\311P\202? \n\203* \307\310\n\"@!\202+ \311\307\310	\"@!P\202? \f\203> \312\202? \313\"\211A\203P \314P\202b G\315U\203a \203a \316\202b \317Q\211G\320 SZ\211\321X\203x \202\203 G\\\316OP+\207" [calculator-prompt calculator-output-radix calculator-input-radix calculator-char-radix calculator-deg calculator-stack-display format char-to-string rassq "=" "D=" "==" "_" 1 nil "?" window-width 0 calculator-curnum calculator-stack calculator-display-fragile prompt trim] 8 (#$ . 25237)])
#@66 Get the numeric value of the displayed number string as a float.
(defalias 'calculator-curnum-value #[nil "\2034 \306\236A\307\310\nT\211\fGW\2031 \f\nH\211\211\311X\203& \312\202' \313Z)	_\\\202 	+\207\314\f\315\232\203? \316\202p \317\320\f\"\203L \f\321P\202p \317\322\f\"\203W \f\202p \317\323\f\"\203d \f\321P\202p \f;\203o \f\324P\202p \316!@\207" [calculator-input-radix value i radix calculator-curnum ch ((bin . 2) (oct . 8) (hex . 16)) -1 0 57 48 55 read-from-string "." "0.0" string-match "[eE][+-]?$" "0" "\\.[0-9]\\|[eE]" "\\." ".0"] 5 (#$ . 25915)])
#@152 Switch to the next displayer on the `calculator-displayers' list.
Can be called with an optional argument NEW-DISP to force rotation to
that argument.
(defalias 'calculator-rotate-displayer #[(&optional new-disp) "\203) 	>\203) \305	@=\204 	@\nB	A\211\202 	\n\237\244\211)\202/ 	A	@C\244\306\307	@\211A@)\"\210\f\203G \310\311!\210\306\305!\210\312 \207" [new-disp calculator-displayers tmp x calculator-electric-mode nil message "Using %s." sit-for 1 calculator-enter] 4 (#$ . 26496) nil])
#@61 Like `calculator-rotate-displayer', but rotates modes back.
(defalias 'calculator-rotate-displayer-back #[nil "\301\302!@!\207" [calculator-displayers calculator-rotate-displayer last] 3 (#$ . 27004) nil])
#@147 Send the current displayer function a 'left argument.
This is used to modify display arguments (if the current displayer
function supports this).
(defalias 'calculator-displayer-prev #[nil "@\205- \211@@)\2119\203 \n\303!\202, \n:\205, \n@\304=\205, \305\303\n\211A@)\")\207" [calculator-displayers x disp left std calculator-standard-displayer] 4 (#$ . 27218) nil])
#@148 Send the current displayer function a 'right argument.
This is used to modify display arguments (if the current displayer
function supports this).
(defalias 'calculator-displayer-next #[nil "@\205- \211@@)\2119\203 \n\303!\202, \n:\205, \n@\304=\205, \305\303\n\211A@)\")\207" [calculator-displayers x disp right std calculator-standard-displayer] 4 (#$ . 27598) nil])
#@133 Get a number string NUMSTR and remove unnecessary zeroes.
the behavior of this function is controlled by
`calculator-remove-zeros'.
(defalias 'calculator-remove-zeros #[(numstr) "\302=\203# \303\304	\"\203# \305\224\203 	\306\211\224O\307\305	\"P\207	\306\211\224O\207\203D \303\310	\"\203D \311\224\203> 	\306\312\224O\307\311	\"P\207	\306\312\224O\207	\207" [calculator-remove-zeros numstr t string-match "\\.0+\\([eE][+-]?[0-9]*\\)?$" 1 0 match-string "\\..\\([0-9]*[1-9]\\)?\\(0+\\)\\([eE][+-]?[0-9]*\\)?$" 3 2] 4 (#$ . 27980)])
#@503 Standard display function, used to display NUM.
Its behavior is determined by `calculator-number-digits' and the given
CHAR argument (both will be used to compose a format string).  If the
char is "n" then this function will choose one between %f or %e, this
is a work around %g jumping to exponential notation too fast.

The special 'left and 'right symbols will make it change the current
number of digits displayed (`calculator-number-digits').

It will also remove redundant zeros from the result.
(defalias 'calculator-standard-displayer #[(num char) "9\203' \305=\203 	\306V\205& 	S\211\205& \307 \207\310=\205` 	T\307 \207\311!\2031 \312\202[ \313\314\315	!\n\316=\203U \317!\211\320W\204L \321V\203P \322\202Q \323)\202X \324\n!Q\"\325\f!)\207" [num calculator-number-digits char n str left 0 calculator-enter right zerop "0" format "%." number-to-string 110 abs 0.001 100000000.0 "e" "f" string calculator-remove-zeros] 6 (#$ . 28523)])
#@220 Display NUM in engineering notation.
The number of decimal digits used is controlled by
`calculator-number-digits', so to change it at runtime you have to use
the 'left or 'right when one of the standard modes is used.
(defalias 'calculator-eng-display #[(num) "9\2033 \306=\203 	\203 	T\202 \307\310\311 )\207\312=\205\274 	\203+ 	S\202, \313\310\311 )\207\314\314U\204\230 \315!\316W\203N \317_\320Z\202; \315!\321V\203a \322\245\320\\\202N \n\203\230 \314	U\204\230 	\211\314V\203\202 \323_\320Z\fS\211\202n \f\314W\203\227 \324\245\320\\\fT\211\202\203 )\n\204\236 \325\326\327\330!\331Q\"\205\257 \332\333!)\334\330!Q*\207" [num calculator-eng-extra calculator-eng-tmp-show exp i calculator-number-digits left 1 t calculator-enter right -1 0 abs 1.0 1000.0 3 999.0 1000.0 1000.0 1000.0 nil format "%." number-to-string "f" x calculator-remove-zeros "e" str] 5 (#$ . 29488)])
#@38 Convert NUM to a displayable string.
(defalias 'calculator-num-to-string #[(num) "\247\203c 	\203c \306	\307=\203 \310\202 \311\312\n\203 \202! \313!!\"	\314=\203O \315\316T\211GW\203D \fH\317\236AP\202. \320\321\f\"\210\322\323\f\"*\n\204_ \324W\203_ \325P\202` \226)\207\247\203\256 \203\256 ;\203y \306\"\2079\203\204 !\207:\203\236 @\326=\203\236 \327\211A@)\"\207<\203\251 \330!\207\331\332\"\207\331A@\332\"\207" [num calculator-output-radix calculator-2s-complement str s i format hex "%x" "%o" calculator-truncate abs bin -1 "" ((48 . "000") (49 . "001") (50 . "010") (51 . "011") (52 . "100") (53 . "101") (54 . "110") (55 . "111")) string-match "^0*\\(.+\\)" match-string 1 0 "-" std calculator-standard-displayer eval prin1-to-string t calculator-displayer x] 6 (#$ . 30419)])
#@89 Update the display.
If optional argument FORCE is non-nil, don't use the cached string.
(defalias 'calculator-update-display #[(&optional force) "q\210	\204 \n@=\204l \211\203i \f\203' G\306U\203' \f\211@@)\202) \307\310\311!\312#)\312\205e \205e @8U\205e \313U\203Y \314\315G\"\202e \314\316GZG#Q\202j \317B\320\321 \210\322 c\210)\323\324!\210\203\206 GTb\207`Sb\207" [calculator-buffer force calculator-stack-display calculator-stack calculator-displayers x 1 mapconcat calculator-num-to-string reverse " " 0 format "[%s]" "[%s/%s]" "" t erase-buffer calculator-get-prompt set-buffer-modified-p nil calculator-displayer calculator-display-fragile calculator-saved-list calculator-saved-ptr inhibit-read-only calculator-prompt] 8 (#$ . 31260)])
#@103 Reduce the stack using top operator.
PREC is a precedence - reduce everything with higher precedence.
(defalias 'calculator-reduce-stack #[(prec) "AA\2039 @:\2039 A@\247\2039 \3028:\2039 @A@\303=\2039 \3028A@\304=\2039 A@\305\233B\211\202 AA\203| @\247\203| A@:\203| \3028\247\203| \306A@!\302U\203| 	\307A@!X\203| \310\302A@8\3028@#\305\233B\211\202 G\302Y\203\266 @\247\203\266 A@:\203\266 \306A@!\311U\203\266 	\307A@!X\203\266 \310\302A@8@\"AAB\211\202 A\203\354 @:\203\354 A@\247\203\354 \306@!\312U\203\354 	\307@!X\203\354 \310\302@8A@\"AAB\211\202 \203@:\203\306@!\313U\203\310\302@8!AB\211\202 A\203'@\247\203'A@\247\203'\211AA\241\202(\314\205.\202  \207" [calculator-stack prec 2 \) \( 3 calculator-op-arity calculator-op-prec calculator-funcall -1 1 0 nil] 5 (#$ . 32051)])
#@115 If F is a symbol, evaluate (F X Y).
Otherwise, it should be a list, evaluate it with X, Y bound to the
arguments.
(defalias 'calculator-funcall #[(f &optional X Y) "\203	 	\nE\304\305\306\217\207" [Y f X calculator-last-opXY nil (byte-code "9\203 	\203 \n\203 	\n\"\207	\203 	!\207 \207\306	!\n\205* \306\n!\2039 	_\307\245\202: 	\310\311!\211\205K \311K\310\312!\211\205X \312K\311\313M\210\312\314M\210\315\216\316!.\n\207" [f X Y __f__ TX TY calculator-truncate 180 fboundp F D #[(&optional x y) "\303	\n#\207" [__f__ x y calculator-funcall] 4] #[(x) "\203\n 	\303_\n\245\207	\207" [calculator-deg x pi 180] 2] ((byte-code "\203 \304	M\210\202 \305\304!\210\n\203 \306M\210\202 \305\306!\210\304\207" [Fbound Fsave Dbound Dsave F fmakunbound D] 2)) eval calculator-deg pi DX calculator-saved-list L Fbound Fsave Dbound Dsave] 4) ((error 0))] 3 (#$ . 32908)])
#@126 Last char (or event or event sequence) that was read.
Optional string argument KEYS will force using it as the keys entered.
(defalias 'calculator-last-input #[(&optional keys) "\206 \305 \211;\204 \306	!\204 	\202[ \307\310	G\311\"\312\nT\211	GW\203Y 	\nH\313\314!\203D \315\f!\203D \314\f!\203D \314\f!\f9\203Q \f\316N\206P \311\n\fI\210\202  +)\207" [keys inp i converted-str k this-command-keys arrayp -1 make-string 32 nil fboundp event-key key-press-event-p ascii-character] 4 (#$ . 33819)])
#@112 Clear the fragile flag if it was set, then maybe reset all.
OP is the operator (if any) that caused this call.
(defalias 'calculator-clear-fragile #[(&optional op) "\203 	\203 \302	!\303U\204 \302	!\304U\203 \305 \210\306\211\207" [calculator-display-fragile op calculator-op-arity -1 0 calculator-reset nil] 2 (#$ . 34338)])
#@23 Enter a single digit.
(defalias 'calculator-digit #[nil "\306 \307H	\204 \n@\247?\205Q \204 \310X\2023 \311=\203& \312X\2023 \313=\2032 \314X\2023 \315\205Q \316 \210\317!\226\320\232\203F \321\206K \322\fP)\323 )\207" [inp calculator-display-fragile calculator-stack calculator-input-radix digit calculator-curnum calculator-last-input 0 57 bin 49 oct 55 t calculator-clear-fragile char-to-string "0" nil "" calculator-update-display] 2 (#$ . 34676) nil])
#@25 Enter a decimal period.
(defalias 'calculator-decimal #[nil "?\205) 	\204 \n@\247?\205) \205 \304\305\"?\205) \306 \210\206$ \307\310P\311 \207" [calculator-input-radix calculator-display-fragile calculator-stack calculator-curnum string-match "[.eE]" calculator-clear-fragile "0" "." calculator-update-display] 3 (#$ . 35154) nil])
#@64 Enter an `E' exponent character, or a digit in hex input mode.
(defalias 'calculator-exp #[nil "\203 \304 \207	\204 \n@\247?\205+ \205 \305\306\"?\205+ \307 \210\206& \310\311P\312 \207" [calculator-input-radix calculator-display-fragile calculator-stack calculator-curnum calculator-digit string-match "[eE]" calculator-clear-fragile "1" "e" calculator-update-display] 3 (#$ . 35500) nil])
#@136 Enter an operator on the stack, doing all necessary reductions.
Optional string argument KEYS will force using it as the keys entered.
(defalias 'calculator-op #[(&optional keys) "\300\301\215\207" [op-error (byte-code "\306!\307	\n\"\310!\210\f\203 \311!\312U\204 \313 B\314\311!\315U\203p \2032 @\247\204p \n	@@\232\204F A\2025 \307	A\"\211\203Y \311!\316U\204o \317\320!\210\203j \321\322!\210\317\314!\210\323\324\314\"\210)\325A@\326=\203} \327\202\214 A@\330=\203\211 \312\202\214 \331!!\210\311!\316U\203\234 @\247\204\262 \311!\316U\204\310 \311!\312U\204\310 @\247\204\310 \317\332!\210\203\303 \321\322!\210\317\314!\210\323\324\314\"\210B\325\331!!\210G\322U\203\3128\247\203\333\211\203 \203!\312U\203\375 @\"B\"\202!S\"\233\211#@#AB\241\210)\334 *\207" [keys last-inp calculator-operators op calculator-curnum calculator-stack calculator-last-input assoc calculator-clear-fragile calculator-op-arity 0 calculator-curnum-value nil 2 -1 message "Binary operator without a first operand" sit-for 1 throw op-error calculator-reduce-stack \( 10 \) calculator-op-prec "Unterminated expression" t calculator-update-display rest-ops calculator-electric-mode calculator-display-fragile calculator-add-saved calculator-saved-ptr calculator-saved-list p] 4)] 2 (#$ . 35906) nil])
#@185 Either enter an operator or a digit.
Used with +/- for entering them as digits in numbers like 1e-3 (there is
no need for negative numbers since these are handled by unary
operators).
(defalias 'calculator-op-or-exp #[nil "\204 	\203 \302\303	\"\203 \304 \207\305 \207" [calculator-display-fragile calculator-curnum string-match "[eE]$" calculator-digit calculator-op] 3 (#$ . 37260) nil])
#@68 Set decimal mode for display & input, if decimal, toggle deg mode.
(defalias 'calculator-dec/deg-mode #[nil "\203	 \305 	B\306\n\204 \203 \306\306\202 \f?\307\310!\207" [calculator-curnum calculator-stack calculator-input-radix calculator-output-radix calculator-deg calculator-curnum-value nil calculator-update-display t] 2 (#$ . 37660) nil])
#@107 Set input and display radix modes.
Optional string argument KEYS will force using it as the keys entered.
(defalias 'calculator-radix-mode #[(&optional keys) "\301!\210\302!\207" [keys calculator-radix-input-mode calculator-radix-output-mode] 2 (#$ . 38022) nil])
#@95 Set input radix modes.
Optional string argument KEYS will force using it as the keys entered.
(defalias 'calculator-radix-input-mode #[(&optional keys) "\203	 \306 	B\307\310\n!\211\211GSH\226\f\236A)\311 \207" [calculator-curnum calculator-stack keys inp calculator-char-radix calculator-input-radix calculator-curnum-value nil calculator-last-input calculator-update-display] 3 (#$ . 38294) nil])
#@97 Set display radix modes.
Optional string argument KEYS will force using it as the keys entered.
(defalias 'calculator-radix-output-mode #[(&optional keys) "\203	 \306 	B\307\310\n!\211\211GSH\226\f\236A)\311\312!\207" [calculator-curnum calculator-stack keys inp calculator-char-radix calculator-output-radix calculator-curnum-value nil calculator-last-input calculator-update-display t] 3 (#$ . 38704) nil])
#@67 Evaluate current expression, put result on the saved values list.
(defalias 'calculator-save-on-list #[nil "\301\302 )\207" [calculator-add-saved t calculator-enter] 1 (#$ . 39124) nil])
#@60 Clear the list of saved values in `calculator-saved-list'.
(defalias 'calculator-clear-saved #[nil "\302\303\304\305!\207" [calculator-saved-list calculator-saved-ptr nil 0 calculator-update-display t] 2 (#$ . 39318) nil])
#@44 Go N elements up the list of saved values.
(defalias 'calculator-saved-move #[(n) "\205* 	\203\f \n\205* \f\\G^\305]\2118\203% \f8C\306\202( \307 \210\310 \207" [calculator-saved-list calculator-stack calculator-display-fragile n calculator-saved-ptr 0 t calculator-reset calculator-update-display] 3 (#$ . 39549) nil])
#@33 Go up the list of saved values.
(defalias 'calculator-saved-up #[nil "\300\301!\207" [calculator-saved-move 1] 2 (#$ . 39883) nil])
#@35 Go down the list of saved values.
(defalias 'calculator-saved-down #[nil "\300\301!\207" [calculator-saved-move -1] 2 (#$ . 40021) nil])
#@30 Equivalents of `(' use this.
(defalias 'calculator-open-paren #[nil "\300\301!\207" [calculator-op "("] 2 (#$ . 40164) nil])
#@30 Equivalents of `)' use this.
(defalias 'calculator-close-paren #[nil "\300\301!\207" [calculator-op ")"] 2 (#$ . 40295) nil])
#@30 Evaluate current expression.
(defalias 'calculator-enter #[nil "\300\301!\207" [calculator-op "="] 2 (#$ . 40427) nil])
#@52 Backward delete a single digit or a stack element.
(defalias 'calculator-backspace #[nil "\203 G\302V\205 \303GSO\202 	A\304 \207" [calculator-curnum calculator-stack 1 0 calculator-update-display] 3 (#$ . 40553) nil])
#@23 Clear current number.
(defalias 'calculator-clear #[nil "\306	\203@ \n\203@ @\f\n8U\203@ \f\307U\203 \nA\202. \fS\n\233\211\211AA\241\210\fS)\n\203: \f\n8C\202O \310 \210\202O 	\204L \n=\203O \310 \210\311 \207" [calculator-curnum calculator-display-fragile calculator-saved-list calculator-stack calculator-saved-ptr p nil 0 calculator-reset calculator-update-display last-command this-command] 4 (#$ . 40787) nil])
#@41 Copy current number to the `kill-ring'.
(defalias 'calculator-copy #[nil "\206 	?\205 \n\305 \210A\211\205* \306\307\f\"\205* \310\311\f\"\211\205* \312\f!+\207" [calculator-copy-displayer calculator-displayer calculator-displayers calculator-stack-display s calculator-enter string-match "^\\([^ ]+\\) *\\(\\[[0-9/]+\\]\\)? *$" match-string 1 kill-new] 4 (#$ . 41220) nil])
#@31 Set a register value for REG.
(defalias 'calculator-set-register #[(reg) "	\236\305 \210@\n\203 \n\f\241\210\202 \fB	B\306\307\310\f#!*\207" [reg calculator-registers as calculator-stack val calculator-enter message format "[%c] := %S"] 5 (#$ . 41610) "cRegister to store into: "])
#@73 Paste VAL as if entered.
Used by `calculator-paste' and `get-register'.
(defalias 'calculator-put-value #[(val) "\247\205 	\204 \n@\247?\205 \305 \210\306\307!)\310 \207" [val calculator-display-fragile calculator-stack calculator-displayer calculator-curnum calculator-clear-fragile "%S" calculator-num-to-string calculator-update-display] 2 (#$ . 41907)])
#@37 Paste a value from the `kill-ring'.
(defalias 'calculator-paste #[nil "\302\303\304!	\2037 \305\306\"\2037 \307\310\"\204% \307\311\"\204% \307\312\"\2037 \307\310\"\307\311\"\2061 \313\307\312\"Q\314\315\316\217)!\207" [str calculator-paste-decimals calculator-put-value current-kill 0 string-match "\\([0-9]+\\)\\(\\.[0-9]+\\)?\\(e[0-9]+\\)?" match-string 1 2 3 ".0" nil (byte-code "\301!@\207" [str read-from-string] 2) ((error))] 6 (#$ . 42278) nil])
#@34 Get a value from a register REG.
(defalias 'calculator-get-register #[(reg) "\302	\236A!\207" [reg calculator-registers calculator-put-value] 3 (#$ . 42749) "cRegister to get value from: "])
#@976 Quick reference:
* numbers/operators/parens/./e - enter expressions
  + - * / \(div) %(rem) _(-X,postfix) ;(1/X,postfix) ^(exp) L(og)
  Q(sqrt) !(fact) S(in) C(os) T(an) |(or) #(xor) &(and) ~(not)
* >/< repeats last binary operation with its 2nd (1st) arg as postfix op
* I inverses 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
* 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
* C-insert  - copy whole expr.         * C-return - evaluate, copy, exit
* insert    - paste a number           * backspace- delete backwards
* delete    - clear argument or list value or whole expression (twice)
* escape/q  - exit.
(defalias 'calculator-help #[nil "\306=\203C \307\310\311 \312 \313\314!\210\203 \315!\210\203) \316\317\320 \"\203/ \321 \210\2022 \322 \210\203: \315\n!\210\323	!\210\324\325!,\207\326\327!\312 \330\331!\332\213\210\323	!+\207" [last-command win g-map major-mode mode-name calculator-electric-mode calculator-help "Calculator" calculator-mode current-global-map selected-window require ehelp use-global-map string-match "XEmacs" emacs-version describe-mode electric-describe-mode select-window message nil one-window-p t get-buffer-create "*Help*" ((byte-code "\303\220\304\305\306!!\221\210\203 \307\310	!!\210\311\312\313 \"\210\314\n!\210\315\316!\207" [one help-buf win "*Help*" princ documentation calculator-help shrink-window-if-larger-than-buffer get-buffer-window message "`%s' again for more help, any other key continues normally." calculator-last-input select-window sit-for 360] 4)) calculator-saved-global-map help-buf one] 4 (#$ . 42948) nil])
#@18 Quit calculator.
(defalias 'calculator-quit #[nil "q\210\303\304 \210)\n\204 \305\306\307\217\210\310!\210\305\311\312!\210\n\205$ \313\314\305\"\207" [calculator-buffer inhibit-read-only calculator-electric-mode t erase-buffer nil (byte-code "\301!\203 \302\301!!\210\202  \301\207" [calculator-buffer get-buffer-window delete-window] 3) ((error)) kill-buffer message "Calculator done." throw calculator-done] 3 (#$ . 44908) nil])
#@60 Quit the calculator, saving the result on the `kill-ring'.
(defalias 'calculator-save-and-quit #[nil "\300 \210\301 \210\302 \207" [calculator-enter calculator-copy calculator-quit] 1 (#$ . 45354) nil])
#@135 Repeats the last binary operation with its second argument and X.
To use this, apply a binary operator (evaluate it), then call this.
(defalias 'calculator-repR #[(x) "\203 \302@	\3038#)\207	\207" [calculator-last-opXY x calculator-funcall 2] 5 (#$ . 45564)])
#@134 Repeats the last binary operation with its first argument and X.
To use this, apply a binary operator (evaluate it), then call this.
(defalias 'calculator-repL #[(x) "\203 \302@A@	#)\207	\207" [calculator-last-opXY x calculator-funcall] 4 (#$ . 45837)])
#@24 Simple factorial of X.
(defalias 'calculator-fact #[(x) "\302X\203\n \303\202 \304\305V\203 	\306!_S\211\202 	)\207" [x r 10 1 1.0 0 truncate] 4 (#$ . 46103)])
#@43 Truncate N, return 0 in case of overflow.
(defalias 'calculator-truncate #[(n) "\300\301\302\217\207" [nil (truncate n) ((error 0))] 3 (#$ . 46279)])
(provide 'calculator)
