1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<meta name="author" content="xint 1.2p" />
<title>README</title>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
body{margin-left : 10%; margin-right : 15%; margin-top: 4ex; font-size: 12pt;}
pre {white-space: pre-wrap; }
code {white-space: pre-wrap; }
.mono {font-family: monospace;}
</style>
</head>
<body>
<div id="header">
<h1 class="title">README</h1>
<h2 class="author">xint 1.2p</h2>
<h3 class="date">2017/12/05</h3>
</div>
<div id="TOC">
<ul>
<li><a href="#aim">Aim</a></li>
<li><a href="#usage">Usage</a><ul>
<li><a href="#with-latex">With LaTeX</a></li>
<li><a href="#with-tex">With TeX</a></li>
</ul></li>
<li><a href="#installation">Installation</a><ul>
<li><a href="#method-a-using-the-package-manager-of-your-tex-distribution">Method A: using the package manager of your TeX distribution</a></li>
<li><a href="#method-b-manual-installation-using-xint.tds.zip-and-unzip">Method B: manual installation using <code>xint.tds.zip</code> and <code>unzip</code></a></li>
<li><a href="#method-c-manual-installation-using-makefile-and-xint.dtx">Method C: manual installation using <code>Makefile</code> and <code>xint.dtx</code></a></li>
<li><a href="#method-d-installation-starting-with-only-xint.dtx">Method D: installation starting with only <code>xint.dtx</code></a></li>
</ul></li>
<li><a href="#license">License</a></li>
</ul>
</div>
<pre><code>Source: xint.dtx 1.2p 2017/12/05 (doc 2017/12/05)
Author: Jean-Francois Burnol
Info: Expandable operations on big integers, decimals, fractions
License: LPPL 1.3c</code></pre>
<p>This <code>README</code> is also available as <code>README.pdf</code> and <code>README.html</code>.</p>
<p>Change log is to be found in <code>CHANGES.pdf</code> or <code>CHANGES.html</code>.</p>
<p>The user manual is <code>xint.pdf</code>, and the commented source code is available as <code>sourcexint.pdf</code>.</p>
<h1 id="aim">Aim</h1>
<p>The basic aim is provide <em>expandable</em> computations on integers, fractions, and floating point numbers. For example</p>
<pre><code>\xinttheexpr reduce(37189719/183618963+11390170/17310720)^17\relax</code></pre>
<p>will evaluate exactly the fraction; the result has 462 characters (including the fraction slash.) One can also work with dummy variables:</p>
<pre><code>\xinttheexpr mul(add(x(x+1)(x+2), x=y..y+15), y=171286,98762,9296)\relax</code></pre>
<p>evaluates to <code>15979066346135829902328007959448563667099190784</code>.</p>
<p>Float computations are possible at an adjustable precision (default 16).</p>
<pre><code>\xintDigits:=48;\xintthefloatexpr 123_456_789^1_000.5\relax
->3.63692761822782679930738270515740797370813691938e8095</code></pre>
<p>But currently, only integer and half-integer exponents are allowed for the power operation in expressions and only the square-root operation is implemented besides the four arithmetic operations. Square-root and the four operations achieve correct rounding in the given arbitrary precision.</p>
<p>Sub-units <code>xintcore</code>, <code>xint</code> and <code>xintfrac</code> provide the underlying macros, and <code>xintexpr</code> loads all of them and provides expandable parsers allowing computations such as the above (and more).</p>
<h1 id="usage">Usage</h1>
<p>It is possible to use the package with Plain (via <code>\input</code> anywhere) or with LaTeX (via <code>\usepackage</code> in the preamble).</p>
<h2 id="with-latex">With LaTeX</h2>
<pre><code>\usepackage{xint} % expandable arithmetic with big integers
\usepackage{xintfrac} % decimal numbers, fractions, floats
\usepackage{xintexpr} % expressions with infix operators</code></pre>
<p>Further packages: <code>xintbinhex</code>, <code>xintgcd</code>, <code>xintseries</code> and <code>xintcfrac</code>.</p>
<p>Main dependencies are handled automatically. For example <code>xintexpr</code> automatically loads <code>xintfrac</code> which itself loads <code>xint</code>; but use of the <code>gcd</code> and <code>lcm</code> functions in expressions require explicit loading of <code>xintgcd</code>, and hexadecimal notation requires explicit loading of <code>xintbinhex</code>.</p>
<p>Package <code>xintcore</code> is the subset of <code>xint</code> providing only the five operations on big integers: <code>\xintiiAdd</code>, <code>\xintiiMul</code>, ... It is (by default) loaded by the (LaTeX only) package <a href="http://www.ctan.org/pkg/bnumexpr">bnumexpr</a> which provides a more light-weight expression parser handling only big integers, the four operations, the power operation and the factorial.</p>
<p>There is also <code>xinttools</code> which is a separate package providing, among others, expandable and non-expandable loops such as <code>\xintFor</code>.</p>
<h2 id="with-tex">With TeX</h2>
<p>One does for example:</p>
<pre><code>\input xintexpr.sty</code></pre>
<p>The packages may be loaded in any catcode context such that letters, digits, <code>\</code> and <code>%</code> have their standard catcodes.</p>
<p><code>xintcore.sty</code> and <code>xinttools.sty</code> both import <code>xintkernel.sty</code> which has the catcode handler and package identifier and defines a few utilities such as <code>\oodef</code>, <code>\fdef</code>, or <code>\xint_dothis/\xint_orthat</code>.</p>
<h1 id="installation">Installation</h1>
<h2 id="method-a-using-the-package-manager-of-your-tex-distribution">Method A: using the package manager of your TeX distribution</h2>
<p><code>xint</code> is included in <a href="http://tug.org/texlive/">TeXLive</a> (hence also <a href="http://tug.org/mactex/">MacTeX</a>) and <a href="http://www.miktex.org/">MikTeX</a>.</p>
<p>There can be a few days of delay between apparition of a new version on <a href="http://www.ctan.org/pkg/xint">CTAN</a> and availability via the distribution package manager.</p>
<h2 id="method-b-manual-installation-using-xint.tds.zip-and-unzip">Method B: manual installation using <code>xint.tds.zip</code> and <code>unzip</code></h2>
<p>Assumes a GNU/Linux-like system (or Mac OS X).</p>
<ol style="list-style-type: decimal">
<li><p>obtain <code>xint.tds.zip</code> from CTAN: <a href="http://mirror.ctan.org/install/macros/generic/xint.tds.zip" class="uri">http://mirror.ctan.org/install/macros/generic/xint.tds.zip</a></p></li>
<li><p>cd to the download repertory and issue:</p>
<pre><code>unzip xint.tds.zip -d <TEXMF></code></pre>
<p>where <code><TEXMF></code> is a suitable TDS-compliant destination repertory. For example, with TeXLive:</p>
<ul>
<li><p>Linux, standard access rights, hence sudo is needed, installation into the "local" tree:</p>
<pre><code>sudo unzip xint.tds.zip -d /usr/local/texlive/texmf-local
sudo texhash /usr/local/texlive/texmf-local</code></pre></li>
<li><p>Mac OS X, installation into user home folder (no sudo needed, and it is recommended to not have a ls-R file there, hence no texhash):</p>
<pre><code>unzip xint.tds.zip -d ~/Library/texmf</code></pre></li>
</ul></li>
</ol>
<h2 id="method-c-manual-installation-using-makefile-and-xint.dtx">Method C: manual installation using <code>Makefile</code> and <code>xint.dtx</code></h2>
<p>The Makefile automatizes rebuilding from <code>xint.dtx</code> all documentation files as well as <code>xint.tds.zip</code>. It is for GNU/Linux-like (inc. Mac OS X) systems, with a teTeX like installation such as TeXLive. Furthermore the <a href="http://johnmacfarlane.net/pandoc/">Pandoc</a> software is required.</p>
<ol style="list-style-type: decimal">
<li><p>obtain <code>xint.dtx</code> and <code>Makefile</code> from <a href="http://mirror.ctan.org/macros/generic/xint" class="uri">http://mirror.ctan.org/macros/generic/xint</a>.</p></li>
<li><p>put them in an otherwise empty working repertory, run <code>make</code> or equivalently <code>make help</code> for further instructions.</p></li>
</ol>
<h2 id="method-d-installation-starting-with-only-xint.dtx">Method D: installation starting with only <code>xint.dtx</code></h2>
<p>Run <code>"tex xint.dtx"</code> or <code>"etex xint.dtx"</code> to extract from <code>xint.dtx</code> all packages as well as these files:</p>
<dl>
<dt><code>README.md</code></dt>
<dd>the current README with Markdown formatting.
</dd>
<dt><code>CHANGES.md</code></dt>
<dd>the changes across successive releases.
</dd>
<dt><code>xint.tex</code></dt>
<dd>used to generate <code>xint.pdf</code> via <code>"latex xint.tex"</code> (thrice) then <code>"dvipdfmx xint.dvi"</code>. It is also possible to compile <code>xint.tex</code> with <code>xelatex</code>, or with <code>pdflatex</code> (this latter option produces a bigger pdf).
</dd>
<dd><p>For successful compilation, packages <code>newtxtt</code>, <code>newtxmath</code>, <code>etoc</code>, <code>mathastext</code> are needed. Inclusion of the source code is off by default, but the toggle can be set in <code>xint.tex</code>.</p>
</dd>
<dd><p>A third option is to generate <code>xint.pdf</code> via <code>xelatex xint.dtx</code> or <code>pdflatex xint.dtx</code>. Source code is then included by default (but some code comments in French use 8bit characters, hence for <code>xelatex</code> an a priori conversion of xint.dtx into utf-8 will give a better result).</p>
</dd>
<dt><code>Makefile.mk</code></dt>
<dd>this is for UNIX-like systems. Note: this file is only produced with <code>"etex xint.dtx"</code>, not with <code>"tex xint.dtx"</code>. Rename it to <code>Makefile</code> and run <code>make</code> on the command line for further help.
</dd>
<dt><code>doHTMLs.sh</code> and <code>doPDFs.sh</code></dt>
<dd>these are scripts (for UNIX-like systems) which can be used to convert the <code>README.md</code> and <code>CHANGES.md</code> to HTML and PDF formats. They require <a href="http://johnmacfarlane.net/pandoc/">Pandoc</a>.
</dd>
<dt><code>pandoctpl.latex</code></dt>
<dd>a Pandoc template used by <code>doPDFs.sh</code>.
</dd>
</dl>
<p>Finishing the installation in a TDS hierarchy:</p>
<ul>
<li><p>move the style files to <code>TDS:tex/generic/xint/</code></p></li>
<li><p><code>xint.dtx</code> goes to <code>TDS:source/generic/xint/</code></p></li>
<li><p>the documentation (xint.pdf, README.md,...) goes to <code>TDS:doc/generic/xint/</code></p></li>
</ul>
<p>Depending on the destination, it may then be necessary to refresh a filename database.</p>
<h1 id="license">License</h1>
<div class="mono">
<p>Copyright (C) 2013-2017 by Jean-Francois Burnol</p>
<p>This Work may be distributed and/or modified under the conditions of the LaTeX Project Public License version 1.3c. This version of this license is in</p>
<blockquote>
<p><a href="http://www.latex-project.org/lppl/lppl-1-3c.txt" class="uri">http://www.latex-project.org/lppl/lppl-1-3c.txt</a></p>
</blockquote>
<p>and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later.</p>
<p>This Work has the LPPL maintenance status <code>author-maintained</code>.</p>
<p>The Author of this Work is Jean-Francois Burnol.</p>
This Work consists of the source file xint.dtx and of its derived files: xintkernel.sty, xintcore.sty, xint.sty, xintfrac.sty, xintexpr.sty, xintbinhex.sty, xintgcd.sty, xintseries.sty, xintcfrac.sty, xinttools.sty, xint.ins, xint.tex, README, README.md, README.html, README.pdf, CHANGES.md, CHANGES.html, CHANGES.pdf, pandoctpl.latex, doHTMLs.sh, doPDFs.sh, xint.dvi, xint.pdf, Makefile.mk.
</div>
</body>
</html>
|