summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/xint/README.html
blob: cee77f4af2999b740107b7b8ea4cf4aebd8ea6bd (plain)
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="pandoc" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  <meta name="author" content="xint 1.3f" />
  <title>README</title>
  <style type="text/css">
      code{white-space: pre-wrap;}
      span.smallcaps{font-variant: small-caps;}
      span.underline{text-decoration: underline;}
      div.column{display: inline-block; vertical-align: top; width: 50%;}
  </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>
  <!--[if lt IE 9]>
    <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
  <![endif]-->
</head>
<body>
<header>
<h1 class="title">README</h1>
<p class="author">xint 1.3f</p>
<p class="date">2019/09/10</p>
</header>
<nav 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>
</nav>
<pre><code>Source:  xint.dtx 1.3f 2019/09/10 (doc 2019/09/10)
Author:  Jean-Francois Burnol
Info:    Expandable operations on big integers, decimals, fractions
License: LPPL 1.3f</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
-&gt;3.63692761822782679930738270515740797370813691938e8095</code></pre>
<p>(as this example shows the underscore character can be used to separate visually digits, one can also use the space character for that purpose).</p>
<p>Square-root and the four operations achieve correct rounding in the given arbitrary precision.</p>
<p>Trigonometric functions (direct and inverse) are available with a maximal precision of 60 digits.</p>
<p>Logarithms and exponentials are available using the <a href="http://www.ctan.org/pkg/poormanlog">poormanlog</a> package which provides only 8 or 9 digits of precision. This will be increased in future.</p>
<h1 id="usage">Usage</h1>
<p>It is possible to use the package both with Plain (<code>\input xintexpr.sty</code>) or with LaTeX (<code>\usepackage{xintexpr}</code>).</p>
<h2 id="with-latex">With LaTeX</h2>
<pre><code>\usepackage{xint}       % expandable arithmetic with big integers
\usepackage{xintfrac}   % decimal numbers, fractions, floats
\usepackage{xinttools}  % expandable and non expandable loops
\usepackage{xintexpr}   % expressions with infix operators</code></pre>
<p>The <code>xinttrig</code> and <code>xintlog</code> packages are loaded automatically by <code>xintexpr</code> and will refuse to be loaded directly.</p>
<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>xinttools</code> and <code>xintfrac</code> (which itself loads <code>xint</code>). Hexadecimal input 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>, …</p>
<p>The LaTeX package <a href="http://www.ctan.org/pkg/bnumexpr">bnumexpr</a> defines a more light-weight parser of arithmetical expressions using big integers, which supports only the four operations, the modulo operation, the power operation, and the factorial. By default it uses the macros from <code>xintcore</code> but this can be customized.</p>
<p>The LaTeX package <a href="http://www.ctan.org/pkg/polexpr">polexpr</a> is based upon <code>xintexpr</code> and allows formal algebra with polynomials, and finding all real roots with arbitrary precision.</p>
<h2 id="with-tex">With TeX</h2>
<p>One does for example:</p>
<pre><code>\input xintexpr.sty</code></pre>
<p>This will automatically load <code>xintfrac.sty</code>, <code>xinttrig.sty</code>, <code>xintlog.sty</code> and <code>xinttools.sty</code>. 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/\fdef</code>, <code>\xint_dothis/\xint_orthat</code>, or <code>\xintLength</code>.</p>
<p>Since <code>1.3b</code>, <code>xintkernel.sty</code> also provides <code>\xintUniformDeviate</code> which is a wrapper of the engine <code>\pdfuniformdeviate</code> or <code>\uniformdeviate</code> done to guarantee more uniformity of the pseudo-random integers.</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 type="1">
<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 &lt;TEXMF&gt;</code></pre>
<p>where <code>&lt;TEXMF&gt;</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. The <a href="http://personal.psu.edu/jcc8/software/latexmk/">Latexmk</a> and <a href="http://johnmacfarlane.net/pandoc/">Pandoc</a> softwares are required to build all the documentation.</p>
<ol type="1">
<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>etex xint.dtx</code> to extract from <code>xint.dtx</code> all macro files as well as auxiliary files needed for building the documentation. Among them there is <code>Makefile.mk</code>. If you are on a GNU/Linux-type system, rename the file to <code>Makefile</code> and execute <code>make</code> on command line for further help. If you can’t use <code>make</code> read the contents of the <code>Makefile</code> for instructions.</p>
<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-2019 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, xinttrig.sty, xintlog.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, and Makefile.mk.
</div>
</body>
</html>