
(require (quote calc-ext))

(defun calc-Need-calc-frac nil (byte-code "À‡" [nil] 1))

(defun calc-fdiv (arg) (interactive "P") (byte-code "ÀˆÁÂÃ\"‡" [nil calc-do (lambda nil (byte-code "ÁÂÃÄ$‡" [arg calc-binary-op ":" calcFunc-fdiv 1] 5)) 116] 3))

(defun calc-fraction (arg) (interactive "P") (byte-code "ÀˆÁÂÃ\"‡" [nil calc-do (lambda nil (byte-code "Â ƒ	 Ã‚
 Ä	Å=ƒ  ÆÇÈÉÇ!ÉÊ!E#‚0 ÆÊÈÉÊ!Ë	†- Å!E#)‡" [func arg calc-is-hyperbolic calcFunc-frac calcFunc-pfrac 0 calc-enter-result 2 "frac" calc-top-n 1 prefix-numeric-value] 12)) 280] 3))

(defun calc-over-notation (fmt) (interactive "sFraction separator (:, ::, /, //, :/): ") (byte-code "ÀˆÁÂ!‡" [nil calc-do (lambda nil (byte-code "ÄÅ\"ƒ9 ÂÆÇÈ!ÇÉ!\"…# ÊÇÉ!ÂO!ËÉ\"‰ˆ	È=…- ÌÍ!ˆÎÏ	DÃ#)‚< ÌÐ!‡" [fmt n nil t string-match "\\`\\([^ 0-9][^ 0-9]?\\)[0-9]*\\'" /= match-end 0 1 string-to-int math-match-substring error "Bad denominator" calc-change-mode calc-frac-format "Bad fraction separator format."] 12))] 2))

(defun calc-slash-notation (n) (interactive "P") (byte-code "ÀˆÁÂ!‡" [nil calc-do (lambda nil (byte-code "ÂÃƒ
 Ä‚ ÅÁ#‡" [n t calc-change-mode calc-frac-format ("//" nil) ("/" nil)] 4))] 2))

(defun calc-frac-mode (n) (interactive "P") (byte-code "ÀˆÁÂ!‡" [nil calc-do (lambda nil (byte-code "ÄÃÁÂ$ˆÅƒ Æ‚ Ç!‡" [n nil t calc-prefer-frac calc-change-mode message "Integer division will now generate fractions." "Integer division will now generate floating-point results."] 5))] 2))

(defun math-make-frac (num den) (byte-code ":ƒ @Ã=‚ ÄW… Å	!Å!‰ˆÆ	\"
Ç=ƒ8 Ç=ƒ1 	‚5 È	E‚P É
\"ƒF Ê	
\"‚P ÈÊ	
\"Ê
\"E)‡" [den num gcd bigneg 0 math-neg math-gcd 1 frac equal math-quotient] 11))

(defun calc-add-fractions (a b) (byte-code "Â!Ã=ƒB Â	!Ã=ƒ/ ÄÅÆÇ8È	8\"ÆÈ8Ç	8\"\"ÆÈ8È	8\"\"‚? ÄÅÇ8ÆÈ8	\"\"È8\"‚R ÄÅÆÈ	8\"Ç	8\"È	8\"‡" [a b car-safe frac math-make-frac math-add math-mul 1 2] 16))

(defun calc-mul-fractions (a b) (byte-code "Â!Ã=ƒ3 Â	!Ã=ƒ% ÄÅÆ8Æ	8\"ÅÇ8Ç	8\"\"‚0 ÄÅÆ8	\"Ç8\"‚> ÄÅÆ	8\"Ç	8\"‡" [a b car-safe frac math-make-frac math-mul 1 2] 12))

(defun calc-div-fractions (a b) (byte-code "Â!Ã=ƒ3 Â	!Ã=ƒ% ÄÅÆ8Ç	8\"ÅÇ8Æ	8\"\"‚0 ÄÆ8ÅÇ8	\"\"‚> ÄÅÇ	8\"Æ	8\"‡" [a b car-safe frac math-make-frac math-mul 1 2] 12))

(defun calcFunc-frac (a &optional tol) (byte-code "† Æ‰ˆ	:?† 	@Ç>ƒ 	‚º	@È>ƒ+ 	@ÉÊ	A\"B‚º	:…< 	@Ë=…< Ì	8ÆYƒE Í	!‚º	:ƒ~ 	@Î=†{ 	@Ï=?…{ 	@Ð>ƒx Ñ	8:ƒp Ñ	8@Î=‚u Ñ	8ÆW‚{ Ò	!‚� 	ÆWƒ� ÓÔÓ	!\"!‚º	@Ë=?ƒ² Õ	!ƒ¡ 	‚¯ Ö	!ƒ« 	‚¯ ×	Ø\"‚ºÙ!ƒÙ ÆX…Ã 
\\‰ˆÔ	ËÚÛÑ	8!Ì	8\\TZE\"‚º@Ë=?ƒþ :?†ë @Ü>ƒ÷ Ô	Ý!\"‚û ×Þ\"‚º:ƒ7@Î=†4@Ï=?…4@ß>ƒ1Ñ8:ƒ)Ñ8@Î=‚.Ñ8ÆW‚4Ò!‚:ÆWƒFÔ	Ó!\"‚º:ƒh@à>?…e@Ë=ƒbÑ8Æ=‚eá!‚kÆ=ƒuÔ	Æ\"‚ºâã\"?ƒƒÍ	!‚º	:ƒ¥	@ä>?…¢	@Ë=ƒŸÑ	8Æ=‚¢á	!‚¨	Æ=ƒ¯Æ‚ºå	\"Ãæ!*‡" [tol a calc-internal-prec t cfrac calc-prefer-frac 0 (bigpos bigneg frac) (cplx polar vec hms date sdev intv mod) mapcar (lambda (x) (byte-code "Â	\"‡" [x tol calcFunc-frac] 3)) float 2 math-trunc bigneg bigpos (frac float) 1 math-negp math-neg calcFunc-frac math-infinitep math-provably-integerp math-reject-arg numberp integerp 5 math-numdigs (bigpos bigneg frac float) math-float realp (frac float) (bigpos bigneg) math-zerop math-lessp-float (float 1 0) (bigpos bigneg) math-continued-fraction math-eval-continued-fraction] 26))

(defun math-continued-fraction (a tol) (byte-code "Ê\\ÂÂÂ	?†Z :ƒ4 @Ë>?…1 @Ì=ƒ. Í8Î=‚1 Ï!‚7 Î=?…Z ÐÑÒÓ	!Ô=…P ÕÖ\"ˆ)\"!	\"?…¡ ×!Ò\"	B‰ˆ:ƒ‘ @Ø>?…Ž @Ì=ƒ‹ Í8Î=‚Ž Ï!‚” Î=†� ÙÍ\"‰ˆ‚ ˆ	,)‡" [calc-internal-prec cfrac nil aa a calc-prefer-frac int f calc-display-working-message tol 2 (bigpos bigneg) float 1 0 math-zerop math-lessp-float math-abs math-sub math-eval-continued-fraction lots math-do-working "Fractionalize" math-trunc (bigpos bigneg) math-div] 13))

(defun math-eval-continued-fraction (cf) (byte-code "	@ÄÅ	A‰…  ÆÇ	@\"
\"‰ˆ‚ ˆÈ
\"+‡" [n cf d temp 1 nil math-add math-mul math-div] 5))

(defun calcFunc-fdiv (a b) (byte-code ":?† @Â>† @Ã=… Ä8ÅYƒy 	:?†5 	@Æ>†5 	@Ã=…5 Ä	8ÅYƒr 	:ƒZ 	@Ç>?…W 	@Ã=ƒT È	8Å=‚W É	!‚] 	Å=ƒg ÊË\"‚o ÌÍ!Í	!\"‚v Ê	Î\"‚} ÊÎ\"‡" [a b (bigpos bigneg) float 2 0 (bigpos bigneg) (bigpos bigneg) 1 math-zerop math-reject-arg "*Division by zero" math-make-frac math-trunc integerp] 9))
