CTAN Comprehensive TeX Archive Network

Directory macros/latex/contrib/bnumexpr

README.md

Source: bnumexpr.dtx Version: v1.7a, 2025/09/14 Author: Jean-François Burnol Info: Expressions with big integers License: LPPL 1.3c

Usage and aim

The package provides \bnumeval.

To use with , add \usepackage{bnumexpr} to the preamble. To use with Plain , execute \input miniltx.tex then \input bnumexpr.sty.

\bnumeval is an expandable expression parser extending 's \inteval (a wrapper of e's \numexpr).

Compared to \inteval, the added functionalities are:

  • support for arbitrarily big integers,
  • // for floored division,
  • /: for the associated remainder,
  • ^ and ** for powers,
  • ! for factorials,
  • comma separated calculations,
  • space character or underscore may serve to separate digits,
  • 0b, 0o and 0x are recognized as prefixes for binary, octal, and hexadecimal inputs (in addition to the prefixes ' and "),
  • letters used for hexadecimal input may be in lowercase,
  • optional argument [b], [o] or [h] for converting the output to binary, octal, or hexadecimal ([ha] for lowercase hexadecimal),
  • quasi complete customizability and extensibility of the syntax.

The last item means that not only is it possible to map any given operation to a macro of one's own choosing, it is also possible to add new infix or postfix operators to the syntax.

Installation

The package is provided by the major distributions.

For a manual installation obtain bnumexpr.dtx, from CTAN:

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

Run "etex bnumexpr.dtx" to extract in particular the style file bnumexpr.sty (and other files inclusive of this README.md). Put it where can find it and you are done.

To build the documentation check the instructions in extracted file bnumexpr.tex.

License

Copyright © 2014-2022, 2025 Jean-François Burnol

This Work may be distributed and/or modified under the conditions of the 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 version 2005/12/01 or later.

This Work has the LPPL maintenance status "author-maintained".

The Author and Maintainer of this Work is Jean-François Burnol.

This Work consists of the main source file and its derived files

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

Download the contents of this package in one zip archive (212.0k).

bnumexpr – Extends ’s \numexpr...\relax construct to big integers

The package provides the command \bnumeval, which extends 's \inteval with support for arbitrarily big integers, // for floored division, /: for the associated remainder, ^ and ** for powers, ! for factorials, 0b, 0o and ', 0x and ", as prefixes for binary, octal, or hexadecimal inputs. With the optional argument [h] (or [o] or [b]) the output is converted to hexadecimal (or octal, or binary).

Packagebnumexpr
Version1.7a 2025-09-14
LicensesThe Project Public License 1.3c
Copyright2014–2025 Jean-François Burnol
MaintainerJean-François Burnol
Contained inTeX Live as bnumexpr
MiKTeX as bnumexpr
TopicsCalculation
Arithmetic
...
Guest Book Sitemap Contact Contact Author