
(provide (quote calc))

(defun calc-record-compilation-date nil (byte-code "" [calc-installed-date "Mon Feb 10 03:51:18 1992 by Jonathan I. Kamens"] 2))

(calc-record-compilation-date)

(defvar calc-info-filename "calc.info" "\
*File name in which to look for the Calculator's Info documentation.")

(defvar calc-settings-file "~/.emacs" "\
*File in which to record permanent settings; default is \"~/.emacs\".")

(defvar calc-autoload-directory "/mit/sipb/lib/elisp/calc/" "\
Name of directory from which additional \".elc\" files for Calc should be
loaded.  Should include a trailing \"/\".
If nil, use original installation directory.
This can safely be nil as long as the Calc files are on the load-path.")

(defvar calc-gnuplot-name "gnuplot" "\
*Name of GNUPLOT program, for calc-graph features.")

(defvar calc-gnuplot-plot-command nil "\
*Name of command for displaying GNUPLOT output; %s = file name to print.")

(defvar calc-gnuplot-print-command "lp %s" "\
*Name of command for printing GNUPLOT output; %s = file name to print.")

(defvar calc-bug-address "daveg@csvax.cs.caltech.edu")

(defvar calc-scan-for-dels t)

(defvar calc-extensions-loaded nil)

(defvar calc-stack (quote ((top-of-stack 1 nil))))

(defvar calc-display-sci-high 0)

(defvar calc-display-sci-low -3)

(defvar calc-other-modes nil)

(defvar calc-Y-help-msgs nil)

(defvar calc-loaded-settings-file nil)

(defconst calc-mode-var-list (quote ((calc-always-load-extensions nil) (calc-mode-save-mode local) (calc-line-numbering t) (calc-line-breaking t) (calc-display-just nil) (calc-display-origin nil) (calc-left-label "") (calc-right-label "") (calc-number-radix 10) (calc-leading-zeros nil) (calc-group-digits nil) (calc-group-char ",") (calc-point-char ".") (calc-frac-format (":" nil)) (calc-prefer-frac nil) (calc-hms-format "%s@ %s' %s\"") (calc-date-format ((H ":" mm C SS pp " ") Www " " Mmm " " D ", " YYYY)) (calc-standard-date-formats ("N" "<H:mm:SSpp >Www Mmm D, YYYY" "D Mmm YYYY<, h:mm:SS>" "Www Mmm BD< hh:mm:ss> YYYY" "M/D/Y< H:mm:SSpp>" "D.M.Y< h:mm:SS>" "M-D-Y< H:mm:SSpp>" "D-M-Y< h:mm:SS>" "j<, h:mm:SS>" "YYddd< hh:mm:ss>")) (calc-float-format (float 0)) (calc-full-float-format (float 0)) (calc-complex-format nil) (calc-matrix-just center) (calc-full-vectors t) (calc-full-trail-vectors t) (calc-break-vectors nil) (calc-vector-commas ",") (calc-vector-brackets "[]") (calc-matrix-brackets (R O)) (calc-complex-mode cplx) (calc-infinite-mode nil) (calc-display-strings nil) (calc-simplify-mode nil) (calc-auto-recompute t) (calc-word-size 32) (calc-previous-modulo nil) (calc-display-raw nil) (calc-internal-prec 12) (calc-angle-mode deg) (calc-algebraic-mode nil) (calc-incomplete-algebraic-mode nil) (calc-symbolic-mode nil) (calc-matrix-mode nil) (calc-autorange-units nil) (calc-shift-prefix nil) (calc-window-height 7) (calc-was-keypad-mode nil) (calc-full-mode nil) (calc-language nil) (calc-language-option nil) (calc-user-parse-tables nil) (calc-show-selections t) (calc-use-selections t) (calc-assoc-selections t) (calc-display-trail t) (calc-display-working-message lots) (calc-auto-why (quote maybe)) (calc-timing nil) (calc-gnuplot-default-device "default") (calc-gnuplot-default-output "STDOUT") (calc-gnuplot-print-device "postscript") (calc-gnuplot-print-output "auto") (calc-gnuplot-geometry nil) (calc-graph-default-resolution 15) (calc-graph-default-resolution-3d 5) (calc-invocation-macro nil))))

(defconst calc-local-var-list (quote (calc-stack calc-stack-top calc-undo-list calc-redo-list calc-always-load-extensions calc-mode-save-mode calc-display-raw calc-line-numbering calc-line-breaking calc-display-just calc-display-origin calc-left-label calc-right-label calc-auto-why calc-algebraic-mode calc-incomplete-algebraic-mode calc-symbolic-mode calc-matrix-mode calc-inverse-flag calc-hyperbolic-flag calc-keep-args-flag calc-angle-mode calc-number-radix calc-leading-zeros calc-group-digits calc-group-char calc-point-char calc-frac-format calc-prefer-frac calc-hms-format calc-date-format calc-standard-date-formats calc-float-format calc-full-float-format calc-complex-format calc-matrix-just calc-full-vectors calc-full-trail-vectors calc-break-vectors calc-vector-commas calc-vector-brackets calc-matrix-brackets calc-complex-mode calc-infinite-mode calc-display-strings calc-simplify-mode calc-auto-recompute calc-autorange-units calc-show-plain calc-show-selections calc-use-selections calc-assoc-selections calc-word-size calc-internal-prec)))

(defun calc-init-base nil (byte-code "D E ! F E G \"H G !6 I G K!J =6 K G K8
	K L M N 	@\"!?V 	A9 	  O ! 
O !N P L M @\"!? As  P 
Q O M @\"!!C\"*  R S \"? P 
Q !C\"*T U V W #T X V W #T Y Z [ #T Y \\ ] #T ^ Z _ #T ^ \\ ` #T a Z b #T a \\ c #d e 
f g  !\"h #$h %&'()*+,-/01234i 5j 6k 7l 8m 9n :o p ;\"o q <\"r !ɂJs  =t =\"u =v w #u =x y #u =z { #u =| } #u =~  #u =  #u =  #u =  #u =  #u =  #u =  #u =  #u = #u =  #u =  #u =  #u =  #u =  #u =  #u =  #u =  #u =  #u =  #u =  #o   \"o    P\"o   \"s  >h ?? W>?=?H =  I?T?)o   \"o   \"u >  #u >  #u >  #o  @   A\"  A\" # \"s  B B!  C C!u B C#J   \"J   \"o   \"o   \"" [name p load-path p2 name2 calc-autoload-directory calc-version calc-version-date calc-trail-pointer nil calc-trail-overlay calc-was-split calc-undo-list calc-redo-list calc-main-buffer calc-trail-buffer calc-why calc-next-why calc-inverse-flag calc-hyperbolic-flag calc-keep-args-flag calc-function-open calc-function-close calc-language-output-filter calc-language-input-filter calc-radix-formatter calc-last-kill calc-previous-alg-entry calc-dollar-values calc-dollar-used calc-hashes-used calc-quick-prev-results calc-said-hello calc-executing-macro calc-any-selections calc-help-phase calc-full-help-flag calc-refresh-count calc-display-dirty calc-prepared-composition calc-selection-cache-default-entry calc-embedded-info calc-embedded-active calc-standalone-flag var-EvalRules math-eval-rules-cache-tag t math-radix-explicit-format math-expr-function-mapping math-expr-variable-mapping math-read-expr-quotes math-working-step math-working-step-2 var-i var-pi var-e var-phi var-gamma var-Modes calc-mode-var-list calc-local-var-list calc-mode-map calc-digit-map i calc-scan-for-dels global-map calc-dispatch-map calc-dispatch-meta-map global-key-binding "#" global-set-key calc-dispatch fboundp car-safe autoload 1 file-exists-p expand-file-name "calc-misc.elc" file-name-directory nconc directory-file-name equal "" put calc-mode mode-class special calc-trail-mode inexact-result error-conditions (error inexact-result calc-error) error-message "Calc internal error (inexact-result)" math-overflow (error math-overflow calc-error) "Floating-point overflow occurred" math-underflow (error math-underflow calc-error) "Floating-point underflow occurred" "2.02" "Fri Feb  7 00:40:36 PST 1992" "(" ")" 0 (special-const (math-imaginary 1)) (special-const (math-pi)) (special-const (math-e)) (special-const (math-phi)) (special-const (math-gamma-const)) (special-const (math-get-modes-vec)) mapcar (lambda (v) (byte-code "@! @8L" [v boundp 1] 4)) (lambda (v) (byte-code "!	 L" [v nil boundp] 3)) boundp make-keymap suppress-keymap define-key "+" calc-plus "-" calc-minus "*" calc-times "/" calc-divide "%" calc-mod "&" calc-inv "^" calc-power "" calc-percent "e" calcDigit-start "i" calc-info "n" calc-change-sign "q" calc-quit "Y" "Y?" calc-shift-Y-prefix-help "?" calc-help " " calc-enter "'" calc-algebraic-entry "$" calc-auto-algebraic-entry "\"" "	" calc-roll-down "" calc-roll-up "" "" calc-last-args-stub "
" calc-over (lambda (x) (byte-code "	!#" [calc-mode-map x define-key char-to-string undefined] 5)) "lOW" (lambda (x) (byte-code "	!#" [calc-mode-map x define-key char-to-string calc-missing-key] 5)) "ABCDEFGHIJKLMNPQRSTUVXZabcdfghjkmoprstuvwxyz" ":\\|!()[]<>{},;=~`" (lambda (x) (byte-code "	!#" [calc-mode-map x define-key char-to-string calcDigit-start] 5)) "_0123456789.#@" 128 undefined calcDigit-nondigit (lambda (x) (byte-code "	!#" [calc-digit-map x define-key char-to-string calcDigit-key] 5)) "_0123456789.e+-:n#@oh'\"mspM" (lambda (x) (byte-code "	!#" [calc-digit-map x define-key char-to-string calcDigit-letter] 5)) "abcdfgijklqrtuvwxyzABCDEFGHIJKLNOPQRSTUVWXYZ" calcDigit-algebraic "`" calcDigit-edit "" abort-recursive-edit (lambda (x) (byte-code "" [err (byte-code "	#
	#
	P#" [calc-digit-map x calc-mode-map define-key calcDigit-backspace calc-pop "" calc-pop-above] 6) ((error (byte-code "" [nil] 1)))] 3)) append where-is-internal delete-backward-char backward-delete-char ("") ("" "") calc-build-dispatch-map make-sparse-keymap "" calc-extensions "calc-ext" calc-need-macros "calc-macs" (lambda (x) (byte-code "A\"" [x mapcar (lambda (func) (byte-code "	@\"" [func x autoload] 3))] 3)) (("calc-aent" calc-Need-calc-aent calc-alg-digit-entry calc-alg-entry calc-check-user-syntax calc-do-alg-entry calc-do-calc-eval calc-do-quick-calc calc-match-user-syntax math-build-parse-table math-find-user-tokens math-read-expr-list math-read-exprs math-read-if math-read-token math-remove-dashes) ("calc-misc" calc-Need-calc-misc calc-delete-windows-keep calc-do-handle-whys calc-do-refresh calc-num-prefix-name calc-record-list calc-record-why calc-report-bug calc-roll-down-stack calc-roll-up-stack calc-temp-minibuffer-message calcFunc-floor calcFunc-inv calcFunc-trunc math-concat math-constp math-div2 math-div2-bignum math-do-working math-evenp math-fixnatnump math-fixnump math-floor math-imod math-ipow math-looks-negp math-mod math-negp math-posp math-pow math-read-radix-digit math-reject-arg math-trunc math-zerop)) (lambda (x) (byte-code "A\"" [x mapcar (lambda (cmd) (byte-code "	@$" [cmd x nil t autoload] 5))] 3)) (("calc-aent" calc-algebraic-entry calc-auto-algebraic-entry calcDigit-algebraic calcDigit-edit) ("calc-misc" another-calc calc-big-or-small calc-dispatch-help calc-help calc-info calc-info-summary calc-inv calc-last-args-stub calc-missing-key calc-mod calc-other-window calc-over calc-percent calc-pop-above calc-power calc-roll-down calc-roll-up calc-shift-Y-prefix-help calc-tutorial calcDigit-letter report-calc-bug))] 78))

(defun calc-build-dispatch-map (map) (byte-code "\"##########" [map mapcar (lambda (x) (byte-code "	@!	A#	@#!	A#" [map x define-key char-to-string - 97 -1] 9)) ((97 . calc-embedded-activate) (98 . calc-big-or-small) (99 . calc) (100 . calc-embedded-duplicate) (101 . calc-embedded) (102 . calc-embedded-new-formula) (104 . calc-dispatch-help) (105 . calc-info) (106 . calc-embedded-select) (107 . calc-keypad) (108 . calc-load-everything) (110 . calc-embedded-next) (111 . calc-other-window) (112 . calc-embedded-previous) (113 . quick-calc) (114 . calc-grab-rectangle) (115 . calc-info-summary) (116 . calc-tutorial) (117 . calc-embedded-update-formula) (119 . calc-embedded-word) (120 . calc-quit) (121 . calc-copy-to-buffer) (122 . calc-user-invocation)) define-key "g" calc-grab-region "m" read-kbd-macro "=" calc-embedded-update-formula "'" calc-embedded-new-formula "`" calc-embedded-edit ":" calc-grab-sum-down "_" calc-grab-sum-across "0" calc-reset "#" calc-same-interface "?" calc-dispatch-help] 14))

(calc-init-base)

(defun calc-dispatch (&optional arg) "\
Invoke the GNU Emacs Calculator.  See calc-dispatch-help for details." (interactive "P") (byte-code "!Ə	!" [echo-keystrokes arg nil sit-for err (byte-code " \"3 	\"=3 \"- 	O\"9- 	O#	#)" [keys calc-dispatch-map nil this-command-keys string-match "\\`\\|\\`[-0-9#]\\|`[-]" lookup-key calc-same-interface "\\`[ -]" 0 1 define-key] 10) ((error (byte-code "" [nil] 1))) calc-do-dispatch] 4))

(defun calc-do-dispatch (arg) (byte-code "		 Ă  !\"
\"
\"!1 !*  !3  )" [key calc-dispatch-help calc-dispatch-map calc-read-key-sequence "Calc options: Calc, Keypad, Quick, Embed; eXit; Info, Tutorial; Grab; ?=more" format "%s  (Type ? for a list of Calc options)" key-description this-command-keys lookup-key message "" commandp calc-extensions call-interactively beep] 11))

(setq calc-dispatch-help nil)

(defun calc-read-key-sequence (prompt map) (byte-code " !\"    !rώ!!!!!4 ւ5 !)+" [prompt2 glob loc prompt unread-command-char map nil format "%s " key-description this-command-keys current-global-map current-local-map input-pending-p message ((byte-code "!	!" [glob loc use-global-map use-local-map] 3)) use-global-map use-local-map read-key-sequence commandp key-binding char-to-string ""] 14))

(defun calc-mode nil "\
Calculator major mode.

This is an RPN calculator featuring arbitrary-precision integer, rational,
floating-point, complex, matrix, and symbolic arithmetic.

RPN calculation:  2 RET 3 +    produces 5.
Algebraic style:  ' 2+3 RET    produces 5.

Basic operators are +, -, *, /, ^, & (reciprocal), % (modulo), n (change-sign).

Press ? repeatedly for more complete help.  Press `h i' to read the
Calc manual on-line, `h s' to read the summary, or `h t' for the tutorial.

Notations:  3.14e6     3.14 * 10^6
            _23        negative number -23 (or type `23 n')
            17:3       the fraction 17/3
            5:2:3      the fraction 5 and 2/3
            16#12C     the integer 12C base 16 = 300 base 10
            8#177:100  the fraction 177:100 base 8 = 127:64 base 10
            (2, 4)     complex number 2 + 4i
            (2; 4)     polar complex number (r; theta)
            [1, 2, 3]  vector  ([[1, 2], [3, 4]] is a matrix)
            [1 .. 4)   semi-open interval, 1 <= x < 4
            2 +/- 3    (p key) number with mean 2, standard deviation 3
            2 mod 3    (M key) number 2 computed modulo 3
	    <1 jan 91> Date form (enter using ' key)


\\{calc-mode-map}
" (interactive) (byte-code "ˈ\" 	=  
 !\"!!ŉŉމ߉
\"
>N EC
G	
G	#	v \"v ŉ\"= ! # @\" 8\" 8\" ŉA )!! !  ! B!ˉ  " [calc-local-var-list calc-algebraic-mode calc-alg-map calc-mode-map truncate-lines t buffer-read-only major-mode mode-name calc-stack-top calc-stack nil calc-loaded-settings-file calc-settings-file window-system mouse-map p command-line-args calc-standalone-flag calc-defs mapcar (lambda (v) (byte-code "J\"" [v set-default] 3)) kill-all-local-variables use-local-map total calc-extensions (lambda (v) (byte-code "!" [v make-local-variable] 2)) make-local-variable overlay-arrow-position overlay-arrow-string calc-mode "Calculator" assq top-of-stack 1 - -1 string-match "\\.emacs" load x fboundp x-paste-text substitute-key-definition calc-x-paste-text equal "-f" "calc" "full" run-hooks calc-mode-hook calc-refresh calc-set-mode-line boundp message "Evaluating calc-defs..." calc-need-macros eval progn calc-check-defines] 26))

(defun calc-check-defines nil (byte-code "!U !! 8?  AA P   qI @#8!AA/  )T \")" [plist nil symbol-plist calc-define copy-sequence 1 calc-extensions calc-need-macros "*Calculator*" put eval calc-check-defines setplist] 11))

(setq calc-check-defines (quote calc-check-defines))

(defun calc-trail-mode (&optional buf) "\
Calc Trail mode.
This mode is used by the *Calc Trail* buffer, which records all results
obtained by the GNU Emacs Calculator.

Calculator commands beginning with the `t' key are used to manipulate
the Trail.

This buffer uses the same key map as the *Calculator* buffer; calculator
commands given here will actually operate on the *Calculator* stack." (interactive) (byte-code "Ȉ !͉Ήĉĉ!!/ ! UE 	
&)!" [calc-mode-map major-mode mode-name truncate-lines t buffer-read-only buf calc-main-buffer nil calc-version calc-installed-date fundamental-mode use-local-map calc-trail-mode "Calc Trail" make-local-variable overlay-arrow-position overlay-arrow-string buffer-size 0 insert "Emacs Calculator v" " by Dave Gillespie, " "installed " "
" run-hooks calc-trail-mode-hook] 13))

(defun calc-create-buffer nil (byte-code "!q=  	]
  '  #" [major-mode max-lisp-eval-depth calc-always-load-extensions calc-language calc-language-option t get-buffer-create "*Calculator*" calc-mode 1000 calc-extensions calc-set-language] 8))

(defun calc (&optional arg full-display interactive) "\
The Emacs Calculator.  Full documentation is listed under \"calc-mode\"." (interactive "P") (byte-code ". =+  !U!   #+ !U+  (!<   !q
=H  (p =^ ?^ h p\" p!v p!! ! 	 !  
 
!#V   

! E

!##

p\"
! p!) q   U \")!!!	!	! \"t\"!!Ɖ)" [arg nil major-mode oldbuf calc-was-keypad-mode full-display t calc-full-mode calc-was-split calc-window-hook w pop-up-windows window-min-height calc-window-height calc-display-trail calc-said-hello interactive 0 calc-extensions prefix-numeric-value -1 calc-grab-region region-beginning region-end -2 calc-keypad get-buffer-window "*Calc Keypad*" window-buffer selected-window calc-mode calc-quit calc-create-buffer switch-to-buffer select-window boundp run-hooks get-largest-window window-height + 2 one-window-p split-window - set-window-buffer pop-to-buffer calc-trail-buffer window-width screen-width calc-trail-display 1 message "Welcome to the GNU Emacs Calculator!  Press `?' or `h' for help, `q' to quit." calc-start-hook windowp window-point calc-check-defines sit-for ""] 45))

(defun full-calc nil "\
Invoke the Calculator and give it a full-sized window." (interactive) (byte-code "t#" [nil t calc] 4))

(defun calc-same-interface (arg) "\
Invoke the Calculator using the most recent interface (calc or calc-keypad)." (interactive "P") (byte-code "ň \"  V  ; =\" 	!; =-  ; 
6  ; 	#" [major-mode arg calc-was-keypad-mode calc-full-mode t nil equal buffer-name "*Gnuplot Trail*" recursion-depth 0 exit-recursive-edit calc-edit-mode calc-edit-finish MacEdit-mode MacEdit-finish-edit calc-keypad calc] 11))

(defun calc-quit (&optional non-fatal) (interactive) (byte-code " 	? ! \"  V   =,   =7   tD D pH=M ! =U  !\"pp!!
	 !	 	! SW 	! U !? 	!Z 
\" !
!!!
 
!+" [calc-standalone-flag non-fatal nil major-mode calc-embedded-info calc-undo-list calc-redo-list calc-local-var-list buf win kbuf calc-window-height calc-was-split calc-trail-buffer save-buffers-kill-emacs equal buffer-name "*Gnuplot Trail*" recursion-depth 0 exit-recursive-edit calc-edit-mode calc-edit-cancel MacEdit-mode MacEdit-cancel-edit calc-embedded calc-mode calc-create-buffer run-hooks calc-end-hook mapcar (lambda (v) (byte-code "J\"" [v set-default] 3)) get-buffer-window get-buffer "*Calc Keypad*" delete-windows-on window-height screen-height window-width screen-width 2 calc-delete-windows-keep bury-buffer] 28))

(defun quick-calc nil "\
Do a quick calculation in the minibuffer without invoking full Calculator." (interactive) (byte-code " " [nil calc-do-quick-calc] 2))

(defun calc-eval (str &optional separator &rest args) "\
Do a quick calculation and return the result as a string.
Return value will either be the formatted result in string form,
or a list containing a character position and an error message in string form." (byte-code "	
#" [str separator args calc-do-calc-eval] 4))

(defun calc-keypad nil "\
Invoke the Calculator in \"visual keypad\" mode.
This is most useful in the X window system.
In this mode, click on the Calc \"buttons\" using the left mouse button.
Or, position the cursor manually and do M-x calc-keypad-press." (interactive) (byte-code " t\"" [calc-full-mode nil calc-extensions calc-do-keypad] 4))

(defun full-calc-keypad nil "\
Invoke the Calculator in full-screen \"visual keypad\" mode.
See calc-keypad for details." (interactive) (byte-code " t\"" [t nil calc-extensions calc-do-keypad] 4))

(defun calc-do (do-body &optional do-slow) (byte-code "  
?     Ղ  ]׉؎ۏ)+!" [calc-command-flags nil calc-start-time calc-timing gc-cons-threshold calc-aborted-prefix calc-old-aborted-prefix calc-internal-prec calc-date-format end-time time major-mode calc-final-point-line calc-final-point-column calc-inverse-flag calc-hyperbolic-flag calc-keep-args-flag calc-embedded-info calc-check-defines calc-extensions current-time-string 2000000 100000 "" ((byte-code "		 	\"
D  
\"% Ղ4 !\"
!\"\"\"C \",>U 	=U  >~ 	=p 
!!~  
!!)>  ŉ)> !!   " [calc-old-aborted-prefix calc-aborted-prefix calc-start-time calc-internal-prec calc-date-format nil end-time time calc-command-flags major-mode calc-final-point-line calc-final-point-column calc-inverse-flag calc-hyperbolic-flag calc-keep-args-flag calc-embedded-info calc-record "<Aborted>" 12 current-time-string equal 0 math-sub calcFunc-unixtime math-parse-date math-lessp 1 "(t)" no-align calc-trail-mode calc-align-stack-window position-point calc-mode goto-line move-to-column calc-select-buffer keep-flags do-edit switch-to-buffer get-buffer-create "*Calc Edit*" calc-set-mode-line calc-embedded-finish-command] 22)) err (byte-code "
    	=   
!+ + !!!ǉ>>  >I !)" [calc-embedded-info calc-algebraic-mode calc-alg-map do-slow calc-display-working-message do-body calc-aborted-prefix nil calc-command-flags calc-embedded-select-buffer calc-select-buffer total calc-extensions use-local-map message "Working..." calc-set-command-flag clear-message funcall renum-stack calc-renumber-stack ""] 10) ((error (byte-code "@= 8; 8\" !' @A\"" [err calc-aborted-prefix nil error 1 string-match "max-specpdl-size\\|max-lisp-eval-depth" "Computation got stuck or ran too long.  Type `M' to increase the limit." signal] 5))) identity] 6))

