CTAN Comprehensive TeX Archive Network

CTAN Update: xint

Date: February 2, 2020 2:40:55 PM CET
Jean-François Burnol submitted an update to the xint package. Version: 1.4 2020-01-31 License: lppl1.3c Summary description: Expandable operations on long numbers Announcement text:
This is a major release with some breaking changes. Selected highlights: - The \expanded primitive (TeXLive 2019) is required. Its usage has allowed dropping formerly used \csname techniques. There is no more impact on the string pool memory. - Square brackets [...] are now associated with actual nested structures. For example \xinteval{1, [2, [3, 4]], 5} produces 1, [2, [3, 4]], 5 (recall this is free bloatware). - Scalar operations on one-dimensional "lists" (which as it turned out matched the NumPy "broadcasting" concept) are provisorily dropped. Alternative syntax exists to rescue old documents. - Operations on nested lists are inspired from NumPy's. Currently, nested (basic) slicing and indexing is implemented. But the step parameters are not. The broadcasting of scalar operations is not yet implemented but the user can define "universal functions", i.e. functions operating on all leaves of the data. Our structures have leaves at arbitrary varying depths, they are not necessarily hyperrectangular like NumPy's. Constructors are provided, for example ndmap() maps a function on all Cartesian n-uples built from items (at top level) of n given lists. - Variables in function declarations may be multi-letter words. - The last positional variable name may be prefixed with a * as in Python to signal it is a "nut-ple" receiving all arguments of the function calls beyond the first positional ones ("variadic" argument). Generally speaking, * is the unpacking operator. - ... quite a few more features. See CHANGES.html and xint.pdf.
The package’s Catalogue entry can be viewed at https://ctan.org/pkg/xint The package’s files themselves can be inspected at http://mirror.ctan.org/macros/generic/xint/
Thanks for the upload. For the CTAN Team Petra Rübe-Pugliese
CTAN is run entirely by volunteers and supported by TeX user groups. Please join a user group or donate to one, see https://ctan.org/lugs

xint – Expandable arbitrary precision floating point and integer operations

Loading xintexpr provides \xinteval and \xintfloateval.

\xintfloateval evaluates numerical expressions. The floating point precision defaults to 16 decimal digits and can be set by user. Trigonometry, exponential and logarithms are implemented up to a maximal precision of 62 decimal digits.

\xinteval computes exactly with integers, fractions, and decimal numbers or numbers in scientific notation. Note though that multiplying two floating point numbers will about double the number of digits, and so on, because the algebra is done exactly.

Both are compatible with expansion-only context.

Loading xintexpr imports automatically various other modules that it depends upon. Among them:

  • xinttools: utilities such as expandable and non-expandable loops,
  • xint: macros implementing in particular the basic operations on arbitrarily long integers,
  • xintbinhex: conversions between decimal and binary, octal, or hexadecimal bases for arbitrarily long integers,
  • xintfrac: macros implementing in particular the basic operations on arbitrarily large fractions, decimal numbers, or numbers in scientific notation.

Further modules of independent interest include xintgcd, xintseries and xintcfrac.

You can use xintexpr (and the other components) with (via \usepackage) or also with Plain , Op, or Cont (via \input xintexpr.sty).

All the components are documented in the file xint.pdf, which also contains the commented source code.

Packagexint
Version1.4o 2025-09-06
Copyright2013–2022, 2025 Jean-François Burnol
MaintainerJean-François Burnol

Announcements

more

Guest Book Sitemap Contact Contact Author