Index of /CTAN/macros/generic/xint

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[TXT]CHANGES.html2019-09-10 18:04 92K 
[   ]CHANGES.pdf2019-09-10 18:04 103K 
[   ]Makefile2016-02-29 08:54 655  
[   ]sourcexint.pdf2019-09-10 18:04 907K 
[   ]xint.dtx2019-09-10 18:03 1.5M 
[   ]xint.pdf2019-09-10 18:04 970K 



xint 1.3f


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

This README is also available as README.pdf and README.html.

Change log is to be found in CHANGES.pdf or CHANGES.html.

The user manual is xint.pdf, and the commented source code is available as sourcexint.pdf.


The basic aim is provide expandable computations on integers, fractions, and floating point numbers. For example

\xinttheexpr reduce(37189719/183618963+11390170/17310720)^17\relax

will evaluate exactly the fraction; the result has 462 characters (including the fraction slash.) One can also work with dummy variables:

\xinttheexpr mul(add(x(x+1)(x+2), x=y..y+15), y=171286,98762,9296)\relax

evaluates to 15979066346135829902328007959448563667099190784.

Float computations are possible at an adjustable precision (default 16).

\xintDigits:=48;\xintthefloatexpr 123_456_789^1_000.5\relax

(as this example shows the underscore character can be used to separate visually digits, one can also use the space character for that purpose).

Square-root and the four operations achieve correct rounding in the given arbitrary precision.

Trigonometric functions (direct and inverse) are available with a maximal precision of 60 digits.

Logarithms and exponentials are available using the poormanlog package which provides only 8 or 9 digits of precision. This will be increased in future.


It is possible to use the package both with Plain (\input xintexpr.sty) or with LaTeX (\usepackage{xintexpr}).

With LaTeX

\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

The xinttrig and xintlog packages are loaded automatically by xintexpr and will refuse to be loaded directly.

Further packages: xintbinhex, xintgcd, xintseries and xintcfrac.

Main dependencies are handled automatically. For example xintexpr automatically loads xinttools and xintfrac (which itself loads xint). Hexadecimal input requires explicit loading of xintbinhex.

Package xintcore is the subset of xint providing only the five operations on big integers: \xintiiAdd, \xintiiMul, …

The LaTeX package bnumexpr 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 xintcore but this can be customized.

The LaTeX package polexpr is based upon xintexpr and allows formal algebra with polynomials, and finding all real roots with arbitrary precision.

With TeX

One does for example:

\input xintexpr.sty

This will automatically load xintfrac.sty, xinttrig.sty, xintlog.sty and xinttools.sty. The packages may be loaded in any catcode context such that letters, digits, \ and % have their standard catcodes.

xintcore.sty and xinttools.sty both import xintkernel.sty which has the catcode handler and package identifier and defines a few utilities such as \oodef/\fdef, \xint_dothis/\xint_orthat, or \xintLength.

Since 1.3b, xintkernel.sty also provides \xintUniformDeviate which is a wrapper of the engine \pdfuniformdeviate or \uniformdeviate done to guarantee more uniformity of the pseudo-random integers.


Method A: using the package manager of your TeX distribution

xint is included in TeXLive (hence also MacTeX) and MikTeX.

There can be a few days of delay between apparition of a new version on CTAN and availability via the distribution package manager.

Method B: manual installation using and unzip

Assumes a GNU/Linux-like system (or Mac OS X).

  1. obtain from CTAN:

  2. cd to the download repertory and issue:

     unzip -d <TEXMF>

    where <TEXMF> is a suitable TDS-compliant destination repertory. For example, with TeXLive:

Method C: manual installation using Makefile and xint.dtx

The Makefile automatizes rebuilding from xint.dtx all documentation files as well as It is for GNU/Linux-like (inc. Mac OS X) systems, with a teTeX like installation such as TeXLive. The Latexmk and Pandoc softwares are required to build all the documentation.

  1. obtain xint.dtx and Makefile from

  2. put them in an otherwise empty working repertory, run make or equivalently make help for further instructions.

Method D: installation starting with only xint.dtx

Run etex xint.dtx to extract from xint.dtx all macro files as well as auxiliary files needed for building the documentation. Among them there is If you are on a GNU/Linux-type system, rename the file to Makefile and execute make on command line for further help. If you can’t use make read the contents of the Makefile for instructions.

Finishing the installation in a TDS hierarchy:

Depending on the destination, it may then be necessary to refresh a filename database.


Copyright (C) 2013-2019 by Jean-Francois Burnol

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

and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later.

This Work has the LPPL maintenance status author-maintained.

The Author of this Work is Jean-Francois Burnol.

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.html, README.pdf,, CHANGES.html, CHANGES.pdf, pandoctpl.latex,,, xint.dvi, xint.pdf, and