(setq calc-aborted-prefix nil)

(setq calc-start-time nil)

(defun calc-set-command-flag (f) (byte-code "	>? 	B" [f calc-command-flags] 2))

(defun calc-select-buffer nil (byte-code "=  	 	q  !
 
q !)" [major-mode calc-main-buffer buf calc-mode get-buffer "*Calculator*" error "Calculator buffer not available"] 3))

(defun calc-cursor-stack-index (&optional index) (byte-code "db
 ![!" [index forward-line calc-substack-height 1] 3))

(defun calc-stack-size nil (byte-code "G	Z" [calc-stack calc-stack-top] 2))

(defun calc-substack-height (n) (byte-code "
\\V 	& 	@8\\S	A
 *" [sum stack calc-stack n calc-stack-top 0 1] 4))

(defun calc-set-mode-line nil (byte-code " 	@	8   GV&  O\"1  O2 !!=E X N X W X 	a b 
=m  
!| 
\" 
=  =    ? 炴 =  @ = A B = C D = E \"F = G H =I J =K L U TM U/N TO U>P TQ UMR TS \"_T `?j炃U =yV !!W PX =Y 
!炝Z 
\"[ =\\ 
\"] =Y 
!^ _ 
\"` =Y 
!a b 
\"?c \"5d =#e \" f 52g \"5h !Fi \"RORj [^k l =mm ?v炳n =o p =q r =s t =u 炿v w x !x  y z  V{ | \"} ~   % &灂 \"6 7灄 \"&& \"Oe    !e  +)" [fmt calc-float-format figs new-mode-string calc-embedded-info calc-internal-prec calc-angle-mode calc-algebraic-mode calc-incomplete-algebraic-mode calc-symbolic-mode calc-matrix-mode t calc-complex-mode calc-prefer-frac calc-infinite-mode calc-simplify-mode calc-word-size calc-number-radix calc-leading-zeros calc-language calc-display-just calc-display-origin calc-line-breaking calc-assoc-selections calc-mode-save-mode calc-auto-recompute calc-display-dirty calc-inverse-flag calc-hyperbolic-flag calc-keep-args-flag calc-stack-top calc-other-modes mode-line-buffer-identification nil calc-select-buffer 1 format "Calc%s%s: %d %s %-14s" "Embed" "" buffer-name 12 equal 0 "*Calculator*" capitalize symbol-name concat total "Alg* " "Alg " "Alg[( " "Symb " matrix "Matrix " integerp "Matrix%d " scalar "Scalar " polar "Polar " "Frac " "+Inf " "Inf " none "NoSimp " num "NumSimp " binary "BinSimp%d " alg "AlgSimp " ext "ExtSimp " units "UnitSimp " 10 2 "Bin " 8 "Oct " 16 "Hex " "Radix%d " "Zero " tex "TeX " " " float zerop "Norm%d " fix "Fix%d " sci "Sci " "Sci%d " eng "Eng " "Eng%d " "Left%d " right "Right%d " "Right " "Center%d " "Center " "Wid%d " "Wide " "Break " save "Save " local "Local " edit "LocEdit " perm "LocPerm " global "Global " "Manual " fboundp calc-gnuplot-alive "Graph " calc-stack-size calc-top sel "Sel " "Dirty " "Inv " "Hyp " "Keep " /= "Narrow " apply set-buffer-modified-p buffer-modified-p calc-embedded-mode-line-change] 63))

(defun calc-align-stack-window nil (byte-code "=2 p!	 !	!Z!	`\")!!/ !Sb9   )" [major-mode win calc-mode get-buffer-window calc-cursor-stack-index 0 vertical-motion 2 window-height set-window-start looking-at " *\\.$" match-end calc-select-buffer calc-align-stack-window] 11))

(defun calc-check-stack (n) (byte-code " V
 !W !" [n calc-stack-size error "Too few elements on stack" 0 "Invalid argument"] 4))

(defun calc-push-list (vals &optional m sels) (byte-code "x 	 
#l  @@E
\" \\
- S!VM Z\"S\"B\"T B	!\")D!!+)AA  " [vals calc-executing-macro m sels val entry mm calc-stack-top calc-stack buffer-read-only nil calc-push-list-in-macro calc-select-buffer 1 calc-cursor-stack-index setcdr nthcdr 2 insert math-format-stack-value "
" calc-record-undo push calc-set-command-flag renum-stack] 13))

(defun calc-pop-push-list (n vals &optional m sels) (byte-code " 	? 
# 
	#	#" [calc-any-selections sels n vals m calc-replace-selections calc-pop-stack calc-push-list] 6))

(defun calc-pop-push-record-list (n prefix vals &optional m sels) (byte-code ": @! @:! ! C	 	C
* #!C A> \"C @\"
	$" [vals sels n m prefix integerp calc-check-stack + 1 -1 calc-record-list calc-record calc-pop-push-list] 10))

(defun calc-enter-result (n prefix vals &optional m) (byte-code "	
: 
@! 
@: 
\"$ 
!
:4 
@!4 
@:; 
C
\"F É	
$ " [calc-aborted-prefix prefix vals nil n m integerp mapcar calc-normalize equal ((nil)) calc-pop-push-record-list calc-handle-whys] 10))

(defun calc-normalize (val) (byte-code "> 	!  	!" [calc-simplify-mode val (nil none num) math-normalize calc-extensions calc-normalize-fancy] 4))

(defun calc-handle-whys nil (byte-code "  " [calc-next-why calc-do-handle-whys] 2))

(defun calc-pop-stack (&optional n m sel-ok) (byte-code " ̉	 ̉
 	\\& ?& 	\"+  8 \" 	#E! V| 	S!`
	#!`
\")Z\"#\"\" !\"`d\")!))" [n m calc-keep-args-flag mm calc-stack-top calc-any-selections sel-ok calc-executing-macro buffer-read-only nil bot calc-stack 1 calc-top-selected calc-sel-error calc-pop-stack-in-macro calc-record-undo pop calc-top-list full calc-select-buffer calc-cursor-stack-index + -1 delete-region setcdr nthcdr 2 calc-set-command-flag renum-stack] 19))

(defun calc-get-stack-element (x) (byte-code "=
 	9 = 	89 	8?% =% 
?- 	@9 6  9 	8" [sel-mode x calc-use-selections t entry sel 2 full calc-sel-error] 3))

(defun calc-top (&optional n sel-mode) (byte-code " É!	#
8!" [n calc-stack-top calc-stack 1 calc-check-stack calc-get-stack-element + -1] 6))

(defun calc-top-n (&optional n sel-mode) (byte-code "	\"!!" [n sel-mode math-check-complete calc-normalize calc-top] 5))

(defun calc-top-list (&optional n m sel-mode) (byte-code " Ɖ	 Ɖ	#!V9 	#\"!S
\"\"
\"!)" [n m top calc-stack-top calc-stack nil 1 calc-check-stack + -1 0 copy-sequence nthcdr setcdr nreverse mapcar calc-get-stack-element] 11))

(defun calc-top-list-n (&optional n m sel-mode) (byte-code "	
#\"\"" [n m sel-mode mapcar math-check-complete calc-normalize calc-top-list] 8))

(defun calc-renumber-stack nil (byte-code " !\"#:  #6  !c) !# !	Vi 	\"@8\\ c ܂d #c 	!		@8z  ܂ 	GZ\"#) 	TA; +)
  " [calc-line-numbering lnum buffer-read-only nil stack calc-stack-top calc-stack t calc-use-selections prefix calc-embedded-info calc-cursor-stack-index 0 1 nthcdr re-search-forward "^[0-9]+[:*]" beginning-of-line delete-char 4 "    " re-search-backward 999 format "%03d%s" % 1000 2 "*" ":" int-to-string insert make-string 3 32 calc-embedded-stack-change] 20))

(defun calc-refresh (&optional align) (interactive) (byte-code "È={ 	?{ ` !	É
 cJ eb!@!\"A+  V !
d d !l t  v b!- =? Hq!)T" [major-mode calc-executing-macro buffer-read-only nil save-point save-mark save-aligned thing calc-stack calc-any-selections calc-any-evaltos calc-display-dirty calc-auto-recompute align calc-embedded-info calc-refresh-count calc-mode mark looking-at "\\.$" erase-buffer "--- Emacs Calculator Mode ---
" forward-line 1 insert math-format-stack-value "
" calc-renumber-stack calc-do (lambda nil (byte-code "" [calc-display-dirty nil] 2)) (lambda nil (byte-code " " [calc-refresh-evaltos] 2)) calc-align-stack-window set-mark calc-refresh] 14))

(defun calc-x-paste-text (arg) "\
Move point to mouse position and insert window system cut buffer contents.
If mouse is pressed in Calc window, push cut buffer contents onto the stack." (byte-code "!	> ! !" [arg major-mode x-mouse-select (calc-mode calc-trail-mode) calc-do (lambda nil (byte-code "  !!	!=( !	!=( 	8\"	#*" [buf val calc-extensions x-get-cut-buffer math-read-exprs calc-clean-newlines car-safe error "%s in yanked data" 2 calc-enter-result 0 "Xynk"] 12)) x-paste-text] 4))

(defun calc-check-trail-aligned nil (byte-code "p! dS\"))" [win get-buffer-window pos-visible-in-window-p] 4))

(defun calc-trail-buffer nil (byte-code "?	 !?0 !
=? !! pq
=. 	!)): !=J q! )" [calc-trail-buffer buf major-mode calc-trail-pointer buffer-name get-buffer-create "*Calc Trail*" calc-mode get-buffer "*Calculator*" calc-trail-mode marker-buffer goto-line 2 point-marker] 9))

(defun calc-record (val &optional prefix) (byte-code "
 p 	/ 	;\" 	, 
	\")0 q db?K cm GVY #g O\"m \"c\"!  >?  dSb)*)-	" [calc-aborted-prefix nil calc-executing-macro mainbuf buf calc-display-raw calc-can-abbrev-vectors t fval val calc-float-format calc-full-float-format aligned buffer-read-only prefix win calc-command-flags calc-trail-buffer math-format-flat-expr 0 "" calc-check-trail-aligned "     " 4 string-match " " insert format "%4s " "
" get-buffer-window hold-trail calc-trail-here] 10))

(defun calc-trail-display (flag &optional no-refresh) (interactive "P") (byte-code "ň !
 
> ?G ?D !$ - !@  \"\"#\")!R R !!)" [win calc-display-trail flag calc-trail-window-hook w nil t calc-trail-buffer get-buffer-window (nil 0) boundp run-hooks split-window / * window-width 2 3 set-window-buffer calc-do (lambda nil (byte-code "	 t    " [overlay-arrow-string calc-trail-overlay overlay-arrow-position calc-trail-pointer no-refresh calc-do-refresh calc-refresh] 3)) delete-window (lambda nil (byte-code " t    " [no-refresh calc-do-refresh calc-refresh] 3))] 13))

(defun calc-trail-here nil (interactive) (byte-code "=~  o ! m !o\" m+ { `p#``\\\"P!p!z !\"!!Z!`\"\\\"q)) !" [major-mode overlay-arrow-position nil calc-trail-pointer calc-trail-overlay overlay-arrow-string win calc-main-buffer calc-trail-mode beginning-of-line forward-line 1 -1 set-marker buffer-substring 4 ">" forward-char get-buffer-window / window-height 2 set-window-start set-window-point error "Not in Calc Trail buffer"] 17))

(defun calc-record-undo (rec) (byte-code "\" 	> 
@B
AB\" C
Bŉ!" [calc-executing-macro calc-command-flags calc-undo-list rec calc-redo-list nil undo calc-set-command-flag] 2))

(defun calc-binary-op (name func arg &optional ident unary func2) (byte-code "	
? 	 !\"B#'  	
%" [calc-aborted-prefix name arg func2 func ident unary calc-enter-result 2 mapcar math-check-complete calc-top-list calc-extensions calc-binary-op-fancy] 10))

(defun calc-unary-op (name func arg &optional func2) (byte-code "	
? 	 !!D##  	
#" [calc-aborted-prefix name arg func2 func calc-enter-result 1 math-check-complete calc-top calc-extensions calc-unary-op-fancy] 8))

(defun calc-plus (arg) (interactive "P") (byte-code "\"" [nil calc-do (lambda nil (byte-code "&" [arg nil calc-binary-op "+" calcFunc-add 0 +] 7)) 33930] 3))

(defun calc-minus (arg) (interactive "P") (byte-code "\"" [nil calc-do (lambda nil (byte-code "&" [arg calc-binary-op "-" calcFunc-sub 0 neg -] 7)) 34104] 3))

(defun calc-times (arg) (interactive "P") (byte-code "\"" [nil calc-do (lambda nil (byte-code "&" [arg nil calc-binary-op "*" calcFunc-mul 1 *] 7)) 34279] 3))

(defun calc-divide (arg) (interactive "P") (byte-code "\"" [nil calc-do (lambda nil (byte-code "&" [arg calc-binary-op "/" calcFunc-div 0 calcFunc-inv /] 7)) 34454] 3))

(defun calc-change-sign (arg) (interactive "P") (byte-code "!" [nil calc-do (lambda nil (byte-code "#" [arg calc-unary-op "chs" neg] 4))] 2))

(defun calc-enter (n) (interactive "p") (byte-code "!" [nil calc-do (lambda nil (byte-code "W [\"!$ U  !!$ !!" [n t 0 calc-push-list calc-top-list 1 calc-stack-size] 8))] 2))

(defun calc-pop (n) (interactive "P") (byte-code "!" [nil calc-do (lambda nil (byte-code "	!	? !	?* 
!=* 
G
8=( ͂) VE 
!GZ\"\"C)\" Wg T [\"^ [!d [# Uv  #  U \" ! !*" [nn n top tt nil calc-any-selections t prefix-numeric-value calc-top 1 car-safe incomplete intv 3 2 calc-pop-push-list copy-sequence setcdr nthcdr 0 calc-top-selected calc-delete-selection calc-pop-stack calc-stack-size] 16))] 2))

(defun calcDigit-start nil (interactive) (byte-code "!" [nil calc-do (lambda nil (byte-code " 	V 
=  u 
ŉp	H
ҎI#)J !;X !f f !!C!=s   ." [calc-algebraic-mode calc-number-radix last-command-char unread-command-char calc-aborted-prefix nil calc-digit-value calc-prev-char calc-prev-prev-char calc-buffer old-esc global-map buf calc-digit-map 14 101 calc-alg-digit-entry 27 ((byte-code "	I" [global-map old-esc 27] 3)) read-from-minibuffer "Calc: " "" math-read-number calc-alg-entry calc-push-list calc-record calc-normalize dots calc-extensions calc-dots] 10))] 2))

(defun calcDigit-nondigit nil (interactive) (byte-code "Ɉ! ! q	!))
?$  V0  !R >O =C YK L  " [minibuffer-local-map str calc-digit-value calc-buffer last-command-char prefix-arg current-prefix-arg unread-command-char last-input-char nil boundp use-local-map buffer-string math-read-number buffer-size 0 beep calc-temp-minibuffer-message " [Bad format]" (32 13) 27 128 exit-minibuffer] 9))

(defun calc-minibuffer-contains (rex) (byte-code "eb!)" [rex looking-at] 2))

(defun calcDigit-key nil (interactive) (byte-code "db>  V h\"* >* !?* !?2  +!j >C cj >M !?U cj >` cj =j 	!c!t =y c! = c! = c> ! = ! = ! !>eb# #?  !? #! !!!cdb+=>!'!'!'!/ ;!?8cc+=H!?!Z!Z!b !yt\"cv !?cc+@ !cҁA !B C D E !F E !\"!E YG XH >I !!W))ebJ !)K >L \"c+	==M  N  +O ! P Q !
" [last-command-char calc-number-radix nil t calc-previous-modulo radix dig calc-hms-format this-command last-command calc-prev-prev-char calc-prev-char (43 45) buffer-size 0 /= 101 (109 115) calc-minibuffer-contains "[-+]?[0-9]+\\.?0*[@oh].*" "[-+]?\\(1[1-9]\\|[2-9][0-9]\\)#.*" calcDigit-nondigit "\\([-+]?\\|.* \\)\\'" (46 64) "0" (111 104 109) ".*#.*" (58 101) "1" 35 int-to-string "\\([-+]?[0-9]+#\\|[^:]*:\\)\\'" 58 "[-+]?[0-9]+#\\'" 46 "[-+]?0*\\([2-9]\\|1[0-4]\\)#\\'" (104 111 109 115 112) "[-+]?\\(1[5-9]\\|[2-9][0-9]\\)#.*" 110 "[-+]?\\(2[4-9]\\|[3-9][0-9]\\)#.*" upcase (95 110) search-forward " +/- " "e" beep looking-at "+" delete-char 1 "-" 112 ".*\\+/-.*" ".*mod.*" ".*[-+e:]\\'" ".* \\'" " " "+/- " 77 "[-+]?\\(2[3-9]\\|[3-9][0-9]\\)#.*" ".*mod *[^ ]+" ".*mod \\'" math-format-flat-expr "mod " char-to-string "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\([0-9][0-9]?\\)#[0-9a-zA-Z]*\\(:[0-9a-zA-Z]*\\(:[0-9a-zA-Z]*\\)?\\|.[0-9a-zA-Z]*\\(e[-+]?[0-9]*\\)?\\)?\\'" string-to-int buffer-substring match-beginning 2 match-end 36 (35 58 46 101 43 45) math-read-radix-digit "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\([0-9]+\\.?0*[@oh] *\\)?\\([0-9]+\\.?0*['m] *\\)?[0-9]*\\(\\.?[0-9]*\\(e[-+]?[0-3]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?\\)?\\|[0-9]:\\([0-9]+:\\)?[0-9]*\\)?[\"s]?\\'" (64 111 104 39 109) string-match calc-extensions calc-digit-dots delete-backward-char calc-temp-minibuffer-message " [Bad format]"] 56))

(defun calcDigit-backspace nil (interactive) (byte-code "Èdb! !7 ! !7 !) !7 =4  7 ! UE Љ " [last-command t last-command-char nil calc-minibuffer-contains ".* \\+/- \\'" backward-delete-char 5 ".* mod \\'" ".* \\'" 2 calcDigit-start erase-buffer 1 buffer-size 0 13 calcDigit-nondigit] 11))

(defun math-normalize (a) (byte-code ":?& !\" Y X ! # S@= GS8=Z !
AT 
@=P 
? 	\"*AAAf  AAy 88\"\\ A 8 ̂S@= GS8= !
A 
@= 
 	\"*AAA  AA 88\"\\[ A 8[ ̂S@= 8!8\"S@>@!@:@@=?& !S1 1 SA\"ߏR@:M R@B)" [a last digs nil t calc-simplify-mode args integerp 1000000 -1000000 math-bignum bigpos 0 copy-sequence setcdr 1 * 2 1000 bigneg float math-make-float math-normalize (frac cplx polar hms date mod sdev intv vec var quote special-const calcFunc-if calcFunc-lambda calcFunc-quote calcFunc-condition calcFunc-evalto) lambda calc-extensions math-normalize-fancy math-normalize-nonstandard mapcar err (byte-code "	@\"
- 
=    	@\"- 	@BA$b = A\"b 	@:Y 	@!Y ?Y  Y 	@!b 	@\")" [func a var-EvalRules math-eval-rules-cache-tag math-eval-rules-cache-other math-eval-rules-cache args nil calc-extensions-loaded assq ((+ . math-add) (- . math-sub) (* . math-mul) (/ . math-div) (% . math-mod) (^ . math-pow) (neg . math-neg) (| . math-concat)) calc-extensions math-recompile-eval-rules math-apply-rewrites apply fboundp] 12) ((wrong-number-of-arguments (byte-code "@	B\"" [a args nil calc-record-why "*Wrong number of arguments"] 4)) (wrong-type-argument (byte-code " 	@
B\"Ç" [calc-next-why a args nil calc-record-why "Wrong type of argument"] 4)) (args-out-of-range (byte-code "@	B\"" [a args nil calc-record-why "*Argument out of range"] 4)) (inexact-result (byte-code "@	B\"" [a args nil calc-record-why "No exact representation for result"] 4)) (math-overflow (byte-code "@	B\"" [a args nil calc-record-why "*Floating-point overflow occurred"] 4)) (math-underflow (byte-code "@	B\"" [a args nil calc-record-why "*Floating-point underflow occurred"] 4)) (void-variable (byte-code "8= @B! 8\"" [err var-EvalRules nil a args 1 math-normalize calc-record-why "*Variable is void"] 5))) math-dimension-error] 19))

(defun math-floatp (a) (byte-code "!= @ !>3 8!0 8!0 @=0 8!@ !=@ 8!" [a t car-safe float (cplx polar mod sdev intv) math-floatp 1 2 intv 3 date] 9))

(defun math-check-complete (a) (byte-code "!
 $ != !$ :! $ !" [a t integerp car-safe incomplete calc-incomplete-error error "Invalid data object encountered"] 5))

(defun math-bignum (a) (byte-code "Y !B [!B" [a 0 bigpos math-bignum-big bigneg] 4))

(defun math-bignum-big (a) (byte-code "U
  \"\"!B" [a nil 0 % 1000 math-bignum-big /] 6))

(defun math-make-float (mant exp) (byte-code "=
 ǂ 
!Z	W  	\"	Z):k A@\"Ug @UG A\\4 @\"U^ !TH @B!) \"U \"Tk X !#X \" Y !#Y \" E" [mant ldiff calc-internal-prec exp digs nil 0 (float 0 0) math-numdigs math-scale-rounding % 10 3 math-div10-bignum math-normalize / -4000000 + -1 signal math-underflow 3000000 4000000 math-overflow float] 17))

(defun math-div10-bignum (a) (byte-code "A @\"8\"\"\\A!B\" @\"C" [a / 10 * % 1 100 math-div10-bignum] 7))

(defun math-float (a) (byte-code ":?
 @> \"H @=( 8!8\"H @=3 H @>E @A\"BH !" [a t (bigpos bigneg) math-make-float 0 frac math-div math-float 1 2 float (cplx polar vec hms date sdev mod) mapcar math-float-fancy] 7))

(defun math-neg (a) (byte-code ":? [r @= ABr @=' ABr @>] @8:R 8@=I 8ABO 8ABV 8[8Er @>o @A\"Br !" [a t bigpos bigneg (frac float) 1 2 (cplx vec hms date calcFunc-idn) mapcar math-neg math-neg-fancy] 4))

(defun math-numdigs (a) (byte-code ":4 A0 GS	8	\"
Y  ǂ+ 
Y* ɂ+ \\*1 ǂ{ YE \"!\\{ YO ΂{ YY ς{ Uc ǂ{ Vm ς{ Vw ΂{ [!" [a len top t * 3 100 0 10 -1 -2 math-numdigs / 1000 2 1 -10 -100] 5))

(defun math-scale-int (a n) (byte-code "U
 	 V 	\" 	[\"!" [n a t 0 math-scale-left math-normalize math-scale-right] 5))

(defun math-scale-left (a n) (byte-code "U
 	| 	: 	@	A\"B| YA 	Y) 	X5 	!\"> 	\"Z\"| Uc 	YP 	X\\ 	!\"` 	\"| 	Yl 	Xx 	!\"| 	\"" [n a 0 math-scale-left-bignum 3 1000 -1000 math-scale-left math-bignum * 2 10000 -10000 100 100000 -100000 1 10] 13))

(defun math-scale-left-bignum (a n) (byte-code "Y 	BZY Ĉ V2 	U, ǂ- #3 	" [n a 3 0 nil math-mul-bignum-digit 2 100 10] 4))

(defun math-scale-right (a n) (byte-code "U
 	o 	: 	@	A\"Bo 	X3 	U* 0 	[\"[o YS 	\"VK ZYS Ȉ9 Ua 	\"o Un 	\"o 	" [n a 0 math-scale-right-bignum math-scale-right 3 / 1000 nil 2 100 1 10] 7))

(defun math-scale-right-bignum (a n) (byte-code "Y \"	\"\"V. 	U' ɂ( #A/ 	" [n a 3 nthcdr / % 0 math-mul-bignum-digit 2 10 100] 7))

(defun math-scale-rounding (a n) (byte-code "Y 	\" 	:} 	@W% 	AZ\"E U4 	A#E UC 	A#E 	A
N 
@Yu 
Aq 
A@=f 
A\"n 
A@T
AABr ҂w 
A)B! 	W 	[\"[ U 	\\\" 	Z\"\\\"" [n a val t 0 math-scale-left math-normalize -3 math-scale-right-bignum -2 math-mul-bignum-digit 10 -1 100 500 999 math-add-bignum (1) (1) math-scale-rounding / 5 math-scale-right] 13))

(defun math-add (a b) (byte-code ": 	:?$ 	\\X Y# !$ :I @>?F @=C 8=F !L =r !=?r !h 	:?h 	@>q 	!r 		: 	@>? 	@= 	8= 	! 	= 	!=? 	! :? @> ! :? @>	:? 	@>:? @>w	:? 	@>w:!	:	!@=G	@=&A	A\"BD	AA\"
=?A	A\"BB
B)!w	@=oA	A\"
=g	AA\"Bj
B)!wA	A\"B:?@>	:?	@> 	\":?@>	:?	@>:@=!	:	@=	!	\" 	\" 	\"" [a b diff -1000000 1000000 math-bignum (bigpos bigneg) float 1 0 math-zerop car-safe mod math-floatp (bigpos bigneg frac) math-float (bigpos bigneg) (bigpos bigneg frac) (bigpos bigneg frac float cplx polar hms date sdev intv mod vec) (bigpos bigneg frac float cplx polar hms date sdev intv mod vec) (bigpos bigneg) (bigpos bigneg) bigneg math-add-bignum math-normalize math-sub-bignum neg bigpos (bigpos bigneg frac) (bigpos bigneg frac) calc-extensions calc-add-fractions (bigpos bigneg frac float) (bigpos bigneg frac float) math-add-float math-add-objects-fancy math-add-symb-fancy] 30))

(defun math-add-bignum (a b) (byte-code " 	 !
 	h ? 
@	@\\W6 
T\"ĉ< 
\\\"\\ 
@	@\\WR 
\"\\ 
\\\"Ɖ
A	A  	{ 	\"\" 
@= 
\"
A{ 
 

@T\" \" 	 	\" ,  	" [a b aa carry nil sum t copy-sequence 999 setcar -999 1000 -1000 nconc math-add-bignum (1) 0 (1)] 13))

(defun math-sub-bignum (a b) (byte-code " 	 	!	
 n B 
@@ZY8 
S\"ĉ? 
\\\"b 
@@ZYW 
\"b 
\\\"ǉ
AA  
@= 
\"
As 
 

@S\"	 ΂ @= A  ΂ 	, @= A  ΂ 	" [b a aa borrow nil sum diff t copy-sequence 1 setcar 999 0 1000 neg] 10))

(defun math-add-float (a b) (byte-code "	8
8ZY9 \\Y 	6 
8=+ 	81 	8\"\"
8\"X [\\YH 
X 	8
8\"\"	8\")" [ediff a b calc-internal-prec 2 0 math-make-float math-add 1 math-scale-left] 9))

(defun math-sub (a b) (byte-code ": 	: 	!\", 	ZX\" Y+ !, " [a b math-add math-neg -1000000 1000000 math-bignum] 4))

(defun math-sub-float (a b) (byte-code "	8
8ZY\\ \\Y 	Y 
8:> 
8@=5 
8AB; 
8ABB 
8[=N 	8T 	8\"\"
8\" [\\Yk 
 	8
8\": 
8\"@= 
8\"AB 
8\"AB 
8\"[\"	8\")" [ediff a b calc-internal-prec 2 0 math-make-float math-add 1 bigpos bigneg math-scale-left] 13))

(defun math-mul (a b) (byte-code ":?( 	:?( W( V( 	W( 	V( 	\":M @>?J @=G 8=J !P = 	!=? 	:?f 	@> 	!y :?y @> !   	\"	: 	@>? 	@= 	8= 	! 	= !=? :? @> ! 	:? 	@> 	! 	  	\":? @>	:?	@>:?@>w	:?&	@>w:3!	:>	!@	@=LۂMAAm	AAbA	A\"jA	8#u	A8#B!:?@>	:?	@> 	\":?@>	:?	@>:@=!	:	@=	!8	8\"8	8\\\" 	\" 	\"" [a b 1000 -1000 * (bigpos bigneg) float 1 0 math-zerop car-safe mod (bigpos bigneg frac float cplx polar hms) math-floatp (bigpos bigneg frac) math-float calc-extensions math-mul-zero (bigpos bigneg) (bigpos bigneg frac float cplx polar hms) (bigpos bigneg frac) (bigpos bigneg frac float cplx polar hms date sdev intv mod vec) (bigpos bigneg frac float cplx polar hms date sdev intv mod vec) (bigpos bigneg) (bigpos bigneg) math-bignum math-normalize bigpos bigneg math-mul-bignum math-mul-bignum-digit (bigpos bigneg frac) (bigpos bigneg frac) calc-mul-fractions (bigpos bigneg frac float) (bigpos bigneg frac float) math-make-float math-mul 2 math-mul-objects-fancy math-mul-symb-fancy] 31))

(defun math-infinitep (a &optional undir) (byte-code ":	 @>- @=? 8!$ 8) 8  :S @=S 8>S 	K 8=R ʂS " [a undir (* / neg) * math-infinitep 1 2 var (var-inf var-uinf var-nan) var-inf (var uinf var-uinf)] 4))

(defun math-mul-bignum (a b) (byte-code " 	 	@X! 	@U C !' 	@#
	A AH C\"	@@@\"\\\\\"\"A \"A C\"V Y A A\"A@\\\" \"C\"7 
." [a b sum sump c d aa ss prod 1 0 copy-sequence math-mul-bignum-digit nil setcdr setcar % * 1000 /] 16))

(defun math-mul-bignum-digit (a d c) (byte-code "S 	X 	U P !

@	\"\\\"\"
A> 
A\" YM 
\"C\"+[ V[ C" [a d aa prod c 1 copy-sequence nil setcar % * 1000 / setcdr 0] 10))

(defun math-idivmod (a b) (byte-code "=
 	\"	: :p ! W5 	A\"	@
@B!
AB)m 	:? 	!:J !	AA\"	@@=_ ̂` 
@B!	@
AB!B)y 	\"	\"B" [b a res 0 math-reject-arg "*Division by zero" natnump 1000 math-div-bignum-digit math-normalize math-bignum math-div-bignum bigpos bigneg / %] 14))

(defun math-quotient (a b) (byte-code ":?	 	:?  	U \" 	\" 	!) 	WG 	U9 \"D @A	\"@B! :Q !	:\\ 	!GS	GSS	A8T\"A#	A#
$@	@= т @B!," [a b alen blen d res 0 math-reject-arg "*Division by zero" / natnump 1000 math-normalize math-div-bignum-digit math-bignum math-div-bignum-big math-mul-bignum-digit bigpos bigneg] 16))

(defun math-div-bignum (a b) (byte-code "A: 
GGS8T\"
##	$U- 6 @A\"@B,G 
@\"@ACB)" [b alen a blen d res / 1000 math-div-bignum-big math-mul-bignum-digit 0 1 math-div-bignum-digit] 8))

(defun math-div-bignum-digit (a b) (byte-code "# A
\"	A\"@\\
\"	@B
\"B*$ ɇ" [a res b num math-div-bignum-digit * 1000 / % (nil . 0)] 7))

(defun math-div-bignum-big (a b alen blen) (byte-code "	W B/ AS	$@AB	#@@BAB+" [alen blen nil a res b num res2 math-div-bignum-big math-div-bignum-part] 5))

(defun math-div-bignum-part (a b blen) (byte-code "	
8 \"	S
8 \\	S8\"^
#$+" [num blen a den b guess * 0 1000 / 999 math-div-bignum-try math-mul-bignum-digit] 9))

(defun math-div-bignum-try (a b c guess) (byte-code "	
\"= 	
\"S$ B)" [rem a c b guess math-sub-bignum neg math-div-bignum-try] 7))

(defun math-div (a b) (byte-code ":\" @>? @= 8= !% =1  1 	\"z	:V 	@>?S 	@=P 	8=S 	!Y 	= !=? :?o @> ! 	:? 	@> 	! 	  	\"z	:? 	@>n:? @>n	:? 	@> :? @> 	\"
A= 
@   	\" 	\"\"\")n	:?	@>:?@> 	\"n	:?*	@>b:?7@>b	:C	@=K	!:U@=]!	\"n n	\"z z	\"" [b a q calc-prefer-frac (bigpos bigneg) float 1 0 math-zerop calc-extensions math-div-by-zero (bigpos bigneg) car-safe mod (bigpos bigneg frac float cplx polar hms) math-floatp (bigpos bigneg frac) math-float math-div-zero (bigpos bigneg frac float cplx polar hms date sdev intv mod vec) (bigpos bigneg frac float cplx polar hms date sdev intv mod vec) (bigpos bigneg) (bigpos bigneg) math-idivmod math-make-frac math-div-float math-make-float (bigpos bigneg frac) (bigpos bigneg frac) calc-div-fractions (bigpos bigneg frac float) (bigpos bigneg frac float) math-div-objects-fancy math-div-symb-fancy] 26))

(defun math-div-float (a b) (byte-code "	T
8!8!ZZ]
8\"8\"
88ZZ\")" [ldiff calc-internal-prec a b math-numdigs 1 0 math-make-float math-quotient math-scale-int 2] 9))

(defun math-format-stack-value (entry) (byte-code "	@8
? ӂe =\" 
\"e 
;+ 
e 
=5 ׂe ? e 
:?I 
@>U 	>U ?^ 
!e  
\"!
y ǉ
A
@

V 
\"\"\" 
= G\" \" 	=    \"\" 
=  !G#]\"%;!\"+\"	==PMMIIA!\"." [calc-selection-cache-entry calc-selection-cache-default-entry a entry math-comp-selected c calc-display-raw t calc-prepared-composition calc-language off s w calc-any-selections calc-left-label calc-line-numbering calc-right-label calc-language-output-filter 2 "<nil>" format "%s" top-of-stack "." (bigpos bigneg frac float cplx polar hms) (nil flat unform) math-format-number calc-extensions math-compose-expr 0 math-stack-value-offset nil math-comp-concat make-string 32 equal "" big (tag t "1:  ") "1:  " "    " list horiz - math-comp-width (break -1) prin1-to-string math-composition-to-string funcall "
" 49 1 58 setcar calc-count-lines] 24))

(defun math-stack-value-offset (c) (byte-code "	 Ȃ	     .   ɉ!. GZ]
\\B+" [num calc-line-numbering wid off calc-display-just calc-display-origin calc-line-breaking calc-left-label 4 0 calc-window-width nil calc-extensions math-stack-value-offset-fancy integerp] 7))

(defun calc-count-lines (s) (byte-code "# 
T	T 	*" [pos num newpos s 0 1 string-match "
"] 4))

(defun math-format-value (a &optional w) (byte-code ":?
 @> 	> !&  \"\")" [a calc-language calc-line-breaking nil w (bigpos bigneg frac float cplx polar hms) (nil flat unform) math-format-number calc-extensions math-composition-to-string math-compose-expr 0] 6))

(defun calc-window-width nil (byte-code " H!	 	!  S)* p!!
( ǂ) Z" [calc-embedded-info win calc-line-numbering get-buffer-window 0 window-width screen-width 5 1] 7))

(defun math-comp-concat (c1 c2) (byte-code "; 	; 	P 	E" [c1 c2 horiz] 3))

(defun math-format-flat-expr (a prec) (byte-code ": !? 	= !P)X :?' @>P @GV9 ҂: 
	!.X  \"" [a calc-display-raw t print-escape-newlines calc-group-digits nil calc-point-char calc-frac-format calc-complex-format calc-hms-format calc-language prec integerp "'" prin1-to-string (bigpos bigneg frac float cplx polar hms) "." 1 ("::" nil) (":" nil) "%s@ %s' %s\"" math-format-number calc-extensions math-format-flat-expr-fancy] 8))

(defun math-format-number (a &optional prec) (byte-code "= 
\"=8 
:? 
@>+  
!!=
! 6 ? UG 
! 
WV 
[!P   | Uu 
!x 
!# U 
! 
!# 
! 
!!=
; 
=
:? 
!=
@= 
A!=
@= 
A!P=
@= U3
8: 
8@= 
8W
!!P0
8
8@8
	=CW5[C
	!\\[V	
\\\"		!_	!d	A!GXGZT\"PV[O[OQP!+W\\V	!ZW	\"	
Z
)	!	!	A!G
\\=,\\X,\\YUBQ
XMVeOOQ
V|
\"Q[\"R!*
\\=\\\"TGVGZ\"PGWOOQ!@ >A VB C D Z#**.= E 
\"" [calc-display-raw t a calc-frac-format calc-group-digits calc-leading-zeros calc-number-radix math-radix-explicit-format calc-radix-formatter mant exp fmt calc-float-format figs point calc-point-char str calc-internal-prec adj len dpos calc-display-sci-high calc-display-sci-low eadj scale calc-language prec format "%s" 1 (bigpos bigneg) calc-extensions math-format-number math-adjust-fraction integerp 10 int-to-string 0 "-" funcall 2 math-format-binary math-format-radix "%d#%s" math-bignum prin1-to-string bigpos math-format-bignum bigneg float math-neg nil fix math-numdigs math-scale-rounding math-format-bignum-decimal make-string 48 math-group-float "0" eng math-mod 300002 3 (math maple) 191 "(%s*10.^%d)" "%s*10.^%d" "%se%d" math-format-number-fancy] 45))

(defun math-format-bignum (a) (byte-code "U 	? 
? !  !" [calc-number-radix calc-leading-zeros calc-group-digits a 10 math-format-bignum-decimal calc-extensions math-format-bignum-fancy] 4))

(defun math-format-bignum-decimal (a) (byte-code ": AA$ 8\"@\\\"	PAA 8. \"@\\!	P); ʇ" [a s "" format "%06d" * 1 1000 int-to-string 0 "0"] 6))

(defun math-read-number (s) (byte-code "\"@ \"
= 	GV 	H=* 	P!< 	GX7 	!< 	!B)k\"U \"\"P!k\"z \"!v H=s v !)k\"  !k\" \"\"GGV ! V !   V V \"\"[E***k\"j\"\"	GV!	G	H>X&	!	e	e:?@@>e	Ve	We!88	\\E)**k!" [s digs calc-language val int frac ilen flen mant exp t nil math-normalize string-match "\\` *\\([0-9]+\\) *\\'" math-match-substring 1 c 0 48 math-read-number "8#" 6 string-to-int bigpos math-read-bignum "\\`\\(.*\\)[ 	
]+\\([^]\\)*\\'" 2 "^[-_+]\\(.*\\)$" 43 math-neg "[^-+0-9eE.]" calc-extensions math-read-number-fancy "^\\([0-9]*\\)\\.\\([0-9]*\\)$" float math-add math-scale-int "^\\(.*\\)[eE]\\([-+]?[0-9]+\\)$" (43 45) 8 7 (bigpos bigneg frac float) -4000000 4000000 math-float] 34))

(defun math-match-substring (s n) (byte-code "! 	!!O ć" [n s match-beginning match-end ""] 6))

(defun math-read-bignum (s) (byte-code "GV O!O!B !C" [s 3 string-to-int -3 nil math-read-bignum 0] 6))

(defconst math-tex-ignore-words (quote (("\\hbox") ("\\mbox") ("\\text") ("\\left") ("\\right") ("\\,") ("\\>") ("\\:") ("\\;") ("\\!") ("\\ ") ("\\quad") ("\\qquad") ("\\hfil") ("\\hfill") ("\\displaystyle") ("\\textstyle") ("\\dsize") ("\\tsize") ("\\scriptstyle") ("\\scriptscriptstyle") ("\\ssize") ("\\sssize") ("\\rm") ("\\bf") ("\\it") ("\\sl") ("\\roman") ("\\bold") ("\\italic") ("\\slanted") ("\\cal") ("\\mit") ("\\Cal") ("\\Bbb") ("\\frak") ("\\goth") ("\\evalto") ("\\matrix" mat) ("\\bmatrix" mat) ("\\pmatrix" mat) ("\\cr" punc ";") ("\\\\" punc ";") ("\\*" punc "*") ("\\{" punc "[") ("\\}" punc "]"))))

(defconst math-eqn-ignore-words (quote (("roman") ("bold") ("italic") ("mark") ("lineup") ("evalto") ("left" ("floor") ("ceil")) ("right" ("floor") ("ceil")) ("arc" ("sin") ("cos") ("tan") ("sinh") ("cosh") ("tanh")) ("size" n) ("font" n) ("fwd" n) ("back" n) ("up" n) ("down" n) ("above" punc ","))))

(defconst math-standard-opers (quote (("_" calcFunc-subscr 1200 1201) ("%" calcFunc-percent 1100 -1) ("u+" ident -1 1000) ("u-" neg -1 1000 197) ("u!" calcFunc-lnot -1 1000) ("mod" mod 400 400 185) ("+/-" sdev 300 300 185) ("!!" calcFunc-dfact 210 -1) ("!" calcFunc-fact 210 -1) ("^" ^ 201 200) ("**" ^ 201 200) ("*" * 196 195) ("2x" * 196 195) ("/" / 190 191) ("%" % 190 191) ("\\" calcFunc-idiv 190 191) ("+" + 180 181) ("-" - 180 181) ("|" | 170 171) ("<" calcFunc-lt 160 161) (">" calcFunc-gt 160 161) ("<=" calcFunc-leq 160 161) (">=" calcFunc-geq 160 161) ("=" calcFunc-eq 160 161) ("==" calcFunc-eq 160 161) ("!=" calcFunc-neq 160 161) ("&&" calcFunc-land 110 111) ("||" calcFunc-lor 100 101) ("?" (math-read-if) 91 90) ("!!!" calcFunc-pnot -1 85) ("&&&" calcFunc-pand 80 81) ("|||" calcFunc-por 75 76) (":=" calcFunc-assign 51 50) ("::" calcFunc-condition 45 46) ("=>" calcFunc-evalto 40 41) ("=>" calcFunc-evalto 40 -1))))

(setq math-expr-opers math-standard-opers)

(defun calc-grab-region (top bot arg) "\
Parse the region as a vector of numbers and push it on the Calculator stack." (interactive "r
P") (byte-code "È 	
#" [top bot arg nil calc-extensions calc-do-grab-region] 5))

(defun calc-grab-rectangle (top bot arg) "\
Parse a rectangle as a matrix of numbers and push it on the Calculator stack." (interactive "r
P") (byte-code "È 	
#" [top bot arg nil calc-extensions calc-do-grab-rectangle] 5))

(defun calc-grab-sum-down (top bot arg) "\
Parse a rectangle as a matrix of numbers and sum its columns." (interactive "r
P") (byte-code "È 	
$" [top bot arg nil calc-extensions calc-do-grab-rectangle calcFunc-reduced] 6))

(defun calc-grab-sum-across (top bot arg) "\
Parse a rectangle as a matrix of numbers and sum its rows." (interactive "r
P") (byte-code "È 	
$" [top bot arg nil calc-extensions calc-do-grab-rectangle calcFunc-reducea] 6))

(defun calc-embedded (arg &optional end obeg oend) "\
Start Calc Embedded mode on the formula surrounding point." (interactive "P") (byte-code "Ĉ 	
$" [arg end obeg oend nil calc-extensions calc-do-embedded] 6))

(defun calc-embedded-activate (&optional arg cbuf) "\
Scan the current editing buffer for all embedded := and => formulas.
Also looks for the equivalent TeX words, \\gets and \\evalto." (interactive "P") (byte-code "	\"" [arg cbuf nil calc-do-embedded-activate] 3))

(defun calc-user-invocation nil (interactive) (byte-code ";
 !\"" [calc-invocation-macro nil error "Use `Z I' inside Calc to define a `M-# Z' keyboard macro" execute-kbd-macro] 4))

(defmacro defmath (func args &rest body) (byte-code " 	
#" [func args body calc-extensions math-do-defmath] 5))

(if calc-always-load-extensions (progn (calc-extensions) (calc-load-everything)))

(run-hooks (quote calc-load-hook))
