summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/bnumexpr/README.md
blob: a7db8bf12c861d1e7be2c445bb1ea657e204a910 (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
| Source:  bnumexpr.dtx
| Version: v1.4a, 2021/05/13 (doc: 2021/05/13)
| Author:  Jean-Francois Burnol
| Info:    Expressions with big integers
| License: LPPL 1.3c

bnumexpr usage
==============

The LaTeX package `bnumexpr` allows expandable computations with
integers and the four infix operators `+`, `-`, `*`, `/` using the
expression syntax familiar from the `\numexpr` e-TeX parser, with
these extensions:

- arbitrarily big integers,
- floored division `//`,
- associated modulo `/:`,
- power operators `^` and `**`,
- factorial post-fix operator `!`,
- comma separated expressions,
- the space character as well as the underscore may serve
  to separate groups of digits,
- optional conversion of output to hexadecimal.

The expression parser is a scaled-down variant from the
`\xintiiexpr...\relax`
parser from package [xintexpr](http://ctan.org/pkg/xintexpr).

To support hexadecimal input and output, the package
[xintbinhex](http://ctan.org/pkg/xint) is loaded automatically.

The package loads by default [xintcore](http://ctan.org/pkg/xint)
but the option _custom_ together with macro `\bnumexprsetup` allow to map
the syntax elements to macros from an alternative big integer
expandable engine of the user own choosing,
and then [xintcore](http://ctan.org/pkg/xint) is not loaded.

Installation
============

Use your installation manager to install or update `bnumexpr`.

Else, obtain `bnumexpr.dtx`, from CTAN:

> <http://www.ctan.org/pkg/bnumexpr>

Run `"etex bnumexpr.dtx"` to extract these files:

`bnumexpr.sty`
  : this is the style file.

`README.md`

`bnumexprchanges.tex`
  : change history.

`bnumexpr.tex`
  : can be used to generate the documentation:

  :  - with latex+dvipdfmx: `"latex bnumexpr.tex"` (thrice) then
      `"dvipdfmx bnumexpr.dvi"`.

  :  - with pdflatex: `"pdflatex bnumexpr.tex"` (thrice).

  : In both cases files `README.md` and `bnumexprchanges.tex` must
    be located in the same repertory as `bnumexpr.tex` and `bnumexpr.dtx`.

without `bnumexpr.tex`:
  : `"pdflatex bnumexpr.dtx"` (thrice) extracts all files and
    simultaneously generates the pdf documentation.

Finishing the installation:

           bnumexpr.sty   --> TDS:tex/latex/bnumexpr/

           bnumexpr.dtx   --> TDS:source/latex/bnumexpr/

           bnumexpr.pdf   --> TDS:doc/latex/bnumexpr/
              README.me   --> TDS:doc/latex/bnumexpr/

License
=======

Copyright (C) 2014-2021 by Jean-Francois Burnol

| This Work may be distributed and/or modified under the
| conditions of the LaTeX Project Public License 1.3c.
| This version of this license is in

>   <http://www.latex-project.org/lppl/lppl-1-3c.txt>

| 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 and Maintainer of this Work is Jean-Francois Burnol.

This Work consists of the main source file `bnumexpr.dtx`
and the derived files

    bnumexpr.sty, bnumexpr.pdf, bnumexpr.tex, bnumexprchanges.tex,
    and README.md