| 1 |
| Source: bnumexpr.dtx |
| 2 |
| Version: v1.7b, 2025/09/27 |
| 3 |
| Author: Jean-François Burnol |
| 4 |
| Info: Expressions with big integers |
| 5 |
| License: LPPL 1.3c |
| 6 |
|
| 7 |
Usage and aim |
| 8 |
============= |
| 9 |
|
| 10 |
The package provides `\bnumeval`. |
| 11 |
|
| 12 |
To use with LaTeX, add `\usepackage{bnumexpr}` to the preamble. |
| 13 |
To use with Plain TeX, execute `\input miniltx.tex` then |
| 14 |
`\input bnumexpr.sty`. |
| 15 |
|
| 16 |
`\bnumeval` is an expandable expression parser extending |
| 17 |
LaTeX's `\inteval` (a wrapper of eTeX's `\numexpr`). |
| 18 |
|
| 19 |
Compared to `\inteval`, the added functionalities are: |
| 20 |
|
| 21 |
- support for arbitrarily big integers, |
| 22 |
- `//` for floored division, |
| 23 |
- `/:` for the associated remainder, |
| 24 |
- `^` and `**` for powers, |
| 25 |
- `!` for factorials, |
| 26 |
- comma separated calculations, |
| 27 |
- space character or underscore may serve to separate digits, |
| 28 |
- `0b`, `0o` and `0x` are recognized as prefixes for binary, octal, |
| 29 |
and hexadecimal inputs (in addition to the TeX prefixes `'` and `"`), |
| 30 |
- letters used for hexadecimal input may be in lowercase, |
| 31 |
- optional argument `[b]`, `[o]` or `[h]` for converting the output |
| 32 |
to binary, octal, or hexadecimal (`[ha]` for lowercase hexadecimal), |
| 33 |
- quasi complete customizability and extensibility of the syntax. |
| 34 |
|
| 35 |
The last item means that not only is it possible to map any given |
| 36 |
operation to a macro of one's own choosing, it is also possible to add |
| 37 |
new infix or postfix operators to the syntax. |
| 38 |
|
| 39 |
Installation |
| 40 |
============ |
| 41 |
|
| 42 |
The package is provided by the major LaTeX distributions. |
| 43 |
|
| 44 |
For a manual installation obtain `bnumexpr.dtx`, from CTAN: |
| 45 |
|
| 46 |
> <http://www.ctan.org/pkg/bnumexpr> |
| 47 |
|
| 48 |
Run `"etex bnumexpr.dtx"` to extract in particular the style file |
| 49 |
`bnumexpr.sty` (and other files inclusive of this `README.md`). Put it |
| 50 |
where (La)TeX can find it and you are done. |
| 51 |
|
| 52 |
To build the documentation check the instructions in extracted |
| 53 |
file `bnumexpr.tex`. |
| 54 |
|
| 55 |
License |
| 56 |
======= |
| 57 |
|
| 58 |
Copyright © 2014-2022, 2025 Jean-François Burnol |
| 59 |
|
| 60 |
| This Work may be distributed and/or modified under the |
| 61 |
| conditions of the LaTeX Project Public License 1.3c. |
| 62 |
| This version of this license is in |
| 63 |
|
| 64 |
> <http://www.latex-project.org/lppl/lppl-1-3c.txt> |
| 65 |
|
| 66 |
| and version 1.3 or later is part of all distributions of |
| 67 |
| LaTeX version 2005/12/01 or later. |
| 68 |
|
| 69 |
This Work has the LPPL maintenance status "author-maintained". |
| 70 |
|
| 71 |
The Author and Maintainer of this Work is Jean-François Burnol. |
| 72 |
|
| 73 |
This Work consists of the main source file and its derived files |
| 74 |
|
| 75 |
bnumexpr.dtx, bnumexpr.sty, bnumexpr.pdf, bnumexpr.tex, |
| 76 |
bnumexprchanges.tex, README.md |
| 77 |
|