summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-02-06 23:37:59 +0000
committerKarl Berry <karl@freefriends.org>2017-02-06 23:37:59 +0000
commiteb1b06cb07745cb30557b035fa78e1bd90c5df9a (patch)
treef0a02b3460ecca0eefc41756ef5a5b6eeb294fee /Master/texmf-dist/doc
parent3b82837a4c3eea1141abcab4c26823c64a671fe1 (diff)
longdivision (6feb17)
git-svn-id: svn://tug.org/texlive/trunk@43159 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc')
-rw-r--r--Master/texmf-dist/doc/latex/longdivision/README22
-rw-r--r--Master/texmf-dist/doc/latex/longdivision/longdivision_example.pdfbin0 -> 25806 bytes
-rw-r--r--Master/texmf-dist/doc/latex/longdivision/longdivision_example.tex40
3 files changed, 62 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/longdivision/README b/Master/texmf-dist/doc/latex/longdivision/README
new file mode 100644
index 00000000000..912b22da786
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/longdivision/README
@@ -0,0 +1,22 @@
+Package: longdivision.sty version 1.0
+Author: Hood Chatham
+Email: hood@mit.edu
+Date: 2017-02-05
+Files:
+ longdivision.sty
+ longdivision_example.tex
+ longdivision_example.pdf
+ README
+
+License: All files have the Latex Project Public License.
+
+
+Does long division. The dividend must be a positive decimal number and the divisor must be a positive integer. Correctly handles repeating decimals, putting a bar over the repeated part of the decimal. Handles dividends up to 20 digits long gracefully (though the typeset result will take up about a page) and dividends between 20 and 60 digits long slightly less gracefully.
+
+Defines macros \longdivision and \intlongdivision. Each takes two arguments, a dividend and divisor. \longdivision keeps dividing until the remainder is zero, or it encounters a repeated remainder. \longdivision stops when the dividend stops (though the dividend doesn't have to be an integer).
+
+\longdivision also has an optional argument "max_extra_digits". If max_extra_digits is 0, the behavior is like \intlongdivision, whereas if max_extra_digits is greater than 60, the behavior is the same as \longdivision without the optional argument. In general, \longdivision won't add more than "max_extra_digits" It might be prudent to use this optional argument if you are computing, say, 1/97 which has a 96 digit period (\longdivision will stop anyways to avoid overfull boxes, but the result might not be ideal).
+
+\intlongdivision behaves similarly to the \longdiv command defined in longdiv.tex, though I think \intlongdivision looks better, and it can handle much larger dividends and divisors (the dividend is only constrained by the size of the page, and the divisor can be up to 8 digits long).
+
+Please email me if you discover any bugs or have any feature requests. \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/longdivision/longdivision_example.pdf b/Master/texmf-dist/doc/latex/longdivision/longdivision_example.pdf
new file mode 100644
index 00000000000..4a86843526f
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/longdivision/longdivision_example.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/longdivision/longdivision_example.tex b/Master/texmf-dist/doc/latex/longdivision/longdivision_example.tex
new file mode 100644
index 00000000000..ee092c84150
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/longdivision/longdivision_example.tex
@@ -0,0 +1,40 @@
+\documentclass{article}
+\usepackage{longdivision}
+
+\begin{document}
+
+\longdivision{72344}{7}
+%
+\qquad\qquad\qquad
+%
+\longdivision[2]{72344}{7}
+%
+\qquad\qquad\qquad
+%
+\intlongdivision{72344}{7}
+
+\vskip 50pt
+
+\longdivision{.1}{7} \qquad\qquad\qquad \longdivision{000.1}{7}
+%
+\qquad\qquad\qquad
+%
+\intlongdivision{1}{7} % Warning : no_division_occurred
+
+
+\longdivision[20]{1}{49}
+
+\longdivision{1}{49} % Warning : work_stopped_early
+
+\longdivision[20]{1}{97}
+
+\longdivision{1}{97} % Warning : work_stopped_early & division_stopped_early
+
+\longdivision{ 2 147 483.647 }{ 91 474 837 } % Warning : work_stopped_early & division_stopped_early
+
+% \longdivision{1..5}{7} % Error: dividend_invalid
+% \longdivision{2147483.647}{214748367} % Error : divisor_too_large
+% \longdivision{6}{1.5} % Error: divisor_not_int
+% \longdivision{6}{15a} % Error: divisor_invalid
+
+\end{document} \ No newline at end of file