summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/xint
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-06-17 21:04:37 +0000
committerKarl Berry <karl@freefriends.org>2018-06-17 21:04:37 +0000
commita8356ff391b052c2df9c0e5094ad28bdc4ecc8cc (patch)
tree1d140eab26e9ec64694d88221900f07b275083c2 /Master/texmf-dist/source/generic/xint
parentfcd631537e8237c8d259af82841ded8d3a8b51b7 (diff)
xint (17jun18)
git-svn-id: svn://tug.org/texlive/trunk@48040 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/generic/xint')
-rw-r--r--Master/texmf-dist/source/generic/xint/xint.dtx4455
-rw-r--r--Master/texmf-dist/source/generic/xint/xint.ins28
2 files changed, 2597 insertions, 1886 deletions
diff --git a/Master/texmf-dist/source/generic/xint/xint.dtx b/Master/texmf-dist/source/generic/xint/xint.dtx
index c4d9d447077..95c026ff778 100644
--- a/Master/texmf-dist/source/generic/xint/xint.dtx
+++ b/Master/texmf-dist/source/generic/xint/xint.dtx
@@ -3,27 +3,27 @@
% Extract all files via "etex xint.dtx" and do "make help"
% or follow instructions from extracted README.md.
%<*dtx>
-\def\xintdtxtimestamp {Time-stamp: <18-05-2018 at 19:33:37 CEST>}
+\def\xintdtxtimestamp {Time-stamp: <17-06-2018 at 20:00:43 CEST>}
%</dtx>
%<*drv>
%% ---------------------------------------------------------------
-\def\xintdocdate {2018/05/18}
-\def\xintbndldate{2018/05/18}
-\def\xintbndlversion {1.3b}
+\def\xintdocdate {2018/06/17}
+\def\xintbndldate{2018/06/17}
+\def\xintbndlversion {1.3c}
%</drv>
%<readme>% README
%<changes>% CHANGE LOG
-%<readme|changes>% xint 1.3b
-%<readme|changes>% 2018/05/18
+%<readme|changes>% xint 1.3c
+%<readme|changes>% 2018/06/17
%<readme|changes>
-%<readme|changes> Source: xint.dtx 1.3b 2018/05/18 (doc 2018/05/18)
+%<readme|changes> Source: xint.dtx 1.3c 2018/06/17 (doc 2018/06/17)
%<readme|changes> Author: Jean-Francois Burnol
%<readme|changes> Info: Expandable operations on big integers, decimals, fractions
%<readme|changes> License: LPPL 1.3c
%<readme|changes>
-%<*!readme&!changes&!dohtmlsh&!dopdfsh&!makefile>
+%<*!readme&!changes&!dohtmlsh&!dopdfsh&!makefile&!latexmkrc&!gind>
%% ---------------------------------------------------------------
-%% The xint bundle 1.3b 2018/05/18
+%% The xint bundle 1.3c 2018/06/17
%% Copyright (C) 2013-2018 by Jean-Francois Burnol
%<xintkernel>%% xintkernel: Paraphernalia for the xint packages
%<xinttools>%% xinttools: Expandable and non-expandable utilities
@@ -36,7 +36,7 @@
%<xintseries>%% xintseries: Expandable partial sums with xint package
%<xintcfrac>%% xintcfrac: Expandable continued fractions with xint package
%% ---------------------------------------------------------------
-%</!readme&!changes&!dohtmlsh&!dopdfsh&!makefile>
+%</!readme&!changes&!dohtmlsh&!dopdfsh&!makefile&!latexmkrc&!gind>
%<*dtx>
\bgroup\catcode2 0 \catcode`\\ 12 ^^Biffalse
%</dtx>
@@ -68,46 +68,44 @@ Float computations are possible at an adjustable precision (default 16).
\xintDigits:=48;\xintthefloatexpr 123_456_789^1_000.5\relax
->3.63692761822782679930738270515740797370813691938e8095
-But currently, only integer and half-integer exponents are allowed for
-the power operation in expressions and only the square-root operation is
+(as this example shows the underscore character can be used to separate
+visually digits, one can also use the space character for that purpose).
+
+Currently, only integer and half-integer exponents are allowed for the
+power operation in expressions and only the square-root operation is
implemented besides the four arithmetic operations. Square-root and the
four operations achieve correct rounding in the given arbitrary
precision.
-Sub-units `xintcore`, `xint` and `xintfrac` provide the underlying
-macros, and `xintexpr` loads all of them and provides expandable
-parsers allowing computations such as the above (and more).
-
Usage
=====
-It is possible to use the package with Plain (via `\input` anywhere) or with
-LaTeX (via `\usepackage` in the preamble).
+It is possible to use the package with Plain (using for example
+`\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
Further packages: `xintbinhex`, `xintgcd`, `xintseries` and `xintcfrac`.
Main dependencies are handled automatically. For example `xintexpr`
-automatically loads `xintfrac` which itself loads `xint`; but use of the
-`gcd` and `lcm` functions in expressions require explicit loading of
-`xintgcd`, and hexadecimal notation requires explicit loading of
-`xintbinhex`.
+automatically loads `xinttools` and `xintfrac` (which itself loads
+`xint`). But the `gcd()/lcm()` functions require extra loading of
+`xintgcd` and hexadecimal input requires `xintbinhex`.
Package `xintcore` is the subset of `xint` providing only the five
-operations on big integers: `\xintiiAdd`, `\xintiiMul`, ... It is (by
-default) loaded by the (LaTeX only) package
-[bnumexpr](http://www.ctan.org/pkg/bnumexpr) which provides a more
-light-weight expression parser handling only big integers, the four
-operations, the power operation and the factorial.
+operations on big integers: `\xintiiAdd`, `\xintiiMul`, ...
-There is also `xinttools` which is a separate package providing,
-among others, expandable and non-expandable loops such as `\xintFor`.
+The LaTeX package [bnumexpr](http://www.ctan.org/pkg/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.
## With TeX
@@ -120,7 +118,14 @@ 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`, or `\xint_dothis/\xint_orthat`.
+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. This is
+used by `xintexpr.sty` for implementing `random()` and `randrange()`
+functions.
Installation
============
@@ -162,9 +167,11 @@ Assumes a GNU/Linux-like system (or Mac OS X).
## Method C: manual installation using `Makefile` and `xint.dtx`
The Makefile automatizes rebuilding from `xint.dtx` all documentation
-files as well as `xint.tds.zip`. It is for GNU/Linux-like (inc. Mac OS X)
-systems, with a teTeX like installation such as TeXLive. Furthermore the
-[Pandoc](http://johnmacfarlane.net/pandoc/) software is required.
+files as well as `xint.tds.zip`. It is for GNU/Linux-like (inc. Mac OS
+X) systems, with a teTeX like installation such as TeXLive. The
+[Latexmk](http://personal.psu.edu/jcc8/software/latexmk/)
+and [Pandoc](http://johnmacfarlane.net/pandoc/) softwares
+are required to build all the documentation.
1. obtain `xint.dtx` and `Makefile` from
<http://mirror.ctan.org/macros/generic/xint>.
@@ -174,41 +181,17 @@ systems, with a teTeX like installation such as TeXLive. Furthermore the
## Method D: installation starting with only `xint.dtx`
-Run `"tex xint.dtx"` or `"etex xint.dtx"` to extract from `xint.dtx`
-all packages as well as these files:
-
-`README.md`
- : the current README with Markdown formatting.
-
-`CHANGES.md`
- : the changes across successive releases.
-
-`xint.tex`
- : used to generate `xint.pdf` via `"latex xint.tex"` (thrice) then
- `"dvipdfmx xint.dvi"`. It is also possible to compile `xint.tex` with
- `xelatex`, or with `pdflatex` (this latter option produces a bigger pdf).
-
- : For successful compilation, packages `newtxtt`, `newtxmath`, `etoc`,
- `mathastext` are needed. Inclusion of the source code is off by
- default, but the toggle can be set in `xint.tex`.
-
- : A third option is to generate `xint.pdf` via `xelatex xint.dtx` or
- `pdflatex xint.dtx`. Source code is then included by default (but some
- code comments in French use 8bit characters, hence for `xelatex` an a
- priori conversion of xint.dtx into utf-8 will give a better result).
-
-`Makefile.mk`
- : this is for UNIX-like systems. Note: this file is only produced
- with `"etex xint.dtx"`, not with `"tex xint.dtx"`. Rename it to
- `Makefile` and run `make` on the command line for further help.
-
-`doHTMLs.sh` and `doPDFs.sh`
- : these are scripts (for UNIX-like systems) which can be used to
- convert the `README.md` and `CHANGES.md` to HTML and PDF formats.
- They require [Pandoc](http://johnmacfarlane.net/pandoc/).
-
-`pandoctpl.latex`
- : a Pandoc template used by `doPDFs.sh`.
+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 `Makefile.mk`. If you are on a GNU/Linux-type system, rename
+the file to `Makefile` and execute `make` on command line for further
+help. If not, you will need to examine the contents of this file to see
+the commands needed to produce the documentation with `latexmk`
+(extraction will have created a configuration file `.latexmkrc`) and
+`pandoc`. If not using `latexmk`, you will need to execute suitable
+`makeindex -s xint-gind.ist` calls to produce the indices of macros for
+inclusion into `sourcexint.pdf`. It is also possible to get `xint.pdf`
+to include the source code. For this, see the instructions in `xint.tex`.
Finishing the installation in a TDS hierarchy:
@@ -216,7 +199,7 @@ Finishing the installation in a TDS hierarchy:
- `xint.dtx` goes to `TDS:source/generic/xint/`
-- the documentation (xint.pdf, README.md,...) goes to `TDS:doc/generic/xint/`
+- The documentation (xint.pdf, README.md,...) goes to `TDS:doc/generic/xint/`
Depending on the destination, it may then be necessary to refresh a
filename database.
@@ -246,10 +229,40 @@ xintexpr.sty, xintbinhex.sty, xintgcd.sty, xintseries.sty,
xintcfrac.sty, xinttools.sty, xint.ins, xint.tex, README, README.md,
README.html, README.pdf, CHANGES.md, CHANGES.html, CHANGES.pdf,
pandoctpl.latex, doHTMLs.sh, doPDFs.sh, xint.dvi, xint.pdf,
-Makefile.mk.</div>
+Makefile.mk, xint-gind.ist, and .latexmkrc.</div>
%</readme>--------------------------------------------------------
%<*changes>-------------------------------------------------------
+`1.3c (2018/06/17)`
+----
+
+### Improvements and new features
+
+ - **xintexpr**: with `\xintglobaldefstrue`, `\xintdefvar`,
+ `\xintdeffunc`, `\xintNewExpr` et. al. make definitions with global
+ scope.
+
+ - **xintexpr**: `qraw()` for fast input of (very many) comma separated
+ numbers (in suitable raw format).
+
+ - **xintexpr**: the colon in the `:=` part of the syntax for
+ `\xintdefvar` and variants is now optional; and if present it may be
+ an active character or have any (reasonable) catcode.
+
+ - **xintexpr**: `\xintdefvar`, `\xintdeffunc` and their variants try to
+ set the catcode of the semi-colon which delimits their arguments; of
+ course this will not work if that catcode is already frozen.
+
+ - `\xintUniformDeviate` is better documented and `sourcexint.pdf` is better
+ hyperlinked and includes indices for the macros defined by each package.
+
+### Bug fixes
+
+ - **xintfrac**: since `1.3` release, it loaded **xintgcd** in
+ contradiction to what the documentation says (hence also **xintexpr**
+ loaded **xintgcd** automatically). There is no actual dependency so
+ the loading is removed for now.
+
`1.3b (2018/05/18)`
----
@@ -285,14 +298,6 @@ require an engine providing the `\(pdf)uniformdeviate` primitive.
deprecated macros have been removed at `1.3` so there was no reason
to keep the code used for deprecating them.
-### Bug fixes
-
- - **xintexpr**: the mechanism for adjunction to the expression parsers
- of user defined functions was refactored and improved at previous
- release `1.3`: in particular recursive definitions became possible.
- But an oversight made these recursive functions quite inefficient (to
- remain polite.) This release fixes the problem.
-
### Improvements and new features
- **xintexpr**: new conditionals `ifone()` and `ifint()`.
@@ -303,6 +308,14 @@ require an engine providing the `\(pdf)uniformdeviate` primitive.
- Added to the user manual mention of macros such as `\xintDivFloor`,
`\xintMod`, `\xintModTrunc`, which had been left out so far.
+### Bug fixes
+
+ - **xintexpr**: the mechanism for adjunction to the expression parsers
+ of user defined functions was refactored and improved at previous
+ release `1.3`: in particular recursive definitions became possible.
+ But an oversight made these recursive functions quite inefficient (to
+ remain polite.) This release fixes the problem.
+
`1.3 (2018/03/01)`
----
@@ -1815,17 +1828,19 @@ Initial announcement:
%</changes>------------------------------------------------------
%<*makefile>------------------------------------------------------
# This file: Makefile.mk (generated from xint.dtx)
-# Tested on Mac OS X Mavericks with GNU Make 3.81,
-# TeXLive 2014 and Pandoc 1.13.1.
-# Either download the master Makefile from
+# Rename the file as Makefile, or keep is named as Makefile.mk
+# and download master Makefile from
# http://mirror.ctan.org/macros/generic/xint
-# or rename the present one as "Makefile".
-# Then run "make" or equivalently "make help" to
-# get instructions. Compilation of the complete
-# documentation requires Pandoc.
+# then run "make help"
-# Note to myself: I wanted to use .RECIPEPREFIX = > but it is supported
-# only with GNU Make 3.82 and later.
+# Starting with xint 1.3c, uses Latexmk for easier compilation of
+# sourcexint.pdf as it includes indices.
+
+# Originally tested on Mac OS X Mavericks with GNU Make 3.81,
+# TeXLive 2014 and Pandoc 1.13.1.
+
+# Note to myself: I wanted to use .RECIPEPREFIX = > but it is
+# supported only with GNU Make 3.82 and later.
# this crazyness is to circumvent a problem with docstrip generation
# of the Makefile; we do not want two empty lines becoming only one
@@ -1861,12 +1876,13 @@ make helpless
prints this help (using less).
make xint.pdf
- extracts files and produces only xint.pdf, via latex+dvipdfmx.
- No Pandoc needed.
+ extracts files and produces xint.pdf, using latex and dvipdfmx.
+ Uses Latexmk. No Pandoc needed. To get xint.pdf to include
+ the source code and indices, refer to instructions in xint.tex.
make sourcexint.pdf
- extracts files and produces only sourcexint.pdf, via latex+dvipdfmx.
- No Pandoc needed.
+ extracts files and produces sourcexint.pdf, using latex, makeindex
+ and dvipdfmx. Uses Latexmk. No Pandoc needed.
make PanPDF
produces README.pdf and CHANGES.pdf, requires Pandoc.
@@ -1883,8 +1899,13 @@ make all
make xint.tds.zip
same as "make all"
+make clean
+ removes auxiliary files and repertories.
+
make cleanall
- removes all generated files
+ removes all files, leaving only xint.dtx (and Makefile). If no
+ Makefile, use "etex xint.dtx" to regenerate Makefile.mk, rename
+ it as Makefile and run "make help".
==== INSTALLING
@@ -1940,19 +1961,19 @@ packages = xintkernel.sty xintcore.sty xint.sty xintfrac.sty xintexpr.sty\
# specified. If "make -f Makefile.mk" is run, Makefile.mk will not be
# overwritten because tex xint.dtx does not extract it (etex xint.dtx does).
extracted = $(packages) xint.tex xint.ins README.md CHANGES.md\
- doHTMLs.sh doPDFs.sh pandoctpl.latex
+ doHTMLs.sh doPDFs.sh pandoctpl.latex .latexmkrc xint-gind.ist
doc_pdf = README.pdf CHANGES.pdf
doc_html = README.html CHANGES.html
filesfortex = $(packages)
filesforsource = xint.dtx xint.ins Makefile
filesfordoc = xint.pdf sourcexint.pdf README $(doc_pdf) $(doc_html)
-auxiliaryfiles = xint.tex xint.dvi xint.aux xint.toc xint.log\
+auxiliaryfiles = xint.dvi xint.aux xint.toc xint.log\
sourcexint.dvi sourcexint.aux sourcexint.toc sourcexint.log\
- README.tex README.dvi README.aux README.toc README.out README.log\
- CHANGES.tex CHANGES.dvi CHANGES.aux CHANGES.toc CHANGES.out CHANGES.log
-xint_cmd = latex -interaction=nonstopmode xint
-sourcexint_cmd = latex -interaction=nonstopmode -jobname=sourcexint\
- "\chardef\dosourcexint=1 \input{xint}"
+ README.dvi README.aux README.toc README.out README.log\
+ CHANGES.dvi CHANGES.aux CHANGES.toc CHANGES.out CHANGES.log
+xint_cmd = latexmk xint
+sourcexint_cmd = latexmk -jobname=sourcexint\
+ -latex='latex %O "\\chardef\\dosourcexint=1 \\input{%S}"' xint.tex
all: $(extracted) doc xint.tds.zip
@echo 'make all done.'
@@ -1966,16 +1987,10 @@ doc: xint.pdf sourcexint.pdf README PanPDF PanHTML
@echo 'make doc done.'
xint.pdf: xint.dtx xint.tex
- rm -f xint.aux xint.toc
- $(xint_cmd)
- $(xint_cmd)
$(xint_cmd)
dvipdfmx xint.dvi
sourcexint.pdf: xint.dtx xint.tex
- rm -f sourcexint.aux sourcexint.toc
- $(sourcexint_cmd)
- $(sourcexint_cmd)
$(sourcexint_cmd)
dvipdfmx sourcexint.dvi
@@ -2040,12 +2055,40 @@ uninstalllocal:
source/generic/xint \
tex/generic/xint && texhash .
clean:
- rm -f $(auxiliaryfiles)
+ rm -fr auto/ TEMP*/
+ rm -f $(auxiliaryfiles)\
+ sourcexint*.ilg sourcexint*.idx sourcexint*.ind\
+ xint*.ilg xint*.idx xint*.ind\
+ sourcexint.fls sourcexint.fdb_latexmk\
+ xint.fls xint.fdb_latexmk
cleanall: clean
rm -f $(extracted) $(doc_pdf) $(doc_html)\
- README xint.pdf sourcexint.pdf xint.tds.zip
+ README README.tex CHANGES.tex\
+ xint.pdf sourcexint.pdf xint.tds.zip xint.zip Makefile.mk
%</makefile>$-----------------------------------------------------
+%<*latexmkrc>------------------------------------------------------
+$makeindex = 'makeindex -s xint-gind.ist %O -o %D %S';
+%</latexmkrc>$-----------------------------------------------------
+%<*gind>------------------------------------------------------
+%%
+%% Based upon `gind.ist' from LaTeX2e's base package `doc'
+actual '='
+quote '&'
+level '>'
+preamble
+"\n \\begin{theindex} \n \\catcode`_\\active \\let_\\textunderscore \\makeatletter\\scan@allowedfalse\n"
+postamble
+"\n\n \\end{theindex}\n"
+item_x1 "\\efill \n \\subitem "
+item_x2 "\\efill \n \\subsubitem "
+delim_0 "\\pfill "
+delim_1 "\\pfill "
+delim_2 "\\pfill "
+heading_prefix "{\\bfseries\\hfil "
+heading_suffix "\\hfil}\\nopagebreak\n"
+headings_flag 1
+%</gind>$-----------------------------------------------------
%<*pandoctpl>-----------------------------------------------------
\newcommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
@@ -2189,10 +2232,30 @@ dvipdfmx CHANGES.dvi
%</dopdfsh>-------------------------------------------------------
%<*drv>-----------------------------------------------------------
%%
-%% Run latex thrice on this file xint.tex then run dvipdfmx on
-%% xint.dvi to produce the documentation xint.pdf. Alternatively
-%% run xelatex or pdflatex thrice on xint.tex.
+%% To produce manually xint.pdf from xint.tex:
+%% - latex (thrice) then dvipdfmx,
+%% - or xelatex/pdflatex thrice.
+%%
+%% To produce manually sourcexint.pdf from xint.tex:
+%% latexmk -jobname=sourcexint\
+%% -latex="latex %O \\\\chardef\\\\dosourcexint=1 \\\\input{%S}"\
+%% xint.tex
+%% (quoting may differ, depending on the shell)
+%% dvipdfmx sourcexint.dvi
%%
+%% Notice that this will need files .latexmkrc and xint-gind.ist
+%% which are produced from "tex xint.dtx" (or "tex xint.ins").
+%%
+%% It is naturally possible to replace latexmk by suitable latex
+%% and makeindex calls, but details are left out here.
+%%
+%% To get xint.pdf to include the source code and indices:
+%% - etex xint.dtx (this will regenerate this file),
+%% - replace 1 by 0 in \chardef line below,
+%% - make clean
+%% - make xint.pdf
+%% This will use latexmk. Details on how to do it without make
+%% and latexmk are left out here.
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{xint.tex}%
[\xintbndldate\space v\xintbndlversion\space driver file for xint documentation (JFB)]%
@@ -2201,14 +2264,17 @@ dvipdfmx CHANGES.dvi
\input xint.dtx
%%% Local Variables:
%%% mode: latex
+%%% TeX-PDF-from-DVI: "Dvipdfmx"
%%% End:
%</drv>-----------------------------------------------------------
%<*ins>-----------------------------------------------------------
%%
-%% tex xint.ins extracts all package files from xint.dtx, as well as
-%% xint.tex, README.md, CHANGES.md, doPDFs.sh, doHTMLs.sh.
+%% `tex xint.ins' extracts all package files from xint.dtx, as well as
+%% xint.tex, README.md, CHANGES.md, doPDFs.sh, doHTMLs.sh, .latexmkrc
+%% and xint-gind.ist
%%
-%% etex xint.ins does the same plus extracts Makefile.mk.
+%% `etex xint.ins' additionally extracts Makefile.mk, which is needed
+%% for building documentation using `make'.
%%
\input docstrip.tex
\askforoverwritefalse
@@ -2219,8 +2285,10 @@ dvipdfmx CHANGES.dvi
\file{doPDFs.sh}{\from{xint.dtx}{dopdfsh}}
\ifx\numexpr\undefined\else\catcode9 11
\file{Makefile.mk}{\from{xint.dtx}{makefile}}\fi
+\file{.latexmkrc}{\from{xint.dtx}{latexmkrc}}
\usepreamble\defaultpreamble
\usepostamble\defaultpostamble
+\file{xint-gind.ist}{\from{xint.dtx}{gind}}
\file{pandoctpl.latex}{\from{xint.dtx}{pandoctpl}}
\file{xint.tex}{\from{xint.dtx}{drv}}
\file{xintkernel.sty}{\from{xint.dtx}{xintkernel}}
@@ -2235,7 +2303,7 @@ dvipdfmx CHANGES.dvi
\file{xintexpr.sty}{\from{xint.dtx}{xintexpr}}}
\catcode32=13\relax% active space
\let =\space%
-\Msg{************************************************************************}
+\Msg{********************************************************************}
\Msg{*}
\Msg{* To finish the installation you have to move the following}
\Msg{* files into a directory searched by TeX:}
@@ -2251,15 +2319,17 @@ dvipdfmx CHANGES.dvi
\Msg{* xintexpr.sty}
\Msg{* xinttools.sty}
\Msg{*}
-\Msg{* To produce the documentation run latex thrice on xint.tex}
-\Msg{* then dvipdfmx on xint.dvi. Edit xint.tex to get the code}
-\Msg{* source included.}
-\Msg{* dvipdfmx warnings may be ignored, but if the produced pdf}
-\Msg{* has font problems, run rather pdflatex on xint.tex}
+\Msg{* To produce the user manual run latex thrice on xint.tex}
+\Msg{* then dvipdfmx on xint.dvi, or if your system allows,}
+\Msg{* execute `make xint.pdf' (this requires Latexmk).}
+\Msg{*}
+\Msg{* The commented source code is generated from executing}
+\Msg{* `make sourcexint.pdf' (this requires Latexmk; if not}
+\Msg{* available check the details in Makefile.mk and .latexmkrc)}
\Msg{*}
\Msg{* Happy TeXing!}
\Msg{*}
-\Msg{************************************************************************}
+\Msg{********************************************************************}
\endbatchfile
%</ins>-----------------------------------------------------------
%<*dtx>-----------------------------------------------------------
@@ -2294,22 +2364,24 @@ dvipdfmx CHANGES.dvi
\Msg{* To finish the installation you have to move the following^^J}%
\Msg{* files into a directory searched by TeX:^^J}%
\Msg{*^^J}%
-\Msg{*\space\space\space\space xintkernel.sty^^J}%
-\Msg{*\space\space\space\space xintcore.sty^^J}%
-\Msg{*\space\space\space\space xint.sty^^J}%
-\Msg{*\space\space\space\space xintbinhex.sty^^J}%
-\Msg{*\space\space\space\space xintgcd.sty^^J}%
-\Msg{*\space\space\space\space xintfrac.sty^^J}%
-\Msg{*\space\space\space\space xintseries.sty^^J}%
-\Msg{*\space\space\space\space xintcfrac.sty^^J}%
-\Msg{*\space\space\space\space xintexpr.sty^^J}%
-\Msg{*\space\space\space\space xinttools.sty^^J}%
+\Msg{* \space\space\space\space xintkernel.sty^^J}%
+\Msg{* \space\space\space\space xintcore.sty^^J}%
+\Msg{* \space\space\space\space xint.sty^^J}%
+\Msg{* \space\space\space\space xintbinhex.sty^^J}%
+\Msg{* \space\space\space\space xintgcd.sty^^J}%
+\Msg{* \space\space\space\space xintfrac.sty^^J}%
+\Msg{* \space\space\space\space xintseries.sty^^J}%
+\Msg{* \space\space\space\space xintcfrac.sty^^J}%
+\Msg{* \space\space\space\space xintexpr.sty^^J}%
+\Msg{* \space\space\space\space xinttools.sty^^J}%
\Msg{*^^J}%
-\Msg{* To produce the documentation run latex thrice on xint.tex^^J}
-\Msg{* then dvipdfmx on xint.dvi. Edit xint.tex to get the code^^J}
-\Msg{* source included.^^J}
-\Msg{* dvipdfmx warnings may be ignored, but if the produced pdf^^J}
-\Msg{* has font problems, run rather pdflatex on xint.tex^^J}
+\Msg{* To produce the user manual run latex thrice on xint.tex^^J}%
+\Msg{* then dvipdfmx on xint.dvi, or if your system allows,^^J}%
+\Msg{* execute `make xint.pdf' (this requires Latexmk).^^J}%
+\Msg{*^^J}%
+\Msg{* The commented source code is generated from executing^^J}%
+\Msg{* `make sourcexint.pdf' (this requires Latexmk; if not^^J}%
+\Msg{* available check the details in Makefile.mk and .latexmkrc)^^J}%
\Msg{*^^J}%
\Msg{* Happy TeXing!^^J}%
\Msg{*^^J}%
@@ -2326,10 +2398,12 @@ dvipdfmx CHANGES.dvi
% there is a problem with xelatex, as it generates ^^I also.
\ifnum\noetex=1 \else\ifx\XeTeXinterchartoks\undefined
\file{Makefile.mk}{\from{xint.dtx}{makefile}}\fi\fi
+ \file{.latexmkrc}{\from{xint.dtx}{latexmkrc}}
\file{doHTMLs.sh}{\from{xint.dtx}{dohtmlsh}}
\file{doPDFs.sh}{\from{xint.dtx}{dopdfsh}}
\usepreamble\defaultpreamble
\usepostamble\defaultpostamble
+ \file{xint-gind.ist}{\from{xint.dtx}{gind}}
\file{pandoctpl.latex}{\from{xint.dtx}{pandoctpl}}
\file{xint.ins}{\from{xint.dtx}{ins}}
\file{xint.tex}{\from{xint.dtx}{drv}}
@@ -2352,7 +2426,7 @@ dvipdfmx CHANGES.dvi
% Check if \MessageDeFin got defined, if yes put it at end of run.
\ifdefined\MessageDeFin\AtEndDocument{\MessageDeFin}\fi
%-----------------------------------------------------------------
-% -*- coding: utf-8; mode: latex -*-
+% -*- coding: utf-8; mode: latex, fill-column: 78; -*-
%
\ifdefined\dosourcexint % this toggle is set from make sourcexint.pdf rule
\chardef\NoSourceCode 0
@@ -2376,52 +2450,64 @@ dvipdfmx CHANGES.dvi
\documentclass {scrdoc}
\fi
-
-
-
-
-
-
+% Remove from sectioning commands insertion of marks, because we
+% will do it ourself.
+\usepackage{etoolbox}
+\makeatletter
+\patchcmd{\@sect}%
+ {\expandafter\csname#1mark\expandafter\endcsname\expandafter{\@currentheadentry}}%
+ {}{}{}
+\patchcmd{\@sect}%
+ {\expandafter\csname#1mark\expandafter\endcsname\expandafter{\@currentheadentry}}%
+ {}{}{}
+\makeatother
+
\PassOptionsToPackage{bookmarks=true}{hyperref}
-\ifnum\NoSourceCode=1 \OnlyDescription\fi
+\ifnum\NoSourceCode=1
+ \OnlyDescription
+\else
+\makeatletter
+% As there is currently no index for user manual, we can define
+% already here some doc.sty macros for indexing of source code. See
+% further customization where source starts.
+ \EnableCrossrefs
+ \def\StartPackageIndex#1%
+ {\immediate\openout\package@indexfile=\jobname#1.idx\relax
+ \typeout{Writing index file \jobname#1.idx}}
+ \def\StopPackageIndex%
+ {\immediate\closeout\package@indexfile}
+ \def\index{\@bsphack \begingroup \@sanitize \@wrindex }%
+ % attention that hyperref redefines \@wrindex
+ % so we delay our definition to right before source code
+ \newwrite \@indexfile % will be opened at start of source code
+ \newwrite \package@indexfile
+ \let\makeindex\@empty
+ \PageIndex
+ \CodelineNumbered
+\makeatother
+\fi
+% counts used in particular in the samples from the documentation of the
+% xintseries.sty package
+\newcount\cnta
+\newcount\cntb
+\newcount\cntc
+
\pagestyle{headings}
-\makeatletter
-\def\buggysectionmark #1{% KOMA 3.12 as released to CTAN December 2013
- \if@twoside\expandafter\markboth\else\expandafter\markright\fi
- {\MakeMarkcase{\ifnumbered{section}{\sectionmarkformat\fi}{}#1}}{}}
-\ifx\buggysectionmark\sectionmark
-\def\sectionmark #1{%
- \if@twoside\expandafter\markboth\else\expandafter\markright\fi
- {\MakeMarkcase{\ifnumbered{section}{\sectionmarkformat}{}#1}}{}}
-\fi
-\makeatother
\ifxetex
\else
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
-% 2016-02-28
-% This is for use in pre-CTAN version of the dtx. Not needed for CTAN
-% xint.dtx. Again an annoying preamble-only restriction whose rationale
-% escape me. (The obelus serves to clean up the private sources from comments
-% of the type as this one before uploading to CTAN).
-% TS1 declarations loaded by newtxtt.
-% \DeclareUnicodeCharacter{00F7}{\textdiv}
- \def\PrivateObelus{\textdiv }%
- \AtBeginDocument{\DeclareUnicodeCharacter {00F7}{\PrivateObelus}}%
-% utilisé où ? (2016/12/08)
- \DeclareUnicodeCharacter {03B4}{\ensuremath{\delta}}%
+ \DeclareUnicodeCharacter{03B4}{\ensuremath{\delta}}%δ
+ \DeclareUnicodeCharacter{03BE}{\ensuremath{\xi}}%ξ
\fi
-\DeclareUnicodeCharacter{03BE}{\ensuremath{\xi}}
-
\usepackage{multicol}
-
\usepackage{geometry}
-\AtBeginDocument {\ttzfamily
+\AtBeginDocument {\ttzfamily % package newtxtt loaded in preamble
\newgeometry{textwidth=\dimexpr92\fontcharwd\font`X\relax,
vscale=0.75}}
@@ -2431,106 +2517,83 @@ dvipdfmx CHANGES.dvi
\usepackage{xintgcd}
\usepackage{xintseries}
\usepackage{xintcfrac}
-\usepackage{amsmath} % for use of \cfrac in the documentation
-\usepackage{pifont} % pour la hollow star \ding{73}
+\usepackage{amsmath}% for \cfrac usage
+\usepackage{pifont}% for \ding{73} (hollow star)
\fi
\usepackage{xinttools}
+\xintverbosetrue
\usepackage{enumitem}
-
\usepackage{varioref}
+\usepackage{xspace}
+\usepackage[para]{footmisc}
+\usepackage{picture}
+\usepackage{graphicx}
-\usepackage{etoolbox}
-
-\usepackage{tocloft}
-
-\usepackage{etoc}[2013/10/16] % I need \etocdepthtag.toc
-
-%---- USE OF ETOC FOR THE TABLES OF CONTENTS
+\usepackage[english]{babel}
+\usepackage[autolanguage,np]{numprint}
+\AtBeginDocument{\npthousandsep{,\hskip .5pt plus .1pt minus .1pt}}
-\def\gobbletodot #1.{}
+\usepackage[dvipsnames]{xcolor}
+\definecolor{joli}{RGB}{225,95,0}
+\definecolor{JOLI}{RGB}{225,95,0}
+\definecolor{BLUE}{RGB}{0,0,255}
+\definecolor{niceone}{RGB}{38,128,192}
+\usepackage{eso-pic}% après xcolor sinon Option clash for package xcolor.
-\newif\ifinmanualmaintoc % 1 avril 2014
-\ifnum\dosourcexint=0
- \inmanualmaintoctrue
+\ifnum\dosourcexint=1
+\else
+% Dependency graph done using TikZ (manually)
+ \usepackage{tikz}
+ \usetikzlibrary{shapes,arrows.meta}
\fi
-\def\sectioncouleur{{cyan}}
-
-\def\MARGEPAGENO {1.5em}% changera pour la partie implémentation
+\usepackage{framed}
+% SNUGFRAMED
+% ==========
-\def\SKIPSECTIONINTERSPACE{\vskip\bigskipamount}
-\etocsetstyle{section}{}
- {\normalfont}
- {\etociffirst{}{\SKIPSECTIONINTERSPACE}%
- \rightskip \MARGEPAGENO\relax
- \parfillskip -\MARGEPAGENO\relax
- \bfseries
- \leftskip \leftmarginii
- \noindent\llap % \llap
- {\makebox[\leftmarginii][l]% et \leftmargini le 12/10/2014
- {\expandafter\textcolor\sectioncouleur {\etocnumber}}}%
- \strut\etocname
- \mdseries\nobreak\leaders\etoctoclineleaders\hfill\nobreak\strut
- \makebox[\MARGEPAGENO][r]{\etocpage}\par
- \let\ETOCsectionnumber\etocthenumber
- }%
- {}%
-
-\newdimen\margegauchetoc
-\AtBeginDocument{\margegauchetoc \dimexpr 5\fontcharwd\font`X\relax}
\makeatletter
-\etocsetstyle{subsection}
- {\begingroup\normalfont
- \setlength{\premulticols}{0pt}%
- \setlength{\multicolsep}{0pt}%
- \setlength{\columnsep}{\leftmarginii}%
- \setlength{\columnseprule}{.4pt}% n'influence pas séparation colonnes
- \parskip\z@skip
- \raggedcolumns
- \addvspace{\smallskipamount}%
- \begin{multicols}{2}
- \leftskip \margegauchetoc % 12 octobre 2014
- \ifinmanualmaintoc
- \rightskip \MARGEPAGENO
- \else
- \rightskip \MARGEPAGENO plus 2em minus 1em
- \fi
- \parfillskip -\MARGEPAGENO\relax
- }
- {}
- {\noindent
- \etocifnumbered{\llap{\makebox[\margegauchetoc][l]{\ttzfamily\bfseries\etoclink
- {\ifinmanualmaintoc\expandafter\textcolor\sectioncouleur
- {\normalfont\bfseries\ETOCsectionnumber}\fi
- .\expandafter\gobbletodot\etocthenumber}}}}{\kern-\margegauchetoc}%
- \strut\etocname\nobreak
- \unless\ifinmanualmaintoc\leaders\etoctoclineleaders\fi
- \hfill\nobreak
- \strut\makebox[\MARGEPAGENO][r]{\small\etocpage}\endgraf }
- {\end{multicols}\endgroup\addvspace{\smallskipamount}}%
+\newenvironment{snugframed}{%
+ \fboxsep \dimexpr2\fontcharwd\font`X\relax
+ \advance\linewidth-2\fboxsep
+ \advance\csname @totalleftmargin\endcsname \fboxsep
+ \def\FrameCommand##1{\hskip\@totalleftmargin
+ \hskip-\fboxsep
+ \fbox{##1}\hskip-\fboxsep
+ % There is no \@totalrightmargin, so:
+ \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
+ \MakeFramed {\advance\hsize-\width \@totalleftmargin\z@ \linewidth\hsize
+ \@setminipage}%
+ }{\par\unskip\@minipagefalse\endMakeFramed}
+\makeatother
-\etocsetstyle{subsubsection}
- {\begingroup\normalfont\small
- \leftskip \dimexpr\leftmargini+1em\relax }
- {}
- {\noindent
- \llap{\makebox[\dimexpr\leftmargini+1em\relax][l]%
- {\ttzfamily\bfseries\etoclink
- {\HOOKLOCALTOC.\expandafter\gobbletodot\etocthenumber}}}%
- \strut\etocname\nobreak
- \leaders\etoctoclineleaders
- \hfill\nobreak
- \strut\makebox[\MARGEPAGENO][r]{\small\etocpage}\endgraf }
- {\endgroup }%
+% HYPERREF
+% ========
-\let\HOOKLOCALTOC\empty% quick hack to get style I want in User defined functions
-\etocsetlevel{table}{6}
+\usepackage[pdfencoding=unicode]{hyperref}
-\makeatother
+\hypersetup{%
+linktoc=all,%
+breaklinks=true,%
+colorlinks=true,%
+urlcolor=niceone,%
+linkcolor=blue,%
+pdfauthor={Jean-Fran\c cois Burnol},%
+pdftitle={The xint bundle},%
+pdfsubject={Arithmetic with TeX},%
+pdfkeywords={Expansion, arithmetic, TeX},%
+pdfstartview=FitH,%
+pdfpagemode=UseOutlines}
-\addtocontents{toc}{\protect\hypersetup{hidelinks}}
+\usepackage{hypcap}
+\ifnum\dosourcexint=1
+\hypersetup{pdftitle={The xint bundle source code}}
+\fi
+\usepackage{bookmark}
+
+% FONTS
+% =====
\usepackage[zerostyle=a,straightquotes,scaled=0.95]{newtxtt}
\usepackage{newtxmath}
@@ -2625,80 +2688,137 @@ dvipdfmx CHANGES.dvi
\makeatother
+% This is with a slashed 0 like the original txtt.
\newcommand\ttbfamily {\fontfamily{newtxttb}\selectfont }
-
-\def\digitstt #1{\begingroup\color[named]{OrangeRed}#1\endgroup}
-
-\let\dtt\digitstt
-
\ifnum\dosourcexint=1
\else
\renewcommand\familydefault\ttdefault
\usepackage[noendash]{mathastext}% pas de endash dans newtxtt
\fi
-\renewcommand\familydefault\sfdefault % <-- sans-serif in footnotes, TOC,
- % headers etc...
+\frenchspacing
+% sans-serif in footnotes, TOC, titles, etc...
+\renewcommand\familydefault\sfdefault
-\usepackage{xspace}
-\usepackage[dvipsnames]{xcolor}
-\usepackage{framed}
+% TABLES OF CONTENTS
+% ==================
+\usepackage{tocloft}
+\usepackage{etoc}
+
+\def\gobbletodot #1.{}
+
+\newif\ifinmanualmaintoc
+\ifnum\dosourcexint=0
+ \inmanualmaintoctrue
+\fi
+\def\sectioncouleur{{cyan}}
+
+\def\MARGEPAGENO {1.5em}% changera pour la partie implémentation
+
+
+\def\SKIPSECTIONINTERSPACE{\vskip\bigskipamount}
+\etocsetstyle{section}{}
+ {\normalfont}
+ {\etociffirst{}{\SKIPSECTIONINTERSPACE}%
+ \rightskip \MARGEPAGENO\relax
+ \parfillskip -\MARGEPAGENO\relax
+ \bfseries
+ \leftskip \leftmarginii
+ \noindent\llap % \llap
+ {\makebox[\leftmarginii][l]% et \leftmargini le 12/10/2014
+ {\expandafter\textcolor\sectioncouleur {\etocnumber}}}%
+ \strut\etocname
+ \mdseries\nobreak\leaders\etoctoclineleaders\hfill\nobreak\strut
+ \makebox[\MARGEPAGENO][r]{\etocpage}\par
+ \let\ETOCsectionnumber\etocthenumber
+ }%
+ {}%
+
+\newdimen\margegauchetoc
+\AtBeginDocument{\margegauchetoc \dimexpr 5\fontcharwd\font`X\relax}
\makeatletter
-\newenvironment{snugframed}{%
- \fboxsep \dimexpr2\fontcharwd\font`X\relax
- \advance\linewidth-2\fboxsep
- \advance\csname @totalleftmargin\endcsname \fboxsep
- \def\FrameCommand##1{\hskip\@totalleftmargin
- \hskip-\fboxsep
- \fbox{##1}\hskip-\fboxsep
- % There is no \@totalrightmargin, so:
- \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
- \MakeFramed {\advance\hsize-\width \@totalleftmargin\z@ \linewidth\hsize
- \@setminipage}%
- }{\par\unskip\@minipagefalse\endMakeFramed}
-\makeatother
+\etocsetstyle{subsection}
+ {\begingroup\normalfont
+ \setlength{\premulticols}{0pt}%
+ \setlength{\multicolsep}{0pt}%
+ \setlength{\columnsep}{\leftmarginii}%
+ \setlength{\columnseprule}{.4pt}% n'influence pas séparation colonnes
+ \parskip\z@skip
+ \raggedcolumns
+ \addvspace{\smallskipamount}%
+ \begin{multicols}{2}
+ \leftskip \margegauchetoc % 12 octobre 2014
+ \ifinmanualmaintoc
+ \rightskip \MARGEPAGENO
+ \else
+ \rightskip \MARGEPAGENO plus 2em minus 1em
+ \fi
+ \parfillskip -\MARGEPAGENO\relax
+ }
+ {}
+ {\noindent
+ \etocifnumbered{\llap{\makebox[\margegauchetoc][l]{\ttzfamily\bfseries\etoclink
+ {\ifinmanualmaintoc\expandafter\textcolor\sectioncouleur
+ {\normalfont\bfseries\ETOCsectionnumber}\fi
+ .\expandafter\gobbletodot\etocthenumber}}}}{\kern-\margegauchetoc}%
+ \strut\etocname\nobreak
+ \unless\ifinmanualmaintoc\leaders\etoctoclineleaders\fi
+ \hfill\nobreak
+ \strut\makebox[\MARGEPAGENO][r]{\small\etocpage}\endgraf }
+ {\end{multicols}\endgroup\addvspace{\smallskipamount}}%
-\definecolor{joli}{RGB}{225,95,0}
-\definecolor{JOLI}{RGB}{225,95,0}
-\definecolor{BLUE}{RGB}{0,0,255}
-\definecolor{niceone}{RGB}{38,128,192}
+\etocsetstyle{subsubsection}
+ {\begingroup\normalfont\small
+ \leftskip \dimexpr\leftmargini+1em\relax }
+ {}
+ {\noindent
+ \llap{\makebox[\dimexpr\leftmargini+1em\relax][l]%
+ {\ttzfamily\bfseries\etoclink
+ {\HOOKLOCALTOC.\expandafter\gobbletodot\etocthenumber}}}%
+ \strut\etocname\nobreak
+ \leaders\etoctoclineleaders
+ \hfill\nobreak
+ \strut\makebox[\MARGEPAGENO][r]{\small\etocpage}\endgraf }
+ {\endgroup }%
-\usepackage[para]{footmisc}
+\let\HOOKLOCALTOC\empty% quick hack to get style I want in User defined functions
+\etocsetlevel{table}{6}
-\usepackage[english]{babel}
-\usepackage[autolanguage,np]{numprint}
-\AtBeginDocument{\npthousandsep{,\hskip .5pt plus .1pt minus .1pt}}
+\makeatother
-\usepackage[pdfencoding=pdfdoc]{hyperref}
+\addtocontents{toc}{\protect\hypersetup{hidelinks}}
-\hypersetup{%
-linktoc=all,%
-breaklinks=true,%
-colorlinks=true,%
-urlcolor=niceone,%
-linkcolor=blue,%
-pdfauthor={Jean-Fran\c cois Burnol},%
-pdftitle={The xint bundle},%
-pdfsubject={Arithmetic with TeX},%
-pdfkeywords={Expansion, arithmetic, TeX},%
-pdfstartview=FitH,%
-pdfpagemode=UseOutlines}
+% =====================
+% MISCELLANEOUS MARK-UP
+% =====================
-\usepackage{hypcap}
-\ifnum\dosourcexint=1
-\hypersetup{pdftitle={The xint bundle source code}}
-\fi
+\def\digitstt #1{\begingroup\color[named]{OrangeRed}#1\endgroup}
+\let\dtt\digitstt
-\usepackage{bookmark}
+% \ctexttt is a remnant of 1.09n manual, don't have time to get rid of it now.
+\newcommand\ctexttt [1]{\begingroup\color[named]{DarkOrchid}%\bfseries
+ #1\endgroup}
-\usepackage{picture} % permet d'utiliser des unités dans les dimensions de la
- % picture et dans \put
-\usepackage{graphicx}
-\usepackage{eso-pic}
+% \fexpan 22 octobre 2013
+\newcommand\fexpan {\hyperref[ssec:expansions]{\textit{f}-expan}}
+% Septembre 2015
+% Address updated to github repo's one, May 2018
+\def\liiibigint
+ {\href{https://github.com/latex3/latex3/tree/master/l3trial/l3bigint}{l3bigint}}
+
+% \fixmeaning
+\makeatletter
+\def\fixmeaning {\expandafter\fix@meaning\meaning}
+\expandafter\edef\expandafter\fix@meaning
+ \expandafter #\expandafter1\string\romannumeral#2#3%
+ {#1\string\romannumeral`\string^\string^@}
+\makeatother
+
+% Margin Notes
+% ============
-%---- \MyMarginNote: a simple macro for some margin notes with no fuss
\makeatletter
\def\MyMarginNote {\@ifnextchar[\@MyMarginNote{\@MyMarginNote[]}}%
\let\inmarg\MyMarginNote
@@ -2732,7 +2852,7 @@ pdfpagemode=UseOutlines}
\smash{\hbox to 0pt {\hss\color[named]{PineGreen}%
\itshape \xintListWithSep{\,}{#1}\quad }}%
\vskip\dp\strutbox }\strut\@esphack}
-%-------------------------------------------------------------------------------
+%
\def\Numf {{\vbox{\halign{\hfil##\hfil\cr \footnotesize
\upshape Num\cr
\noalign{\hrule height 0pt \vskip1pt\relax}
@@ -2745,7 +2865,7 @@ pdfpagemode=UseOutlines}
\upshape num\cr
\noalign{\hrule height 0pt \vskip1pt\relax}
\itshape x\cr}}}}
-%-------------------------------------------------------------------------------
+%
\def\NewWith #1{\@bsphack
\vadjust{\vskip-\dp\strutbox
\smash{\hbox to 0pt {\hss\color[named]{PineGreen}%
@@ -2753,7 +2873,7 @@ pdfpagemode=UseOutlines}
\hsize 1.5cm\rightskip.5cm minus.5cm
\vtop{\noindent New with #1}\ }}%
\vskip\dp\strutbox }\strut\@esphack}
-
+%
\def\CHANGED #1{\@bsphack
\vadjust{\vskip-\dp\strutbox
\smash{\hbox to 0pt {\hss\color[named]{Red}%
@@ -2769,7 +2889,7 @@ pdfpagemode=UseOutlines}
\hsize 2cm\rightskip.5cm minus.5cm
\vtop{\noindent Deprecated! (#1)}\ }}%
\vskip\dp\strutbox }\strut\@esphack}
-
+%
\def\CHANGEDf #1{\@bsphack
\vadjust{\vskip-\dp\strutbox
\smash{\hbox to 0pt {\hss\color[named]{Red}%
@@ -2778,7 +2898,7 @@ pdfpagemode=UseOutlines}
\vtop{\noindent Changed at #1!}\
\kern\dimexpr\FrameSep+\FrameRule\relax}}%
\vskip\dp\strutbox }\strut\@esphack}
-
+%
\def\NewWithf #1{\@bsphack
\vadjust{\vskip-\dp\strutbox
\smash{\hbox to 0pt {\hss\color[named]{PineGreen}%
@@ -2794,7 +2914,6 @@ pdfpagemode=UseOutlines}
% =======================================================
% 7 mars 2013
-% -----------
%
% This macro allows to conveniently center a line inside a paragraph and still
% allow use therein of \verb or other macros changing catcodes.
@@ -2803,7 +2922,7 @@ pdfpagemode=UseOutlines}
% Actually my \centeredline works nicely in list environments.
-% \ignorespaces ajouté le 9 juin 2013.
+% \ignorespaces added June 9, 2013
% Note: \centeredline creates a group
@@ -2819,6 +2938,10 @@ pdfpagemode=UseOutlines}
\def\@centeredline
{\hbox to \linewidth \bgroup \hss \bgroup \aftergroup\centeredline@ }
+% \leftedline
+% ===========
+
+% 12 octobre 2014
\newif\ifinlefted
@@ -2838,8 +2961,8 @@ pdfpagemode=UseOutlines}
\makeatother
-% verbatim environments
-% =====================
+% verbatim macros and environments
+% ================================
%
% June 2013, then October 2014.
% -----------------------------
@@ -2858,7 +2981,7 @@ pdfpagemode=UseOutlines}
\endgroup\def~{\leavevmode\kern\z@\char`#1 }}%
}
-%--- \lowast
+% \lowast
\def\lowast{\raisebox{-.25\height}{*}}
\catcode`* 13
\def\makestarlowast {\let*\lowast\catcode`\*\active}%
@@ -2866,86 +2989,44 @@ pdfpagemode=UseOutlines}
-%--- for soft-wrapping. I will use discretionaries.
-
-\DeclareFontFamily{U}{MdSymbolC}{}
-\DeclareFontShape {U}{MdSymbolC}{m}{n}{<-> MdSymbolC-Regular}{}
-
-\newbox\SoftWrapIcon
-\colorlet {softwrapicon}{blue}
-
-\def\SetSoftWrapIcon{%
- \setbox\SoftWrapIcon\hb@xt@\z@
- {\hb@xt@\fontdimen2\font
- {\hss{\color{softwrapicon}\usefont{U}{MdSymbolC}{m}{n}\char"97}\hss}%
- \hss}%
- }
-
-\AtBeginDocument {\SetSoftWrapIcon }% ttzfamily déjà fait
-
-%--- \MacroFont, and a \MicroFont
-%
-% Ne PAS mettre de changement de taille de police dans \MacroFont.
-
+% \MacroFont and \MicroFont
+% =========================
\def\restoreMicroFont {\def\MicroFont {\ttbfamily\makestarlowast
\ifinlefted\else\ifineverb\else\color[named]{Blue}\fi\fi}}
\restoreMicroFont
-% Notice that \macrocode uses \macro@font which freezes \MacroFont
-% at \begin{document}. But doc.sty verbatim uses \MacroFont which is not
-% frozen. Comprenne qui pourra...
+% Notice that \macrocode uses \macro@font which stores the \MacroFont meaning
+% in force at \begin{document}. But doc.sty's verbatim uses current \MacroFont
+% not the meaning at \begin{document}. Comprenne qui pourra...
\def\restoreMacroFont {\def\MacroFont {\ttbfamily
\ifinlefted\else\ifineverb\else\color[named]{Blue}\fi\fi}}
\restoreMacroFont
-%--- straight quotes, also in macrocode (2014/11/04)
-%
-% There is no hook in \macrocode after \dospecials, which is done *after*
-% \macro@font. Thus I will need to take the risk that some future evolution of
-% doc.sty (or perhaps scrdoc) invalidates the following.
-%
-% Note: in contrast, \MacroFont in \verbatim is done *after* \dospecials (but
-% before the space becomes active), thus I could use \MacroFont there. But as
-% there is no verbatim environment anymore in xint.dtx, I don't need to take
-% care of it.
-%
-% Actually, I should not at all rely on the doc class, I should do it all by
-% myself. As I don't use at all \DocInput (which caused me loads of problems
-% back then when I was trying to get a workflow satisfying my views on how
-% .dtx files should be structured), there is not much rationale for using the
-% doc class.
-%
-
-\def\macrocode{\macro@code
- \frenchspacing \@vobeyspaces
- \makestarlowast %\makequotesstraight
- \xmacro@code }
-
-
-% ---- a new \verb
+% \verb
+% =====
% Initially, June 2013, then Sep 9, 2014, and Oct 9-12 2014
%
% Initial motivation was simply that doc.sty and related classes \verb
% macro is with a hard-coded \ttfamily. There were further issues.
%
-% 1. with |stuff with space|, paragraph reformatting in the Emacs/AUCTeX
-% buffer caused havoc. Thus I wanted to be able to have the input across
-% lines.
+% 1. With |stuff with space|, paragraph reformatting in the Emacs/AUCTeX
+% buffer caused havoc. Thus I wanted the input to accept linebreaks in
+% its contents.
%
-% 2. Hence I did not want to have spaces obeyed, as often the
-% reformatting added spaces at the beginning of a line.
+% 2. Hence I did not want to have obeyed spaces obeyed, (Emacs reflowing
+% of paragraph in certain contexts often adds spaces at beginning of a line)
%
-% 3. Also I wanted to allow hyphenation on output, at least at some
+% 3. Also I wanted to allow hyphenated output, at least at some
% locations. I did a first version which treated spaces, \, {, and }
% specially.
%
-% 4. at some point I wanted to add some colored background (I have
+% 4. At some point I wanted to add some colored background (I have
% dropped that since due to pdf file size increase).
%
-% 5. and also I got fed up from the non-compatibility with footnotes due
+% 5. And also I got fed up from the non-compatibility with footnotes due
% to catcode freeze.
%
% Because of 5. I opted for a \scantokens approach, hence for a macro
@@ -2957,10 +3038,12 @@ pdfpagemode=UseOutlines}
\relax \ifmmode\else\leavevmode\null\fi
\bgroup
\let\do\@makeother \dospecials
- \MicroFont % change font, color, catcode hooks, ...
- \catcode 32 10
- \endlinechar 32
- \@@jfverb
+ \@ifstar{\@sverb}% \verb* is used in the index, leave it using ambient font
+ {\MicroFont % used to change font (ttbfamily=slashed 0), color,
+ % will make * active via \makestarlowast
+ \catcode 32 10 \endlinechar 32 % allows to fetch across line breaks
+ \frenchspacing % done globally in document
+ \@@jfverb}%
}%
% Note (Oct 12, 2014): in the improbable situation a newlinechar is
% found in the ##1, \scantokens will convert this to an end of line in
@@ -2991,48 +3074,34 @@ pdfpagemode=UseOutlines}
#1\expandafter\@@jfverb_b\fi
}
+% \SoftWrapIcon box for line-breaking using discretionaries
+% =========================================================
+
+\DeclareFontFamily{U}{MdSymbolC}{}
+\DeclareFontShape {U}{MdSymbolC}{m}{n}{<-> MdSymbolC-Regular}{}
+
+\newbox\SoftWrapIcon
+\colorlet {softwrapicon}{blue}
+
+% Emacs/AUCTeX uses very strange comment-like highlighting for \usefont{U}...
+\def\SetSoftWrapIcon{%
+ \setbox\SoftWrapIcon\hb@xt@\z@
+ {\hb@xt@\fontdimen2\font
+ {\hss{\color{softwrapicon}\usefont{U}{MdSymbolC}{m}{n}\char"97}\hss}%
+ \hss}%
+ }
+
+\AtBeginDocument {\SetSoftWrapIcon }% ttzfamily déjà fait
+
\catcode`_ 8
\makeatother
-% --- \lverb
-% Définition de \lverb
-% Has become more complicated for 1.2l
-\makeatletter\catcode`_ 11
-{\catcode32\active%
-\gdef\myobeyspaces{\catcode32\active\def {\leavevmode\kern\fontcharwd\font`X}}}
-\def\lverbpercent {\catcode32\active\lverbpercent_a}%
-\def\lverbpercent_a #1{%
- \if\XINT_sptoken\detokenize{#1}\xint_dothis{\catcode32 10 }\fi
- \if-\detokenize{#1}\xint_dothis{\par #1}\fi
- \if(\detokenize{#1}\xint_dothis{\par\bgroup\myobeyspaces\obeylines}\fi
- \if:\detokenize{#1}\xint_dothis{}\fi
- \if)\detokenize{#1}\xint_dothis{\egroup\everypar{\hskip-\parindent\everypar{}}}\fi
- \ifx#1\lverbpercent\xint_dothis{\catcode32 10 \par #1}\fi
- \xint_orthat{\catcode32 10 #1}%
-}
-\catcode`_ 8
-\long\def\lverb {%
- \relax\par\smallskip\noindent\null
- \begingroup
- \bgroup
- \aftergroup\@@par \aftergroup\endgroup \aftergroup\medskip
- \let\do\do@noligs \verbatim@nolig@list
- \let\do\@makeother \dospecials
- \def\PrivateObelus{\par\noindent\textdiv}%
- \catcode32 10 \catcode`\& 14 \catcode`\$ 0
- \catcode`\% \active
- \begingroup\lccode`\~`\%\lowercase{\endgroup\let~\lverbpercent}%
- \MicroFont % sera donc en couleur.
- \@lverb
-}
+% everbatim environment
+% =====================
-\def\@lverb #1{\catcode`#1\active
- \lccode`\~`#1\lowercase{\let~\egroup}}%
-\makeatother
-%--- everbatim environment
% October 13-14, 2014
% Verbatim with an \everypar hook, mainly to have background color, followed by
-% execution of the code
+% execution of the contents (not limited by a group-scope)
\makeatletter
\catcode`_ 11
@@ -3129,7 +3198,9 @@ pdfpagemode=UseOutlines}
-% --- \everb
+% \everb
+% ======
+%
% Original was called \dverb and I did it in June 2013.
% Then after doing everbatim, I transformed \dverb, now called \everb
% for itself being as compatible as standard verbatim with list making
@@ -3169,60 +3240,10 @@ pdfpagemode=UseOutlines}
\catcode`_8
\makeatother
-%--- \csa, \csbxint, \csh, \csbh
-% dates back to earliest versions of this manual, but I changed things a bit
-% (back then for example @ was active throughout the document...)
-% The mark-up being in place, I only have to use it here.
-
-\DeclareRobustCommand\csa [1]
- {{\MicroFont\char92\endlinechar-1 \catcode`_ 11
- \scantokens\expandafter{\detokenize{#1}}}}
-
-\DeclareRobustCommand\csbnolk [1]
- {{\MicroFont\char92\endlinechar-1 \scantokens\expandafter{\detokenize{#1}}}}
-
-\DeclareRobustCommand\csbxint [1]
- {\hyperref[\detokenize{xint#1}]%
- {{\ttzfamily\char92\mbox{xint}\-\endlinechar-1 \makestarlowast
- \scantokens\expandafter{\detokenize{#1}}}}}
-
-\DeclareRobustCommand\csb [1]
- {\hyperref[\detokenize{#1}]%
- {{\ttzfamily\char92 \endlinechar-1 \makestarlowast
- \scantokens\expandafter{\detokenize{#1}}}}}
-
-\newcommand\csh[1]
- {\texorpdfstring{\csa{#1}}{\textbackslash\detokenize{#1}}}
-\newcommand\csbh[1]
- {\texorpdfstring{\csbnolk{#1}}{\textbackslash\detokenize{#1}}}
-
-% --- \xintname, \xintnameimp etc...
-
-
-
-\xintForpair #1#2 in
-{(xintkernel,kernel),
- (xinttools,tools),
- (xintcore,core),(xint,xint),(xintbinhex,binhex),(xintgcd,gcd),%
- (xintfrac,frac),(xintseries,series),(xintcfrac,cfrac),(xintexpr,expr)}
-\do
-{%
- \expandafter\def\csname #1name\endcsname
- {\texorpdfstring
- {\hyperref[sec:#2]%
- {\relax{\color{joli}\ttzfamily #1}}}
- {#1}%
- \xspace }%
- \expandafter\def\csname #1nameimp\endcsname
- {\texorpdfstring
- {\hyperref[sec:#2imp]%
- {\relax{\color[named]{RoyalPurple}\ttzfamily #1}}}
- {#1}%
- \xspace }%
-}%
+% \printnumber
+% ============
-%--- \printnumber
\catcode`_ 11
\makeatletter
\catcode`& 3
@@ -3242,26 +3263,8 @@ pdfpagemode=UseOutlines}
\makeatother
\catcode`_ 8
-%--- counts used in particular in the samples from the documentation of the
-% xintseries.sty package
-\newcount\cnta
-\newcount\cntb
-\newcount\cntc
-
-%--- \fexpan 22 octobre 2013
-\newcommand\fexpan {\hyperref[ssec:expansions]{\textit{f}-expan}}
-
-\ifnum\dosourcexint=1
-\else
-% Dependency graph done using TikZ (manually)
- \usepackage{tikz}
- \usetikzlibrary{shapes,arrows.meta}
-\fi
-
-\colorlet {codeboxbg}{yellow!10}
-\colorlet {codeboxframe}{black!30}
-\colorlet {execboxfringe}{black!10}
-
+% Parameters for lists
+% ====================
\AtBeginDocument{%
\leftmargini \dimexpr4\fontcharwd\font`X\relax
\leftmarginii\dimexpr3\fontcharwd\font`X\relax
@@ -3280,24 +3283,46 @@ pdfpagemode=UseOutlines}
\cftsubsubsecindent \cftsubsecnumwidth
}%
-\frenchspacing
-\renewcommand\familydefault\sfdefault
+% ==========
+% Hyperlinks
+% ==========
-% Septembre 2015
-\def\liiibigint{\href{http://latex-project.org/svnroot/experimental/trunk/l3trial/l3bigint}{l3bigint}}
+% \csa, \csbxint, \csh etc...
+% ===========================
+% These definitions in force both in manual and implementation part
+\DeclareRobustCommand\csa[1]
+ {{\ttzfamily\char92\endlinechar-1
+ \makestarlowast \catcode`_ 12 \catcode`^ 12
+ \scantokens\expandafter{\detokenize{#1}}}}
+% csan: n means no backslash
+\DeclareRobustCommand\csan[1]
+ {{\ttzfamily\endlinechar-1
+ \makestarlowast \catcode`_ 12 \catcode`^ 12
+ \scantokens\expandafter{\detokenize{#1}}}}
-\makeatletter
-\def\fixmeaning {\expandafter\fix@meaning\meaning}
-\expandafter\edef\expandafter\fix@meaning
- \expandafter #\expandafter1\string\romannumeral#2#3%
- {#1\string\romannumeral`\string^\string^@}
-\makeatother
-
-\xintverbosetrue
-
+\newcommand\csh[1]
+ {\texorpdfstring{\csa{#1}}{\textbackslash\detokenize{#1}}}
+\newcommand\cshn[1]
+ {\texorpdfstring{\csan{#1}}{\detokenize{#1}}}
+% \csh and \cshn will be redefined in implementation section
+\let\cshnolabel\csh
+\let\cshnnolabel\cshn
+
+% These definitions will be re-done for implementation part
+% Don't bother about underscore and caret for time being.
+\DeclareRobustCommand\csb [1]
+ {\hyperref[\detokenize{#1}]%
+ {{\char92 \endlinechar-1 \makestarlowast
+ \scantokens\expandafter{\detokenize{#1}}}}}
+\DeclareRobustCommand\csbxint [1]
+ {\hyperref[\detokenize{xint#1}]%
+ {{\char92\mbox{xint}\-\endlinechar-1 \makestarlowast
+ \scantokens\expandafter{\detokenize{#1}}}}}
+% \func, \funcdesc, \keyword, \keyworddesc, \prec, \precdesc
+% ==========================================================
\newcommand\func[1]{\hyperlink{\detokenize{func-#1}}{#1}()}
\newcommand\funcdesc[2][x]{\item[#2({#1})]\hypertarget{\detokenize{func-#2}}{}}%
@@ -3309,22 +3334,104 @@ pdfpagemode=UseOutlines}
\newcommand\prec[1]{\hyperlink{\detokenize{prec-#1}}{#1}}
\newcommand\precdesc[1]{\item[$#1$]\hypertarget{\detokenize{prec-$#1$}}{}}%
-% \ctexttt is a remnant of 1.09n manual, don't have time to get rid of it now.
-\newcommand\ctexttt [1]{\begingroup\color[named]{DarkOrchid}%\bfseries
- #1\endgroup}
-\begin{document}\thispagestyle{empty}% \ttzfamily already done
+% \xintname, \xintnameimp etc...
+% ==============================
+
+
+\xintForpair #1#2 in
+{(xintkernel,kernel),
+ (xinttools,tools),
+ (xintcore,core),(xint,xint),(xintbinhex,binhex),(xintgcd,gcd),%
+ (xintfrac,frac),(xintseries,series),(xintcfrac,cfrac),(xintexpr,expr)}
+\do
+{%
+ \expandafter\def\csname #1name\endcsname
+ {\texorpdfstring
+ {\hyperref[sec:#2]%
+ {\relax{\color{joli}\MakeNameUp{#1}}}}%
+ {#1}%
+ \xspace }%
+ \expandafter\def\csname #1nameimp\endcsname
+ {\texorpdfstring
+ {\hyperref[sec:#2imp]%
+ {\relax{\color{blue}\MakeNameUp{#1}}}}%
+ {#1}%
+ \xspace }%
+ \expandafter\def\csname #1nameind\endcsname
+ {\texorpdfstring
+ {\hyperref[sec:#2ind]%
+ {\relax{\color[named]{ForestGreen}\MakeNameUp{#1}}}}%
+ {#1}%
+ \xspace }%
+}%
+
+ \def\indexcumulatif
+ {\texorpdfstring
+ {\hyperref[sec:indexcumulatif]%
+ {\relax{\color[named]{ForestGreen}\MakeNameUp{all}}}}%
+ {all}%
+ \xspace }%
+
+ \def\DOCxintindices
+ {\texorpdfstring
+ {\hyperref[sec:indices]%
+ {\relax{\color[named]{ForestGreen}indices}}}%
+ {indices}%
+ \xspace }%
+
+ \def\DOCxintfrontpage
+ {\texorpdfstring
+ {\hyperref[frontpage]{\relax{\color{joli}TOC}}}%
+ {TOC}%
+ \xspace }%
+
+\makeatletter
+\protected\def\MakeNameUp#1{%
+ \ifcsname #1nameUp\endcsname
+ \expandafter\@firstoftwo\else
+ \expandafter\@secondoftwo
+ \fi
+ {\fbox{\textup{#1}}}{#1}}
+\makeatother
+
+% \RaisedLabel
+% ============
+
+% Samedi 16 juin 2018 à 15:23:22
+% trick to see header of target page
+% there is probably better way to use the already in place
+% anchor from \section, but no time to go into hyperref source
+\newcommand\RaisedLabel[2][6]{%
+\vspace*{-#1\baselineskip}%
+\begingroup
+ \let\leavevmode\relax\phantomsection
+ \label{#2}%
+\endgroup
+\vspace*{#1\baselineskip}%
+}
+
+% begin{document}
+% ===============
+% \ttzfamily done at begin document
+
+\begin{document}\thispagestyle{empty}
\pdfbookmark[1]{Title page}{TOP}
-% \makeatletter % @ n'est plus actif dans dtx 1.1, ouf!
{%
\normalfont\Large\parindent0pt \parfillskip 0pt\relax
\leftskip 2cm plus 1fil \rightskip 2cm plus 1fil
\ifnum\dosourcexint=1
The \xintnameimp source code\par
+ \gdef\DOCxintfrontpage
+ {\texorpdfstring
+ {\hyperref[frontpage]{\relax{\color{blue}TOC}}}%
+ {TOC}%
+ \xspace }%
\else
The \xintname bundle\par
\fi
+\RaisedLabel{frontpage}
}
{\centering
@@ -3337,7 +3444,24 @@ pdfpagemode=UseOutlines}
}
\medskip
-% Mercredi 08 octobre 2014 à 22:03:19
+% Vendredi 15 juin 2018
+% Someone makes the comma active (not me! not sure if doc.sty or KOMA) and
+% this derails xspace.sty, in the headers, as it uses \scantokens on a list of
+% tokens, so it fails to recognize the commas which of course are of catcode12
+\def\xintRunningHeader{{\catcode`,12\relax
+ \DOCxintfrontpage,
+ \xintkernelname,
+ \xintcorename,
+ \xintname,
+ \xintfracname,
+ \xintexprname,
+ \xintbinhexname,
+ \xintgcdname,
+ \xintseriesname,
+ \xintcfracname,
+ \xinttoolsname}}
+\markboth{\xintRunningHeader}{\xintRunningHeader}
+
% Skips safely.
\ifnum\dosourcexint=1
\catcode`+ 0 \catcode0 9 % n'importe quoi sauf 15 (car ^^@)
@@ -3348,10 +3472,11 @@ pdfpagemode=UseOutlines}
\newcommand\TeXnote{\par\smallskip\textbf{\TeX hackers note: }}
-\etocsetlevel{toctobookmark}{6} % 9 octobre 2013, je fais des petits tricks.
+\etocsetlevel{toctobookmark}{6}
+
-\etocsettocdepth {subsection}
+\etocsetlevel{table}{2}% subsection
\renewcommand*{\etocbelowtocskip}{0pt}
\renewcommand*{\etocinnertopsep}{0pt}
@@ -3361,32 +3486,13 @@ pdfpagemode=UseOutlines}
\phantomsection\section* {Contents}
\etoctoccontentsline*{toctobookmark}{Contents}{1}%
}
- \etocsettagdepth {description}{subsection}
- \etocsettagdepth {macros}{none}
- \etocsettagdepth {implementation}{none}
-\tableofcontents
-\begingroup\makeatletter
-\etocsetlevel{table}{0}
-\etocsetstyle{table}
- {}
- {\normalfont}
- {%\SKIPSECTIONINTERSPACE
- \rightskip \MARGEPAGENO\relax
- \parfillskip -\MARGEPAGENO\relax
- \leftskip \z@skip
- \noindent\strut \etoclink{Table of \etocthename}%
- \nobreak\leaders\etoctoclineleaders\hfill\nobreak\strut
- \makebox[\MARGEPAGENO][r]{\etocpage}\par
- }%
- {}%
-\etocsettagdepth{description}{table}
-\etocsettagdepth{macros}{none}
-\etocsettagdepth{implementation}{none}
-\etocsettocstyle{}{}
-\medskip
+\etocsettagdepth {description}{subsection}
+\etocsettagdepth {macros}{none}
+\etocsettagdepth {implementation}{none}
+
+\etocsettocdepth{subsection}
\tableofcontents
-\endgroup
\renewcommand*\etocabovetocskip{\bigskipamount}
\makeatletter
@@ -3402,9 +3508,12 @@ pdfpagemode=UseOutlines}
\else
\etocsettagdepth {implementation}{section}
\fi
+
\tableofcontents
+
\etocignoredepthtags
+
\etocmulticolstyle [1]{%
\phantomsection% \section* {Contents}
\etoctoccontentsline*{toctobookmark}{Contents}{2}%
@@ -3428,7 +3537,6 @@ pdfpagemode=UseOutlines}
%
% la version ici est celle avec les * omis: car multiplication tacite devant les
% sous-expressions depuis 1.09j, et aussi devant les parenthèses depuis 1.09k.
-% (pour tester)
\def\Fibonacci #1{%
\expandafter\Fibonacci_a\expandafter
{\the\numexpr #1\expandafter}\expandafter
@@ -3468,8 +3576,6 @@ pdfpagemode=UseOutlines}
\def\Fibo #1.{\Fibonacci {#1}}
-% nice background added for 1.09j release, January 7, 2014.
-% superbe, non? moi très content!
\def\specialprintone #1%
{%
\ifx #1\relax \else \makebox[877496sp]{#1}\hskip 0pt plus 2sp\relax
@@ -3490,21 +3596,18 @@ pdfpagemode=UseOutlines}
}
-% Samedi 27 septembre 2014 à 16:04:52
\pdfbookmark[1]{Dependency graph}{DependencyGraph}
-% ligne allant de xinttools vers xintfrac, car il n'y a plus de dépendance
-% dans \xintXTrunc.
\tikzstyle{block} = [rectangle, draw,
- fill=codeboxbg,
-% fill opacity=0.5,% fill opacity Octobre 2014
- draw=codeboxframe,
+ fill=yellow!10,
+% fill opacity=0.5,
+ draw=black!30,
line width=2pt,
text width=6em, text centered, rounded corners, minimum height=4em]
-\tikzstyle{line} = [draw, line width=1pt, color=codeboxframe]
+\tikzstyle{line} = [draw, line width=1pt, color=black!30]
\vspace*{\stretch{0.3333}}
@@ -3573,7 +3676,7 @@ pdfpagemode=UseOutlines}
\etocdepthtag.toc {description}
-\section{Read this first}\label{sec:quickintro}
+\section{Read this first}\RaisedLabel{sec:quickintro}
This section provides recommended reading on first discovering the package.
@@ -3655,10 +3758,6 @@ All macros from the \xintname packages doing computations are
The reasonable range of use of the package arithmetics is with numbers of
\emph{up to a few hundred digits.}
-% Release |1.2|
-% has significantly improved the speed of the basic operations for numbers
-% with more than $50$ digits, the speed gains getting better for bigger
-% numbers.
Although numbers up to about \dtt{19950} digits are acceptable
inputs, the package is not at his peak efficiency when confronted with such
really big numbers having thousands of digits.\footnotemark
@@ -3858,11 +3957,6 @@ variables need immediately visible balanced parentheses and commas. The
expansion stops only when the ending |\relax| has been found; it is then removed
from the token stream, and the final computation result is inserted.
-Release |1.2| added the (pseudo) functions \func{qint}, \func{qfrac},
-\func{qfloat} to allow swallowing in one-go all digits of a big number,
-fraction, or float, skipping the token by token expansion.
-
-\medskip
Here is an example of a computation:
\begin{everbatim*}
\xinttheexpr (31.567^2 - 21.56*52)^3/13.52^5\relax
@@ -4244,13 +4338,37 @@ file with name |README.md|. Further help and options will be found therein.
This is release \expandafter|\xintbndlversion| of \expandafter|\xintbndldate|.
+For more information: \centeredline{|texdoc --list xint|} and select e.g.\@
+|CHANGES.html|.\centeredline{Internet:
+ \url{http://mirrors.ctan.org/macros/generic/xint/CHANGES.html}}
+
+The formatted source code is available in file |sourcexint.pdf|:
+\centeredline{|texdoc sourcexint|}
+
+\noindent|1.3c|:
+\begin{itemize}[nosep]
+\item adds \csbxint{globaldefstrue} to give global scope to definitions done
+ by \csbxint{defvar}, \csbxint{deffunc}, \csbxint{NewExpr}, et.\@ al.,
+\item \func{qraw},
+\item the colon in the |:=| part of the syntax for
+ \csbxint{defvar} and variants is now optional; and if present it may be
+ an active character or have any (reasonable) catcode.
+\item \csbxint{defvar}, \csbxint{deffunc} and their variants try to set the
+ catcode of the semi-colon which delimits their arguments; of course this
+ will not work if that catcode is already frozen.
+\item \csbxint{UniformDeviate} is better documented and |sourcexint.pdf| is
+ better hyperlinked and includes indices for the macros defined by each
+ package.
+\item since |1.3| release, \xintfracname (hence \xintexprname) loaded
+ \xintgcdname in contradiction to what documentation says. Removed for now.
+\end{itemize}
+
\noindent|1.3b|:
\begin{itemize}[nosep]
-\item \csbxint{UniformDeviate},
-\item \func{random}, \func{qrand}, \func{randrange},
-\item and support macros \csbxint{RandomDigits}, \csbxint{iiRandRange},
- \csbxint{iiRandRangeAtoB},
-\item also \csbxint{XRandomDigits}.
+\item adds \csbxint{UniformDeviate}, \func{random}, \func{qrand},
+ \func{randrange},
+\item and their support macros \csbxint{RandomDigits}, \csbxint{iiRandRange},
+ \csbxint{iiRandRangeAtoB}, also \csbxint{XRandomDigits}.
\end{itemize}
\noindent|1.3a|:
@@ -4281,11 +4399,6 @@ although long existing, had somehow not made it into the user manual yet.
\end{itemize}
\end{itemize}
-See |CHANGES.html| or |CHANGES.pdf| for more information (either |texdoc
---list xint| or on the internet via
-\href{http://mirrors.ctan.org/macros/generic/xint/CHANGES.html}{this link}.)
-
-
\section{The syntax of \xintexprname expressions}
\label{sec:xintexprsyntax}
@@ -4294,11 +4407,7 @@ See |CHANGES.html| or |CHANGES.pdf| for more information (either |texdoc
\subsection{Built-in operators and their precedences}
-% Dimanche 18 décembre 2016
-% \@floatboxreset fait \reset@font=\normalfont et \normalsize
-
-% ancienne version utilisait \ttfamily et ne faisait pas \makestarlowast
\def\MicroFont{\ttbfamily\makestarlowast\color[named]{DarkOrchid}}
\makeatletter
@@ -4358,15 +4467,11 @@ when using variables.
\end{tabular}
\caption{Precedence levels}
\label{tab:precedences}
-\etoctoccontentsline {table}{Precedence levels of operators in expressions}
+\etoctoccontentsline {table}{\textbf{(table)} \protect\emph{Precedence levels of operators}}
\end{table}
The \autoref{tab:precedences} is hyperlinked to the more detailed discussion
-at each level.
-
-
-
-
+at each level.
\begin{description}[parsep=0pt,align=left,itemindent=0pt,
leftmargin=\leftmarginii, labelwidth=\leftmarginii, labelsep=0pt,
@@ -4553,6 +4658,7 @@ at each level.
\subsection{Built-in functions}\label{ssec:builtinfunctions}
+
See \autoref{tab:functions} whose elements are hyperlinked to the
corresponding definitions.
@@ -4568,7 +4674,7 @@ corresponding definitions.
divmod, even, factorial, first, float, floor, frac, gcd, if, ifint, ifone, ifsgn, iter,
iterr, last, lcm, len, max, min, mod, mul, not, num, odd, pfactorial,
preduce, qfloat,
-qfrac, qint, qrand, quo, random, randrange, reduce, rem, reversed, round, rrseq, rseq, seq, sgn, sqr,
+qfrac, qint, qrand, qraw, quo, random, randrange, reduce, rem, reversed, round, rrseq, rseq, seq, sgn, sqr,
sqrt, sqrtr, subs, togl, trunc, xor}
\to\Functions
\cnta\Functions{0}
@@ -4587,9 +4693,12 @@ sqrt, sqrtr, subs, togl, trunc, xor}
\\\hline}%
\end{tabular}
\caption{Functions (click on names)}\label{tab:functions}
-\etoctoccontentsline {table}{Functions in expressions}
+\etoctoccontentsline {table}{\textbf{(table)} \protect\emph{Functions in expressions}}
+\etocsetnexttocdepth{subsubsection}
+\localtableofcontents
\end{table}
+
Miscellaneous notes:
\begin{itemize}[nosep]
\item \func{gcd} and \func{lcm} require explicit loading of \xintgcdname,\IMPORTANT
@@ -4605,29 +4714,34 @@ Miscellaneous notes:
\item \func{bool}, \func{togl} use delimited macros to fetch their argument and the
closing parenthesis must be explicit, it can not arise from
on the spot expansion. The same holds for \func{qint}, \func{qfrac},
- \func{qfloat}, \func{random} and \func{qrand}.
+ \func{qfloat}, \func{qraw}, \func{random} and \func{qrand}.
\item Also \hyperlink{ssec:dummies}{functions with dummy variables} use
delimited macros for some tasks. See the relevant explanations there.
\end{itemize}
-\begin{description}[parsep=0pt,align=left,
- leftmargin=0pt, itemindent=0pt,
- labelwidth=-\fontdimen2\font, labelsep=\fontdimen2\font, labelindent=0pt,
-% leftmargin+itemindent="labelindent"+labelwidth+labelsep
-% leftmargin=labelindent+labelwidth+labelsep* (enumitem)
-% Utiliser \mbox{} et non pas \noindent\par pour bon display
-% (enfin c'était nécessaire avant chgt dans keys ci-dessus, ai oublié ancien
-% attention que listparindent n'est apparemment pas hérité, faut le refaire
- listparindent=\leftmarginiii]
- \item[functions with no argument:]\mbox{}
-\begin{description}[listparindent=\leftmarginiii]% il faut le répéter!
+% \begin{description}[parsep=0pt,align=left,
+% leftmargin=0pt, itemindent=0pt,
+% labelwidth=-\fontdimen2\font, labelsep=\fontdimen2\font, labelindent=0pt,
+% %! leftmargin+itemindent="labelindent"+labelwidth+labelsep
+% %! leftmargin=labelindent+labelwidth+labelsep* (enumitem)
+% %! Utiliser \mbox{} et non pas \noindent\par pour bon display
+% %! (enfin c'était nécessaire avant chgt dans keys ci-dessus, ai oublié ancien
+% %! attention que listparindent n'est apparemment pas hérité, faut le refaire
+% listparindent=\leftmarginiii]
+\subsubsection{Functions with no argument}
- \funcdesc[]{random} returns a random float |0 <= x < 1|, using the prevailing
- precision as set by \csbxint{Digits}: i.e. with |P| being the precision the
- random float multiplied by |10^P| is an integer, uniformly distributed in
- the |0..10^P-1| range.\NewWith{1.3b}
+\begin{description}
+% [parsep=0pt,align=left,
+% leftmargin=0pt, itemindent=0pt,
+% labelwidth=-\fontdimen2\font, labelsep=\fontdimen2\font, labelindent=0pt,
+% listparindent=\leftmarginiii]
+
+ \funcdesc[]{random} returns a random float |x| verifying |0 <= x < 1|. It obeys
+ the prevailing precision as set by \csbxint{Digits}: i.e. with |P| being the
+ precision the random float multiplied by |10^P| is an integer, uniformly
+ distributed in the |0..10^P-1| range.\NewWith{1.3b}
This description implies that if |x| turns out to be |<0.1| then
its (normalized) mantissa has |P-1| digits and a trailing zero, if |x<0.01|
@@ -4641,9 +4755,14 @@ Miscellaneous notes:
\xintthefloatexpr random()\relax\par
\end{everbatim*}
-
- For details regarding generation of random numbers, see
- \csbxint{UniformDeviate}.
+ \begin{framed}
+ Due to the way \csbxint{expr}|...\relax| are handled (see
+ \autoref{ssec:memory}), Monte-Carlo type simulations using expressions may
+ relatively easily exhaust \TeX{} memory.\IMPORTANT\ If possible use
+ \csbxint{NewFloatExpr} to construct from such expressions involving the
+ \func{random} function macros not creating the memory impact which is
+ described in \autoref{ssec:memory}.
+ \end{framed}
\funcdesc[]{qrand} returns a random float |0 <= x < 1| using \dtt{16} digits of
precision (i.e. |10^{16}x| is an integer). This is provided when speed is a
@@ -4678,8 +4797,15 @@ Miscellaneous notes:
\end{everbatim*}
\end{description}
- \item[functions with a single (numeric) argument:]\mbox{}
-\begin{description}[listparindent=\leftmarginiii]% il faut le répéter!
+
+\subsubsection{Functions with a single (numeric) argument}
+
+\begin{description}
+% [parsep=0pt,align=left,
+% leftmargin=0pt, itemindent=0pt,
+% labelwidth=-\fontdimen2\font, labelsep=\fontdimen2\font, labelindent=0pt,
+% listparindent=\leftmarginiii]
+
\funcdesc{num} truncates to the nearest integer (truncation towards zero). It
has the same sign as |x|, except of course with |-1<x<1| as then |num(x)| is
zero.
@@ -4703,10 +4829,50 @@ Miscellaneous notes:
\xintthefloatexpr frac(-355/113), frac(-1129.218921791279)\relax
\end{everbatim*}
- \funcdesc{qint} achieves the same result as |num|, but skips the usual mode of
- operation of the parser which is to expand token by token the input: the
- ending parenthesis must be physically present rather than arising from
- expansion and the argument is grabbed as a whole and handed over to the
+ \funcdesc{reduce} reduces a fraction to smallest terms
+\begin{everbatim*}
+\xinttheexpr reduce(50!/20!/20!/10!)\relax
+\end{everbatim*}
+
+Recall that this is NOT done automatically, for example when adding fractions.
+ \funcdesc{preduce} internally, fractions may have some power of ten part
+ (for example when they got input in scientific notation). This function
+ ignores the decimal part when doing the reduction. See \csbxint{PIrr}.
+\begin{everbatim*}
+\xinttheexpr preduce(10e3/2), reduce(10e3/2)\relax
+\end{everbatim*}
+
+ \funcdesc{abs} absolute value
+ \funcdesc{sgn} sign
+ \funcdesc{floor} floor function.
+ \funcdesc{ceil} ceil function.
+ \funcdesc{sqr} square.
+ \funcdesc{sqrt} in |\xintiiexpr|, truncated square root; in |\xintexpr| or
+ |\xintfloatexpr| this is the floating point square root, and there is an
+ optional second argument for the precision.
+ \funcdesc{sqrtr} in |\xintiiexpr| only, rounded square root.
+ \funcdesc{factorial} factorial function (like the
+ post-fix |!| operator.) When used in |\xintexpr| or
+ |\xintfloatexpr| there is an optional second argument. See discussion later.
+ \funcdesc{?} is the truth value, $1$ if non zero, $0$ if zero. Must use parentheses.
+ \funcdesc{!} is logical not, $0$ if non zero, $1$ if zero. Must use parentheses.
+ \funcdesc{not} logical not.
+ \funcdesc{even} is the evenness of the truncation |num(x)|.
+\begin{everbatim*}
+\xintthefloatexpr [3] seq((x,even(x)), x=-5/2..[1/3]..+5/2)\relax
+\end{everbatim*}
+
+ \funcdesc{odd} is the oddness of the truncation |num(x)|.
+\begin{everbatim*}
+\xintthefloatexpr [3] seq((x,odd(x)), x=-5/2..[1/3]..+5/2)\relax
+\end{everbatim*}
+
+ \funcdesc{qint} belong with \func{qfrac}, \func{qfloat}, \func{qraw} to a
+ special category: they require the closing parenthesis of their argument to
+ be immediately visible, it can not arise from expansion.
+
+ \func{qint} achieves the same result as |num|, but the argument is grabbed
+ as a whole without expansion and handed over to the
\csbxint{iNum} macro. The |q| stands for ``quick'', and |qint| is thought
out for use in \csbxint{iiexpr}|...\relax| with integers having dozens of
digits.
@@ -4755,47 +4921,16 @@ Miscellaneous notes:
|qfrac| to the same effect (the subtraction provoking the rounding of its
two arguments before further processing.)
- \funcdesc{reduce} reduces a fraction to smallest terms
-\begin{everbatim*}
-\xinttheexpr reduce(50!/20!/20!/10!)\relax
-\end{everbatim*}
-
-Recall that this is NOT done automatically, for example when adding fractions.
- \funcdesc{preduce} internally, fractions may have some power of ten part
- (for example when they got input in scientific notation). This function
- ignores the decimal part when doing the reduction. See \csbxint{PIrr}.
-\begin{everbatim*}
-\xinttheexpr preduce(10e3/2), reduce(10e3/2)\relax
-\end{everbatim*}
+\end{description}
- \funcdesc{abs} absolute value
- \funcdesc{sgn} sign
- \funcdesc{floor} floor function.
- \funcdesc{ceil} ceil function.
- \funcdesc{sqr} square.
- \funcdesc{sqrt} in |\xintiiexpr|, truncated square root; in |\xintexpr| or
- |\xintfloatexpr| this is the floating point square root, and there is an
- optional second argument for the precision.
- \funcdesc{sqrtr} in |\xintiiexpr| only, rounded square root.
- \funcdesc{factorial} factorial function (like the
- post-fix |!| operator.) When used in |\xintexpr| or
- |\xintfloatexpr| there is an optional second argument. See discussion later.
- \funcdesc{?} is the truth value, $1$ if non zero, $0$ if zero. Must use parentheses.
- \funcdesc{!} is logical not, $0$ if non zero, $1$ if zero. Must use parentheses.
- \funcdesc{not} logical not.
- \funcdesc{even} is the evenness of the truncation |num(x)|.
-\begin{everbatim*}
-\xintthefloatexpr [3] seq((x,even(x)), x=-5/2..[1/3]..+5/2)\relax
-\end{everbatim*}
+\subsubsection{Functions with an alphabetical argument}
- \funcdesc{odd} is the oddness of the truncation |num(x)|.
-\begin{everbatim*}
-\xintthefloatexpr [3] seq((x,odd(x)), x=-5/2..[1/3]..+5/2)\relax
-\end{everbatim*}
-\end{description}
+\begin{description}
+% [parsep=0pt,align=left,
+% leftmargin=0pt, itemindent=0pt,
+% labelwidth=-\fontdimen2\font, labelsep=\fontdimen2\font, labelindent=0pt,
+% listparindent=\leftmarginiii]
-\item[functions with an alphabetical argument:]\mbox{}
-\begin{description}[listparindent=\leftmarginiii]
\funcdesc[name]{bool}
returns
$1$ if the \TeX{} conditional |\ifname| would act as |\iftrue| and
@@ -4867,8 +5002,15 @@ Recall that this is NOT done automatically, for example when adding fractions.
See also \csbxint{ifboolexpr}, in this context.
\end{description}
-\item[functions with one mandatory and a second but optional argument:]\mbox{}
- \begin{description}[listparindent=\leftmarginiii]
+
+\subsubsection{Functions with one mandatory and a second but optional argument}
+
+\begin{description}
+% [parsep=0pt,align=left,
+% leftmargin=0pt, itemindent=0pt,
+% labelwidth=-\fontdimen2\font, labelsep=\fontdimen2\font, labelindent=0pt,
+% listparindent=\leftmarginiii]
+
\funcdesc[{x[, n]}]{round} Rounds its first argument to a fixed point number, having a
number of digits
after decimal mark given by the second argument. For example
@@ -4927,13 +5069,21 @@ Recall that this is NOT done automatically, for example when adding fractions.
\xinttheiiexpr randrange(1234*10**16, 1235*10**16)\relax\newline
\printnumber{\xinttheiiexpr randrange(10**199,10**200)\relax}\par
\end{everbatim*}
- For details regarding random numbers, see
- \csbxint{UniformDeviate}.
+ For the support macros see \csbxint{RandomDigits}, \csbxint{iiRandRange},
+ \csbxint{iiRandRangeAtoB}. For some details regarding how \xintname
+ uses the engine provided generator of pseudo-random numbers, see
+ \csbxint{UniformDeviate}.
\end{description}
- \item[functions with two arguments:]\mbox{}
- \begin{description}[listparindent=\leftmarginiii]
+\subsubsection{Functions with two arguments}
+
+\begin{description}
+% [parsep=0pt,align=left,
+% leftmargin=0pt, itemindent=0pt,
+% labelwidth=-\fontdimen2\font, labelsep=\fontdimen2\font, labelindent=0pt,
+% listparindent=\leftmarginiii]
+
\funcdesc[f, g]{quo} first truncates the arguments to convert them to integers then
computes the Euclidean quotient. Hence it computes an integer.
\funcdesc[f, g]{rem} first truncates the arguments to convert them to integers then
@@ -5030,12 +5180,9 @@ mod(11/7,1/13)- (11/7)/:(1/13), (11/7)//(1/13)\relax\newline
This example shows also that comparison operators in
|\xintfloatexpr..\relax| act on unrounded operands.
- \funcdesc[x, y]{binomial} computes binomial coefficients. % For some
- % obscure reason the initial version rather than returning zero for
- % |binomial(x,y)| with |y<0| or |x<y| deliberately raised an out-of-range
- % error. This has been fixed in |1.2h|. An error is raised only for
- % |x<0| (or if |x>99999999|.)
- It returns zero if |y<0| or |x<y| and raises an error if |x<0| (or if |x>99999999|.)
+ \funcdesc[x, y]{binomial} computes binomial coefficients.
+ It returns zero if |y<0| or |x<y| and raises an error if |x<0| (or if
+ |x>99999999|.)
\begin{everbatim*}
\xinttheexpr seq(binomial(20, i), i=0..20)\relax
\end{everbatim*}
@@ -5055,6 +5202,14 @@ for the behaviour if the arguments are negative.
\end{description}
+\subsubsection{Functions with 3 or 4 arguments}
+
+\begin{description}
+% [parsep=0pt,align=left,
+% leftmargin=0pt, itemindent=0pt,
+% labelwidth=-\fontdimen2\font, labelsep=\fontdimen2\font, labelindent=0pt,
+% listparindent=\leftmarginiii]
+
\funcdesc[cond,yes,no]{if} (twofold-way conditional)\mbox{}
checks if |cond| is true or false and takes the corresponding
@@ -5079,11 +5234,32 @@ for the behaviour if the arguments are negative.
proceeds correspondingly. All three are evaluated. See also the |??|
operator.
- \item[functions with an arbitrary number of arguments:]\mbox{}
+ \end{description}
+
+\subsubsection{Functions with an arbitrary number of arguments}
+
+ Except for \func{qraw}, this argument may be generated by one or many
+ |a..b| or |a..[d]..b| constructs, separated by commas.
+
+\begin{description}
+% [parsep=0pt,align=left,
+% leftmargin=0pt, itemindent=0pt,
+% labelwidth=-\fontdimen2\font, labelsep=\fontdimen2\font, labelindent=0pt,
+% listparindent=\leftmarginiii]
+
+ \funcdesc[a,b,c,...,z]{qraw} is provided for comma separated values. The
+ input must obide by the suitable format depending on the
+ parser:\NewWith{1.3c} strict integers, or raw fractions, or floats in
+ internal (non-documented) notation. Also, avoid spaces around the commas.
+ The usefulness is when some loop generates hundreds of comma separated
+ values. Without \func{qraw}, each new value means a new usage of a
+ |\csname..\endcsname| for storage of the growing list, with potential
+ impact on \TeX{} memory (see \autoref{ssec:memory}). See \func{qint},
+ \func{qfrac}, \func{qfloat}, the difference being that \func{qraw} does
+ no post-processing at all of its input, apart from complete expansion.
+ This allows it to accept comma separated values, as the internal storage
+ also uses commas.
-This argument may well be generated by one or many |a..b| or |a..[d]..b|
-constructs, separated by commas.
- \begin{description}[listparindent=\leftmarginiii]
\funcdesc[x, y, ...]{all} inserts a logical |AND| in-between its arguments and evaluates the
resulting logical assertion (as for all functions, all arguments are
evaluated, see the |?| operator for ``lazy'' conditional branching; an example
@@ -5124,7 +5300,8 @@ the resulting logical assertion,
\end{everbatim*}
\end{description}
-\item[functions requiring dummy variables:]\hypertarget{ssec:dummies}{}\mbox{}
+\subsubsection{Functions requiring dummy variables}
+\hypertarget{ssec:dummies}{}
The ``functions'' \xintFor #1 in {add, mul, seq, subs, rseq, iter, rrseq,
iterr} \do {\func{#1}\xintifForLast{}{, }} use delimited macros to
@@ -5148,21 +5325,21 @@ know the values which will be assigned to |<letter>|. The special
|<letter>=<integer>++| syntax offers a variant not pre-computing the iterated
over list (which currently must thus proceed by steps of one.)
-
\func{seq}, \func{rseq}, \func{iter}, \func{rrseq},
\func{iterr} but not \func{add}, \func{mul}, \func{subs} admit the
\keyword{omit}, \keyword{abort}, and \keyword{break}|()| keywords. In the case
of a potentially infinite list generated by the |<integer>++| syntax, use of
\keyword{abort} or of \keyword{break}|()| is mandatory, naturally.
-
-
Dummy variables are necessarily single-character letters, and all lowercase and
uppercase Latin letters are pre-configured for that usage.
-% nécessaire de re-spécifier listparindent
+\begin{description}
+% [parsep=0pt,align=left,
+% leftmargin=0pt, itemindent=0pt,
+% labelwidth=-\fontdimen2\font, labelsep=\fontdimen2\font, labelindent=0pt,
+% listparindent=\leftmarginiii]
-\begin{description}[listparindent=\leftmarginiii]
\funcdesc[expr, letter=values]{subs} for variable substitution
\begin{everbatim*}
\xinttheexpr subs(subs(seq(x*z,x=1..10),z=y^2),y=10)\relax\newline
@@ -5322,8 +5499,6 @@ First Fibonacci number at least |2^31| and its index
\end{everbatim*}
\end{description}
-\end{description}
-
Some additional examples are to be found in \autoref{ssec:moredummies}.
\subsection{Tacit multiplication}
@@ -5387,7 +5562,6 @@ differ from\newline\xinttheexpr 1/3*5, (1+2)/(3+4)*(5+6), 2/x*(10), 2/10*x,
Here is an expression whose meaning is
completely modified by the ``tie more'' property of tacit multiplication:
-%\IMPORTANT
\begin{everbatim}
\xintdeffunc e(z):=1+z(1+z/2(1+z/3(1+z/4)));
@@ -5405,13 +5579,6 @@ which is not at all the presumably hoped for:
% \xintdeffunc e(z):=(((z/4+1)z/3+1)z/2+1)z+1;
% \end{everbatim}
-% obsolète depuis 1.2q
- % Attention! tacit multiplication before an opening parenthesis applies
- % always, but tacit multiplication after a closing parenthesis \emph{does
- % not} apply in front of digits: |(1+1)5| is not legal. But
- % |subs((1+1)x,x=5)| is, because in that case a variable is following the
- % closing parenthesis.
-
\subsection{More examples with dummy variables}
\label{ssec:moredummies}
@@ -5543,7 +5710,9 @@ Look at the
% completely inefficient in comparison, and was quite easier to come up with
% than |\Factorize|.
-\subsection{User defined variables}\label{ssec:uservariables}
+\subsection{User defined variables: \csh{xintdefvar}, \csh{xintdefiivar},
+ \csh{xintdeffloatvar}}
+\label{ssec:uservariables}
\label{xintdefvar}
\label{xintdefiivar}
\label{xintdeffloatvar}
@@ -5561,8 +5730,17 @@ $\pi^{100}\approx\xintthefloatexpr Pi^100\relax$\newline
\xinttheiiexpr List\relax\ contains \xinttheiiexpr [List][7]\relax.\par
\end{everbatim*}
+For catcodes issues (particularly, for the semi-colon used to delimit the
+fetched expression), see the discussion of \csbxint{exprSafeCatcodes}.
+\begin{framed}
+ Both syntaxes |\xintdefvar foo := <expr>;| and |\xintdefvar foo = <expr>;|
+ are accepted.\NewWithf{1.3c}
+\end{framed}
+Spaces in the variable name or around the equal sign are removed and are
+immaterial.
+
As shown above a variable can be assigned a "list" value.
-Since |1.2p|, simultaneous assignments are allowed:
+Simultaneous assignments are allowed:
\begin{everbatim*}
\xintdefvar x1, x2, x3 := 3, 10^2, -1;%
\xintdefiivar A, B := 1500, 135;%
@@ -5615,11 +5793,13 @@ as special type of variables called ``dummy variables''. It is allowed to
overwrite their original meanings and assign them values. See further
\csbxint{unassignvar}.
-The assignments are done with \csa{xintdefvar}, \csa{xintdefiivar}, or with
-\csa{xintdeffloatvar}. The variable will be computed using respectively
-\csbxint{expr}, \csbxint{iiexpr} or \csbxint{floatexpr}. Only variables
-defined via \csa{xintdefiivar} can later be used in a \csa{xintiiexpr}
-context.
+The assignments are done with \csa{xintdefvar}, \csa{xintdefiivar}, or
+\csa{xintdeffloatvar} and the variable value will be computed using respectively
+\csbxint{expr}, \csbxint{iiexpr} or \csbxint{floatexpr}. It can then be used
+in all three parsers if the parser understands the format. Currently this
+means that variables using \csa{xintdefvar} or \csa{xintdeffloatvar} can not
+be used in the \csbxint{iiexpr} parser, and variables defined via
+\csa{xintdefiivar} can be used in all parsers.
When defining a variable with \csa{xintdeffloatvar}, it is important to know
that the rounding to \csbxint{theDigits} digits of precision happens inside
@@ -5677,7 +5857,7 @@ Package xintexpr Info: (on line 2892)
\end{everbatim}
-\subsubsection{\csbh{xintunassignvar}}
+\subsubsection{\csh{xintunassignvar}}
\label{xintunassignvar}
Variable declarations are local. But while in the same scope, one can not
@@ -5699,7 +5879,7 @@ recover fully its original meaning as dummy variable in the current scope.
\xinttheiiexpr add(i, i = 1..10)\relax\ ("i" is again a dummy variable)\par
\end{everbatim*}
-\subsubsection{\csbh{xintnewdummy}}
+\subsubsection{\csh{xintnewdummy}}
\label{xintnewdummy}
Any catcode 11 character can serve as a dummy variable, via this declaration:
@@ -5714,17 +5894,17 @@ For example with Xe\TeX\ or Lua\LaTeX\ the following works:
\xinttheexpr add(ξ, ξ=1..10)\relax
\bye
\end{everbatim}
-This macro is a public interface for a functionality existing since |1.2e|.
-\subsection{User defined functions}\label{ssec:userfunctions}
+\subsection{User defined functions: \cshnolabel{xintdeffunc},
+ \cshnolabel{xintdefiifunc}, \cshnolabel{xintdeffloatfunc},
+ \cshnolabel{xintNewFunction}}
+\label{ssec:userfunctions}
\def\HOOKLOCALTOC#1#2#3{}
\etocsetnexttocdepth{subsubsection}\localtableofcontents
\let\HOOKLOCALTOC\empty
-\subsubsection{\csbh{xintdeffunc}}
+\subsubsection{\csh{xintdeffunc}}
\label{xintdeffunc}
-\label{xintdefiifunc}
-\label{xintdeffloatfunc}
Since release |1.2c| it is possible to declare functions:
\begin{everbatim*}
@@ -5736,18 +5916,15 @@ and that |x/2y| is interpreted as |x/(2y)|.)
\begin{framed}
The (dummy) variables used in the function declaration are necessarily single
letters (lowercase or uppercase) which have \emph{not} been re-declared via
- |\xintdefvar| as assigned variables. The choice of the letters is entirely
+ \csbxint{defvar} as assigned variables. The choice of the letters is entirely
up to the user and has nil influence on the actual function, naturally.
A function can have at most nine variables.
%
- % The names of the macros \csa{xintdeffunc}, \csa{xintdefiifunc},
- % \csa{xintdeffloatfunc} (and those for variables) as well as their syntax
- % (with |:=| and an ending |;|) will be set definitely only in next release.
- % \footnotemark
- A function must be defined for a specific parser, using either
- |\xintdeffunc|, |\xintdefiifunc| or |\xintdeffloatfunc|.
+ \csbxint{deffunc} makes the function known only to the \csbxint{expr}
+ parser. See \csbxint{defiifunc} and \csbxint{deffloatfunc} for the two other
+ parsers.\IMPORTANT
Cryptic error messages will signal failures of using with another parser a
function declared for one parser (particularly if the name is a single
@@ -5762,49 +5939,6 @@ Currently, it is not possible to define a function of a single variable, say
|L|, which would stand for a \emph{list} with an undetermined number of
elements (see \autoref{ssec:lists} for lists). This will perhaps be added in future.
-Let's try the famous \textsc{Rump} test:
-\begin{everbatim*}
-\xinttheexpr Rump(77617,33096)\relax.
-\end{everbatim*}
-Nothing problematic for an \emph{exact} evaluation, naturally !
-
-A function may be declared either via \csa{xintdeffunc}, \csa{xintdefiifunc},
-\csa{xintdeffloatfunc}. It will then be known \emph{only} to the parser which
-was used for its definition.\IMPORTANT
-
-Thus to test the \textsc{Rump} polynomial (it is not quite a polynomial with
-its |x/2y| final term) with floats, we \emph{must} also
-declare |Rump| as a function to be used there:
-\begin{everbatim*}
-\xintdeffloatfunc
- Rump(x,y):=333.75 y^6 + x^2 (11 x^2 y^2 - y^6 - 121 y^4 - 2) + 5.5 y^8 + x/2y;
-\end{everbatim*}
-
-The numbers are scanned with the current precision, hence as here it is
-\dtt{16}, they are scanned exactly in this case. We can then vary the
-precision for the evaluation.
-\begin{everbatim*}
-\def\CR{\cr}
-\halign
-{\tabskip1ex
-\hfil\bfseries#&\xintDigits:=\xintiloopindex;\xintthefloatexpr Rump(77617,33096)#\cr
-\xintiloop [8+1]
-\xintiloopindex &\relax\CR
-\ifnum\xintiloopindex<40 \repeat
-}
-\end{everbatim*}
-
-It is licit to overload a variable name (all Latin letters are predefined as
-dummy variables) with a function name and vice versa. The parsers will decide
-from the context if the function or variable interpretation must be used
-(dropping various cases of tacit multiplication as normally applied).
-\begin{everbatim*}
-\xintdefiifunc f(x):=x^3;
-\xinttheiiexpr add(f(f),f=100..120)\relax\newline
-\xintdeffunc f(x,y):=x^2+y^2;
-\xinttheexpr mul(f(f(f,f),f(f,f)),f=1..10)\relax
-\end{everbatim*}
-
The mechanism for functions is identical with the one underlying the
\csbxint{NewExpr} macro. A function once declared is a first class citizen,
its expression is entirely parsed and converted into a big nested \fexpan
@@ -5825,14 +5959,22 @@ xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {#1}{10}}{1}}{#1}}{9}
{1}}{#1}}{2}}{1}}{#1}}{1}
\end{everbatim}
-This has the same limitations as the \csbxint{NewExpr} macro. The main one
-is that dummy variables are usable only to the extent that their values are
-numerical. For example |\xintdeffunc f(x):=add(i^2,i=1..x);| is not possible.
-See \autoref{sssec:limitations} and the next subsection.
+This has the same limitations as the \csbxint{NewExpr} macro. See
+\csbxint{exprSafeCatcodes} for catcode matters.
+
+The main problem is that dummy variables are usable only to the extent that
+their values are numerical. For example
+%
+\centeredline{|\xintdeffunc f(x):=add(i^2,i=1..x);|}
+%
+ is not currently possible. See \autoref{sssec:limitations} and the next
+ subsection.
In this example one could use the alternative syntax with list
-operations:\footnote{It turns out |`+`(seq(i^2, i=1..x))| would work here, but
- this isn't always the case with |seq| constructs.}
+operations:%
+%
+\footnote{It turns out |`+`(seq(i^2, i=1..x))| would work here, but this isn't
+ always the case with |seq| constructs.}
\begin{everbatim*}
\xintdeffunc f(x):=`+`([1..x]^2);\xinttheexpr seq(f(x), x=1..20)\relax
\end{everbatim*}
@@ -5852,65 +5994,28 @@ iterated over do not depend upon the function parameters:
\end{everbatim*}
-\subsubsection{Recursive definitions}\label{sssec:recursive}
+\subsubsection{\csh{xintdefiifunc}}
+\label{xintdefiifunc}
-Since |1.3|, it is possible to make recursive definitions.\NewWith{1.3} Here
-are two examples:
-\begin{everbatim*}
-\xintdeffunc GCD(a,b):=if(b,GCD(b,a/:b),a);
-\end{everbatim*}
-This of course is the Euclide algorithm: it will be here applied to variables
-which may be fractions. For example:
-\begin{everbatim*}
-\xinttheexpr GCD(385/102, 605/238)\relax
-\end{everbatim*}
-There is already (with \xintgcdname loaded) a built-in \func{gcd} (which
-accepts arbitrarily many arguments), but it is the integer-valued one (and it
-truncates its arguments to integers when used in |\xintexpr|).
-\begin{everbatim*}
-\xinttheexpr gcd(385/102, 605/238)\relax % no good!, does gcd(3, 2)
-\end{everbatim*}
+With \csbxint{deffunc} the created function is known by the \csbxint{expr}
+parser only. For usage in the \csbxint{iiexpr} parser, it is required to use
+\csa{xintdefiifunc}.
-Our second example is modular exponentiation:
-\begin{everbatim*}
-\xintdefiifunc powmod_a(x, m, n) :=
- ifone(m,
- % m=1, return x modulo n
- x /: n,
- % m > 1 test if odd or even and do recursive call
- if(odd(m), (x*sqr(powmod_a(x, m//2, n))) /: n,
- sqr(powmod_a(x, m//2, n)) /: n
- )
- );
-\xintdefiifunc powmod(x, m, n) := if(m, powmod_a(x, m, n), 1);
-\end{everbatim*}
-I have made the definition here for the |\xintiiexpr| parser; we could do the
-same for the |\xintexpr|-parser (but its usage with big powers would quickly
-create big denominators, think |powmod(1/2, 1000, 1)| for example.)
-\begin{everbatim*}
-\xinttheiiexpr seq(powmod(x, 1000, 128), x=9, 11, 13, 15, 17, 19, 21)\relax\par
-\end{everbatim*}
-The function assumes the exponent is non-negative (the Python |pow| behaves
-the same), but zealous users will add the necessary code for negative
-exponents, after having defined another function for modular inverse!
+\subsubsection{\csh{xintdeffloatfunc}}
+\label{xintdeffloatfunc}
-It is mandatory for such definitions to use the \func{if} function, and not
-the |(x)?{A}{B}| construct which much choose a branch. The parsing of the
-\func{if} function keeps the memory of the two alternative branches; to the
-contrary, the \emph{constructed} |powmod| function will expand \emph{only} the
-then relevant branch. This is of course absolutely needed for things such as
-the Euclide algorithm where it would be catastrophic to evaluate both branches
-as the first one involves a division by |b| and the algorithm stops only when
-|b| is actually zero.
+With \csbxint{deffunc} the created function is known by the \csbxint{expr}
+parser only. For usage in the \csbxint{floatexpr} parser, it is required to use
+\csa{xintdeffloatfunc}.
-\subsubsection{\csbh{ifxintverbose} conditional}
+\subsubsection{\csh{ifxintverbose} conditional}
\label{xintverbosetrue}
\label{xintverbosefalse}
\label{ifxintverbose}
With |\xintverbosetrue| the meanings of the
functions (or rather their associated macros) will be written to the log. For
-example the first |Rump| declaration above generates this in the log file:
+example the |Rump| declaration above generates this in the log file:
\begin{everbatim}
Function Rump for \xintexpr parser associated to \XINT_expr_userfunc_Rump w
ith meaning macro:#1#2->\xintAdd {\xintAdd {\xintAdd {\xintDiv {\xintMul {1335}
@@ -5936,6 +6041,8 @@ scope, hence this is also the case with the definitions made by
\csbxint{deffunc}.\IMPORTANT{} One can not ``undeclare'' a function, but
naturally one can provide a new definition for it.
+\subsubsection{Functions expanding to comma separated values}
+
It is possible to define functions which expand to comma-separated values, for
example the declarations:
\begin{everbatim*}
@@ -5966,30 +6073,139 @@ does work:
\xinttheexpr add(f*(f+f), f= 1..10)\relax % f is used as variable, not as a function.
\end{everbatim*}
-\subsubsection{\csbh{xintNewFunction}}
+\subsubsection{\csh{ifxintglobaldefs} conditional}
+\label{xintglobaldefstrue}
+\label{xintglobaldefsfalse}
+\label{ifxintglobaldes}
+
+If true user defined variables (\csbxint{defvar}, ...) and functions
+(\csbxint{deffunc}, ...) for the expression parsers,\NewWith{1.3c} as well as
+macros obtained via \csbxint{NewExpr} et al have global scope. If false
+(default) they have local scope.
+
+\subsubsection{Example with the \textsc{Rump} test}
+\label{sssec:Rump}
+
+Let's try out our |Rump()| function:
+\begin{everbatim*}
+\xinttheexpr Rump(77617,33096)\relax.
+\end{everbatim*}
+Nothing problematic for an \emph{exact} evaluation, naturally !
+
+Thus to test the \textsc{Rump} polynomial (it is not quite a polynomial with
+its |x/2y| final term) with floats, we \emph{must} also
+declare |Rump| as a function to be used there:
+\begin{everbatim*}
+\xintdeffloatfunc
+ Rump(x,y):=333.75 y^6 + x^2 (11 x^2 y^2 - y^6 - 121 y^4 - 2) + 5.5 y^8 + x/2y;
+\end{everbatim*}
+
+The numbers are scanned with the current precision, hence as here it is
+\dtt{16}, they are scanned exactly in this case. We can then vary the
+precision for the evaluation.
+\begin{everbatim*}
+\def\CR{\cr}
+\halign
+{\tabskip1ex
+\hfil\bfseries#&\xintDigits:=\xintiloopindex;\xintthefloatexpr Rump(77617,33096)#\cr
+\xintiloop [8+1]
+\xintiloopindex &\relax\CR
+\ifnum\xintiloopindex<40 \repeat
+}
+\end{everbatim*}
+
+\subsubsection{Using the same name for both a variable and a function}
+
+It is licit to overload a variable name (all Latin letters are predefined as
+dummy variables) with a function name and vice versa. The parsers will decide
+from the context if the function or variable interpretation must be used
+(dropping various cases of tacit multiplication as normally applied).
+\begin{everbatim*}
+\xintdefiifunc f(x):=x^3;
+\xinttheiiexpr add(f(f),f=100..120)\relax\newline
+\xintdeffunc f(x,y):=x^2+y^2;
+\xinttheexpr mul(f(f(f,f),f(f,f)),f=1..10)\relax
+\end{everbatim*}
+
+\subsubsection{Recursive definitions}
+\label{sssec:recursive}
+
+Since |1.3|, it is possible to make recursive definitions.\NewWith{1.3} Here
+are two examples:
+\begin{everbatim*}
+\xintdeffunc GCD(a,b):=if(b,GCD(b,a/:b),a);
+\end{everbatim*}
+This of course is the Euclide algorithm: it will be here applied to variables
+which may be fractions. For example:
+\begin{everbatim*}
+\xinttheexpr GCD(385/102, 605/238)\relax
+\end{everbatim*}
+There is already (with \xintgcdname loaded) a built-in \func{gcd} (which
+accepts arbitrarily many arguments), but it is the integer-valued one (and it
+truncates its arguments to integers when used in |\xintexpr|).
+\begin{everbatim*}
+\xinttheexpr gcd(385/102, 605/238)\relax % no good!, does gcd(3, 2)
+\end{everbatim*}
+
+Our second example is modular exponentiation:
+\begin{everbatim*}
+\xintdefiifunc powmod_a(x, m, n) :=
+ ifone(m,
+ % m=1, return x modulo n
+ x /: n,
+ % m > 1 test if odd or even and do recursive call
+ if(odd(m), (x*sqr(powmod_a(x, m//2, n))) /: n,
+ sqr(powmod_a(x, m//2, n)) /: n
+ )
+ );
+\xintdefiifunc powmod(x, m, n) := if(m, powmod_a(x, m, n), 1);
+\end{everbatim*}
+I have made the definition here for the |\xintiiexpr| parser; we could do the
+same for the |\xintexpr|-parser (but its usage with big powers would quickly
+create big denominators, think |powmod(1/2, 1000, 1)| for example.)
+\begin{everbatim*}
+\xinttheiiexpr seq(powmod(x, 1000, 128), x=9, 11, 13, 15, 17, 19, 21)\relax\par
+\end{everbatim*}
+The function assumes the exponent is non-negative (the Python |pow| behaves
+the same), but zealous users will add the necessary code for negative
+exponents, after having defined another function for modular inverse!
+
+It is mandatory for such definitions to use the \func{if} function, and not
+the |(x)?{A}{B}| construct which much choose a branch. The parsing of the
+\func{if} function keeps the memory of the two alternative branches; to the
+contrary, the \emph{constructed} |powmod| function will expand \emph{only} the
+then relevant branch. This is of course absolutely needed for things such as
+the Euclide algorithm where it would be catastrophic to evaluate both branches
+as the first one involves a division by |b| and the algorithm stops only when
+|b| is actually zero.
+
+\subsubsection{\csh{xintNewFunction}}
\label{xintNewFunction}
The syntax is analogous to the one of \csbxint{NewExpr} but achieves something
\emph{completely different} from
-\csa{xintNewExpr}/\csbxint{deffunc}. Here is an example:
+\csbxint{NewExpr}/\csbxint{deffunc}. Here is an example:
\begin{everbatim*}
\xintNewFunction {foo}[3]{add(mul(x+i, i=#1..#2),x=1..#3)}
\end{everbatim*}
-We now have a genuine function |foo( , , )| of three variables which we can
-use fully in the three parsers, be it with numerical arguments or variables or
-whatever.
+\begin{framed}
+ We now have a genuine function |foo( , , )| of three variables which we can
+ use fully in \emph{all three parsers}, be it with numerical arguments or
+ variables or whatever.
+\end{framed}
\begin{everbatim*}
\xinttheexpr seq(foo(0, 3, j), j= 1..10)\relax
\end{everbatim*}
See \autoref{ssec:PrimesIV} for some additional examples.
This construct is only syntactic sugar to benefit from functional notation.
-Each time the function |foo| will be encountered the corresponding expression
-will be inserted as a sub-expression (of the same type as the surrounding
-one), the macro parameters having been replaced with the (already evaluated)
-function arguments, and the parser will then have to parse the expression. It
-is very much like a macro substitution, but with parentheses and comma
-separated arguments (which can be arbitrary expressions themselves).
+Each time the created «function-macro» |foo()| will be encountered the
+corresponding expression will get inserted as a sub-expression (of the same
+type as the surrounding one), the macro parameters having been replaced with
+the (already evaluated) function arguments, and the parser \emph{will then
+ have to parse the expression.} It is very much like a macro substitution,
+but with parentheses and comma separated arguments (which can be arbitrary
+expressions themselves).
\begin{everbatim}
Function foo for the expression parsers is associated to \XINT_expr_macrofu
nc_foo with meaning macro:#1#2#3->add(mul(x+i, i=\XINT_expr_wrapit {#1}..\XINT_
@@ -6143,7 +6359,7 @@ in |([100,300,500,700][2])/11|.
-\subsection{Analogies and differences of \csbh{xintiiexpr} with \csbh{numexpr}}
+\subsection{Analogies and differences of \csh{xintiiexpr} with \csh{numexpr}}
\csbxint{iiexpr}|..\relax| is a parser of expressions knowing only (big)
integers. There are, besides the enlarged range of allowable inputs, some
@@ -6367,24 +6583,24 @@ generate the list via iterated full expansion.
\begin{figure*}[ht!]
\phantomsection\label{fibonacci}
- \newcounter{index}
+ \newcounter{myindex}
\fdef\Fibxxx{\FibonacciN {30}}%
- \setcounter{index}{30}%
+ \setcounter{myindex}{30}%
\centeredline{\tabskip 1ex
\vbox{\halign{\bfseries#.\hfil&#\hfil &\hfil #\cr
\xintFor* #1 in {\FibonacciSeq {30}{59}}\do
- {\theindex &\xintthe#1 &
- \xintiiRem{\xintthe#1}{\xintthe\Fibxxx}\stepcounter{index}\cr }}%
+ {\themyindex &\xintthe#1 &
+ \xintiiRem{\xintthe#1}{\xintthe\Fibxxx}\stepcounter{myindex}\cr }}%
}\vrule
\vbox{\halign{\bfseries#.\hfil&#\hfil &\hfil #\cr
\xintFor* #1 in {\FibonacciSeq {60}{89}}\do
- {\theindex &\xintthe#1 &
- \xintiiRem{\xintthe#1}{\xintthe\Fibxxx}\stepcounter{index}\cr }}%
+ {\themyindex &\xintthe#1 &
+ \xintiiRem{\xintthe#1}{\xintthe\Fibxxx}\stepcounter{myindex}\cr }}%
}\vrule
\vbox{\halign{\bfseries#.\hfil&#\hfil &\hfil #\cr
\xintFor* #1 in {\FibonacciSeq {90}{119}}\do
- {\theindex &\xintthe#1 &
- \xintiiRem{\xintthe#1}{\xintthe\Fibxxx}\stepcounter{index}\cr }}%
+ {\themyindex &\xintthe#1 &
+ \xintiiRem{\xintthe#1}{\xintthe\Fibxxx}\stepcounter{myindex}\cr }}%
}}%
%
\centeredline{Some Fibonacci numbers together with their residues modulo
@@ -6393,24 +6609,25 @@ generate the list via iterated full expansion.
\begingroup\footnotesize\baselineskip10pt
\everb|@
-\newcounter{index}
+\newcounter{myindex}% not "index", which would overwrite theindex environment!
+% (many have probably been bitten by this trap)
\tabskip 1ex
\fdef\Fibxxx{\FibonacciN {30}}%
- \setcounter{index}{30}%
+ \setcounter{myindex}{30}%
\vbox{\halign{\bfseries#.\hfil&#\hfil &\hfil #\cr
\xintFor* #1 in {\FibonacciSeq {30}{59}}\do
- {\theindex &\xintthe#1 &
- \xintiiRem{\xintthe#1}{\xintthe\Fibxxx}\stepcounter{index}\cr }}%
+ {\themyindex &\xintthe#1 &
+ \xintiiRem{\xintthe#1}{\xintthe\Fibxxx}\stepcounter{myindex}\cr }}%
}\vrule
\vbox{\halign{\bfseries#.\hfil&#\hfil &\hfil #\cr
\xintFor* #1 in {\FibonacciSeq {60}{89}}\do
- {\theindex &\xintthe#1 &
- \xintiiRem{\xintthe#1}{\xintthe\Fibxxx}\stepcounter{index}\cr }}%
+ {\themyindex &\xintthe#1 &
+ \xintiiRem{\xintthe#1}{\xintthe\Fibxxx}\stepcounter{myindex}\cr }}%
}\vrule
\vbox{\halign{\bfseries#.\hfil&#\hfil &\hfil #\cr
\xintFor* #1 in {\FibonacciSeq {90}{119}}\do
- {\theindex &\xintthe#1 &
- \xintiiRem{\xintthe#1}{\xintthe\Fibxxx}\stepcounter{index}\cr }}%
+ {\themyindex &\xintthe#1 &
+ \xintiiRem{\xintthe#1}{\xintthe\Fibxxx}\stepcounter{myindex}\cr }}%
}%
|
\endgroup
@@ -6604,9 +6821,6 @@ is intended to clean up the result from dubious last digits.
(and arbitrary exponents) the output coincides exactly with the rounding
of the exact theoretical result (barring overflow or underflow).
-%
-% 2 janvier 2017, j'ai des problèmes en essayant d'utiliser footnotehyper.
-% Pas le temps d'investiguer.
{\footnotesize Due to a typographical oversight, this documentation
(up to |1.2j|) adjoined |^| and |**| to the above list of
@@ -7587,8 +7801,7 @@ input) \dots{}
If a character used in the |\xintexpr| syntax is made active,
this will surely cause problems; prefixing it with |\string| is one option.
There is \csbxint{exprSafeCatcodes} and \csbxint{exprRestoreCatcodes} to
-temporarily turn off potentially active characters (but setting catcodes is an
-un-expandable action).
+temporarily turn off potentially active characters.
\begin{framed}
For advanced \TeX\ users. At loading time of the packages the
@@ -7688,7 +7901,7 @@ at
the same time:
%
\leftedline{\csbxint{Assign}
- |\xintiiDivision{\xintiiPow {2}{1000}}{\xintiiFac{100}}|\csbnolk{to}|\A\B|}
+ |\xintiiDivision{\xintiiPow {2}{1000}}{\xintiiFac{100}}\A\B|}
%
give:
\xintAssign\xintiiDivision{\xintiiPow {2}{1000}}{\xintiiFac{100}}\to\A\B
@@ -7699,7 +7912,7 @@ Another example (which uses \csbxint{Bezout} from the \xintgcdname package):
%
\leftedline{\csbxint{Assign}
%
- |\xintBezout{357}{323}|\csbnolk{to}|\U\V\D|}
+ |\xintBezout{357}{323}\to\U\V\D|}
%
is equivalent to setting |\U| to
\dtt{\tmpU}, |\V| to \dtt{\tmpV}, and |\D| to \dtt{\tmpD}. And indeed
@@ -7723,8 +7936,7 @@ document) is not an opening brace |{|, |\xintAssign| consider that there is
\xintBezout{3570902836026}{200467139463}\to\tmpU\tmpV\tmpD
\leftedline
-{\csbxint{Assign}|\xintBezout{3570902836026}{200467139463}|%
- \csbnolk{to}|\U\V\D|}
+{\csbxint{Assign}|\xintBezout{3570902836026}{200467139463}\to\U\V\D|}
\noindent
gives then |\U| with meaning \dtt{\tmpU},
|\V| with meaning \dtt{\tmpV} and |\D| with meaning \dtt{\tmpD}.
@@ -7733,7 +7945,7 @@ gives then |\U| with meaning \dtt{\tmpU},
In situations when one does not know in advance the number of items, one has
\csbxint{AssignArray} or its synonym \csbxint{DigitsOf}:
%
-\leftedline{\csbxint{DigitsOf}|\xintiiPow{2}{100}|\csbnolk{to}\csa{DIGITS}}
+\leftedline{\csbxint{DigitsOf}|\xintiiPow{2}{100}\to|\csa{DIGITS}}
%
This defines \csa{DIGITS} to be macro with one parameter, \csa{DIGITS}|{0}|
gives the size |N| of the array and \csa{DIGITS}|{n}|, for |n| from |1| to |N|
@@ -8376,7 +8588,6 @@ as they are able to deal with arbitrarily big integers.
}
|
-
As we used \csbxint{For} inside a macro we had to double the |#| in its |#1|
parameter. Here is now the code which creates the prime table (the table has
been put in a \hyperref[primes]{float}, which should be found on page
@@ -8886,9 +9097,9 @@ currently this is implemented by using either |\xintifForFirst| or
\def\n{|{N}|}
\def\m{|{M}|}
\def\x{|{x}|}
-
+\csname xintkernelnameUp\endcsname
\section{Macros of the \xintkernelname package}
-\label{sec:kernel}
+\RaisedLabel{sec:kernel}
\localtableofcontents
@@ -8900,7 +9111,7 @@ bundle.
It provides a few macros possibly useful in other contexts.
-\subsection{\csbh{odef}, \csbh{oodef}, \csbh{fdef}}
+\subsection{\csh{odef}, \csh{oodef}, \csh{fdef}}
\label{odef}
\label{oodef}
\label{fdef}
@@ -8938,7 +9149,7 @@ result has a few dozens of digits. |\oodef| needs thousands of digits it seems
to become competitive.
-\subsection{\csbh{xintReverseOrder}}\label{xintReverseOrder}
+\subsection{\csh{xintReverseOrder}}\label{xintReverseOrder}
\csa{xintReverseOrder}\marg{list}\etype{n} does not do any expansion of its
argument and just reverses the order of the tokens in the \meta{list}. Braces
@@ -8950,7 +9161,7 @@ reversed. Unprotected spaces (of any character code) are gobbled.
\leftedline{gives:
\ttfamily{\string\Stuff\string\to1002\string\xintiiPow\string\xintDigitsOf}}
-\subsection{\csbh{xintLength}}
+\subsection{\csh{xintLength}}
\label{xintLength}
\csa{xintLength}\marg{list}\etype{n} counts how many tokens (or braced items)
@@ -8966,7 +9177,7 @@ which first \fexpan ds its argument and then applies the same code.
\leftedline{${}\neq{}$|\xintLen {\xintiiPow {2}{100}}|\dtt{=\xintLen
{\xintiiPow{2}{100}}}}
-\subsection{\csbh{xintLastItem}}
+\subsection{\csh{xintLastItem}}
\label{xintLastItem}
\csa{xintLastItem}\marg{list}\etype{n} returns the last item (unbraced) of its
@@ -8977,7 +9188,7 @@ See also \csbxint{NthElt}|{-1}| from \xinttoolsname which obtains the same
result (but with another code) after having however \fexpan ded its
argument first.
-\subsection{\csbh{xintreplicate}}
+\subsection{\csh{xintreplicate}}
\label{xintreplicate}
\csa{romannumeral}\csa{xintreplicate}|{x}|\marg{stuff}\etype{\numx n} is simply
@@ -8994,7 +9205,7 @@ and does nothing.%
Note that expansion must be triggered by a |\romannumeral|.
-\subsection{\csbh{xintgobble}}
+\subsection{\csh{xintgobble}}
\label{xintgobble}
\csa{romannumeral}\csa{xintgobble}|{x}|\etype{\numx} is a Gobbling macro
@@ -9018,7 +9229,7 @@ I wrote an \csa{xintcount} in the same spirit as \csa{xintreplicate} and
\csa{xintgobble}. But it needs to be counting hundreds of tokens to be worth
its salt compared to \csbxint{Length}.
-\subsection{(WIP) \csbh{xintUniformDeviate}}
+\subsection{(WIP) \csh{xintUniformDeviate}}
\label{xintUniformDeviate}
\csa{xintUniformDeviate}|{x}|\etype{\numx} is a wrapper of engine
@@ -9035,10 +9246,12 @@ positive, or minimal value \dtt{x+1} and maximal value \dtt{0} if |x| is
negative. For the discussion next, |x| is supposed positive as this
avoids having to insert absolute values in formulas.
-The underlying engine Random Number Generator works with a stream of 28bits
-integers. To produce a « uniform » random integer in range \dtt{0..x-1} it
-proceeds by a rescaling |round(x/2^{28}*random)| (with |x| mapped to zero).
-This has following corollaries:
+The underlying engine Random Number Generator works with an array of 55 28bits
+integers. To produce a « uniform » random integer in a given range
+\dtt{0..x-1} it produces next pseudo-random |y| (supposedly uniformly
+distributed, i.e. non-uniformity can be neglected) such that \dtt{$0\leq y <
+ 2^{28}$} and the output is the rounding of \dtt{$x*(y/2^{28})$}, with upper
+bound |x| remapped to |0|. This has following corollaries:
\begin{enumerate}
\item with |x=2^{29}| or |x=2^{30}| the engine primitive produces only even
numbers,
@@ -9065,30 +9278,73 @@ for the distribution of random integers in any given range |x|.
\verb$(1+e(y))/x$, the ``{relative non-uniformity}'' for that value |y| is
\verb$|e(y)|$.}
-The engine primitive guarantees only |x/2^{28}| relative non-uniformity, and
+The engine primitive guarantees only \dtt{$x/2^{28}$} relative non-uniformity, and
\csa{xintUniformDeviate} (in its current implementation) improves this by
a factor \dtt{|2^{28}=|\number"10000000}: the non-uniformity is guaranteed to
-be bounded by |x/2^{56}|.%
+be bounded by \dtt{$x/2^{56}$}.%
%
-\footnote{These estimates assume that the engine RNG underlying stream of
+\expandafter\footnote\expandafter{\ifnum\value{footnote}=55 This «56» is proof
+ of existence of devil, no? \fi These estimates assume that the engine RNG underlying stream of
28-bits integers can be considered uniform; it is known that the
parity bits of these 28-bits integers have a period of |55(2^{55}-1)| and
that after that many draws the count of 1s has only an excess of 55 compared
to the count of 0s, so the scale seems to be an intrinsic non-uniformity of
|2^{-55}| but it is not obvious if it applies to much shorter ranges. At any
rate we assumed that the non-uniformity for |x| a power of two less than
- |2^{-28}| is negligible in comparison to |2^{-28}|. Bigger powers of 2
+ |2^{28}| is negligible in comparison to |2^{-28}|. Bigger powers of 2
produce only even integers because the output is rescaled by
factor |x/2^{28}|!}
%
With such a small non-uniformity, modulo phenomena as mentioned earlier are
-not observable in reasonable computing time.
+not observable in reasonable computing time.%
+%
+\footnote{The function \func{qraw} is used here not so much to speed up the
+ loop expansion, but in relation to \autoref{ssec:memory} to avoid too much
+ usage of |\csname...\endcsname| storage. Besides, if we had used |mod3|
+ function we would have needed |\xinttheiiexpr mod3(\pdfun...)\relax|
+ wrapping for each individual macro. So we decided rather to use a macro
+ |\ModThree|; of course we could have used |\numexpr|, with the technical
+ problem to expand only once |\pdfuniformdeviate|, which would have led to
+ some extra manoeuver, so ok for |\ModThree|.}
+%
\begin{everbatim*}
+%\xintdefiifunc mod3(x):= x 'mod' 3;
+\xintNewIIExpr\ModThree[1]{#1 'mod' 3}
+
\pdfsetrandomseed 87654321
-bad!: \romannumeral\xintreplicate{84}%
- {\xinttheiiexpr\pdfuniformdeviate "C000000 'mod' 3\relax}\newline
-good: \romannumeral\xintreplicate{84}%
- {\xinttheiiexpr\xintUniformDeviate{"C000000} 'mod' 3\relax}
+\xintdefiivar BadDigits:=qraw(%
+ \romannumeral\xintreplicate{503}{\ModThree{\pdfuniformdeviate "C000000},}%
+ \ModThree{\pdfuniformdeviate "C000000}%
+);% 504=503+1
+
+\pdfsetrandomseed 87654321
+\xintdefiivar GoodDigits:=qraw(%
+ \romannumeral\xintreplicate{503}{\ModThree{\xintUniformDeviate{"C000000}},}%
+ \ModThree{\xintUniformDeviate{"C000000}}%
+);% 504=503+1
+
+These 504 digits generated from \string\pdfuniformdeviate:
+\xinttheiiexpr BadDigits\relax\hfill\break
+contain these respective amounts of 0, 1, and 2:
+% (this is definitely not the fastest way to count, but it is fun - and expandable)
+\xinttheiiexpr iter(0,0,0;(i=0)?{[@][0]+1,[@][1],[@][2]}
+ {(i=1)?{[@][0],[@][1]+1,[@][2]}
+ {[@][0],[@][1],[@][2]+1}},
+ i=BadDigits)\relax\par
+
+These 504 digits generated from \string\xintUniformDeviate:
+\xinttheiiexpr GoodDigits\relax\hfill\break
+contain these respective amounts of 0, 1, and 2:
+\xinttheiiexpr iter(0,0,0;(i=0)?{[@][0]+1,[@][1],[@][2]}
+ {(i=1)?{[@][0],[@][1]+1,[@][2]}
+ {[@][0],[@][1],[@][2]+1}},
+ i=GoodDigits)\relax\par
+% % output to data file for double-check with python
+% \newwrite\out
+% \immediate\openout\out=\jobname.data
+% \immediate\write\out{Lbad=[\xinttheiiexpr BadDigits\relax]}
+% \immediate\write\out{Lgood=[\xinttheiiexpr GoodDigits\relax]}
+% \immediate\closeout\out
\end{everbatim*}
There is a second peculiarity of the engine RNG: two seeds sharing the same
@@ -9124,29 +9380,50 @@ It would be nice if the engine provided some user interface for
\par
\smallskip
-Currently the implementation of \csbxint{UniformDeviate} consumes exactly 5
-calls to the underlying primitive at each execution; the improved |x/2^{56}|
+\TeXnote
+currently the implementation of \csbxint{UniformDeviate} consumes exactly 5
+calls to the engine primitive at each execution; the improved |x/2^{56}|
non-uniformity could be obtained with only 2 calls, but paranoïa about the
phenonemon of seeds with common bits has led me to accept the overhead of
using the 7 high bits of 4 random 28bits integers, rather than one single
28bits integer, or two, or three.
-If such random integers are to be used in some type of numerical computations,
-chances are that the impact will be small on timings; if however the random
-integers are used in very small code snippets, then it may be that using
-directly the engine primitive would bring noticeable time gains; but up to the
-price however of loss of uniformity and higher possible correlations across
-series, thus it is your choice.
-
-\TeXnote arithmetic expressions are more costly than invocations of the
-uniformdeviate engine primitive themselves. The \func{random}, \func{qrand},
-\func{randrange} functions generate random digits as if with
-\csbxint{UniformDeviate}|{100000000}| but via a simplified |\numexpr|-ession
-made possible from the range being a power of ten.
+Timings indicate that one \csbxint{UniformDeviate} has a time cost about 13
+times the one for one call to the engine primitive (and not only 5, as the
+extra arithmetic expressions add overhead which is more costly than the
+primitive itself). Except if the code using the pseudo-random number is very
+short, this time penalty will prove in practice much less severe (and this is
+one important reason why we opted for obtaining 28bits via the 7 high bits of
+4 successive pseudo random numbers from the engine primitive). For example
+let's raise a 100 times a random integer to the tenth power:
+%
+\footnote{This is done on a |2.4GHz| processor.}
+%
+\begin{everbatim*}
+\pdfsetrandomseed 12345678
+\pdfresettimer\romannumeral\xintreplicate
+ {100}{\fdef\x{\xintiiPow{\xintUniformDeviate{100000000}}{10}}}%
+\the\dimexpr\pdfelapsedtime sp\relax\space (with \string\xintUniformDeviate)\newline
+(last result: \x)\newline
+\pdfsetrandomseed 12345678
+\pdfresettimer\romannumeral\xintreplicate
+ {100}{\fdef\x{\xintiiPow{\pdfuniformdeviate 100000000}{10}}}%
+\the\dimexpr\pdfelapsedtime sp\relax\space (with \string\pdfuniformdeviate)\newline
+(last result: \x)\par
+\end{everbatim*}
+
+\TeXnote
+the macros \csbxint{RandomDigits} or \csbxint{iiRandRange}, and their
+variants, as well as the supporting macros for \func{random} generate random
+decimal digits eight by eight as if using
+\csa{xintUniformDeviate}|{100000000}|, but via a direct optimized call made
+possibly by the range being a power of 10.
\clearpage
+\let\xintkernelnameUp\undefined
+\csname xintcorenameUp\endcsname
\section{Macros of the \xintcorename package}
-\label{sec:core}
+\RaisedLabel{sec:core}
\localtableofcontents
@@ -9215,7 +9492,7 @@ The {\color[named]{PineGreen}$\star$}'s in the margin are there to remind of
the complete expandability, even \fexpan dability of the macros, as discussed
in \autoref{ssec:expansions}.
-\subsection{\csbh{xintiNum}}\label{xintiNum}
+\subsection{\csh{xintiNum}}\label{xintiNum}
|\xintiNum|\n\etype{f} removes chains of plus or minus signs, followed by
zeroes.
@@ -9223,56 +9500,56 @@ zeroes.
\xintiNum{+---++----+--000000000367941789479}
\end{everbatim*}
-\subsection{\csbh{xintDouble}}\label{xintDouble}
+\subsection{\csh{xintDouble}}\label{xintDouble}
|\xintDouble|\n\etype{f} computes |2N|.
-\subsection{\csbh{xintHalf}}\label{xintHalf}
+\subsection{\csh{xintHalf}}\label{xintHalf}
|\xintHalf|\n\etype{f} computes |N/2|
truncated towards zero.
-\subsection{\csbh{xintInc}}\label{xintInc}
+\subsection{\csh{xintInc}}\label{xintInc}
|\xintInc|\n\etype{f} evaluates |N+1|.
-\subsection{\csbh{xintDec}}\label{xintDec}
+\subsection{\csh{xintDec}}\label{xintDec}
|\xintDec|\n\etype{f} evaluates |N-1|.
-\subsection{\csbh{xintDSL}}\label{xintDSL}
+\subsection{\csh{xintDSL}}\label{xintDSL}
|\xintDSL|\n\etype{f} is decimal shift left, \emph{i.e.} multiplication by
ten.
-\subsection{\csbh{xintDSR}}\label{xintDSR}
+\subsection{\csh{xintDSR}}\label{xintDSR}
|\xintDSR|\n\etype{f} is truncated decimal shift right, \emph{i.e.} it is the
truncation of |N/10| towards zero.
-\subsection{\csbh{xintDSRr}}\label{xintDSRr}
+\subsection{\csh{xintDSRr}}\label{xintDSRr}
|\xintDSRr|\n\etype{f} is rounded decimal shift right, \emph{i.e.} it is the
rounding of |N/10| away from zero. It is needed in \xintcorename for use by
\csbxint{iiDivRound}.
-\subsection{\csbh{xintFDg}}\label{xintFDg}
+\subsection{\csh{xintFDg}}\label{xintFDg}
|\xintFDg|\n\etype{f} outputs the first digit (most significant) of the
number.
-\subsection{\csbh{xintLDg}}\label{xintLDg}
+\subsection{\csh{xintLDg}}\label{xintLDg}
|\xintLDg|\n\etype{f} outputs the least significant digit. When the number
is positive, this is the same as the remainder in the Euclidean division by
ten.
-\subsection{\csbh{xintiiSgn}}\label{xintiiSgn}
+\subsection{\csh{xintiiSgn}}\label{xintiiSgn}
|\xintiiSgn|\n\etype{f} returns 1 if the number is positive, 0 if it is zero
and -1 if it is negative.
-\subsection{\csbh{xintiiOpp}}\label{xintiiOpp}
+\subsection{\csh{xintiiOpp}}\label{xintiiOpp}
|\xintiiOpp|\n\etype{f} outputs the opposite |-N| of the number |N|.
@@ -9283,34 +9560,34 @@ sion done during parsing of the inputs. One must use the syntax
|\xintiiOpp{\foo}| if one wants to pass |-\foo| as
argument to other macros.
-\subsection{\csbh{xintiiAbs}}\label{xintiiAbs}
+\subsection{\csh{xintiiAbs}}\label{xintiiAbs}
|\xintiiAbs|\n\etype{f} outputs the absolute value of the number.
-\subsection{\csbh{xintiiAdd}}\label{xintiiAdd}
+\subsection{\csh{xintiiAdd}}\label{xintiiAdd}
|\xintiiAdd|\n\m\etype{ff} computes the sum of the two (big) integers.
-\subsection{\csbh{xintiiCmp}}\label{xintiiCmp}
+\subsection{\csh{xintiiCmp}}\label{xintiiCmp}
|\xintiiCmp|\n\m\etype{ff} produces \dtt{1} if |N>M|, \dtt{0} if |N=M|,
and \dtt{-1} if |N<M|.
At |1.2l| this macro was moved from package \xintname to \xintcorename.
-\subsection{\csbh{xintiiSub}}\label{xintiiSub}
+\subsection{\csh{xintiiSub}}\label{xintiiSub}
|\xintiiSub|\n\m\etype{ff} computes the difference |N-M|.
-\subsection{\csbh{xintiiMul}}\label{xintiiMul}
+\subsection{\csh{xintiiMul}}\label{xintiiMul}
|\xintiiMul|\n\m\etype{ff} computes the product of two (big) integers.
-\subsection{\csbh{xintiiSqr}}\label{xintiiSqr}
+\subsection{\csh{xintiiSqr}}\label{xintiiSqr}
|\xintiiSqr|\n\etype{f} produces the square.
-\subsection{\csbh{xintiiPow}}\label{xintiiPow}
+\subsection{\csh{xintiiPow}}\label{xintiiPow}
|\xintiiPow|\n\x\etype{f\numx} computes |N^x|. For |x=0|, this is 1. For |N=0|
and |x<0|, or if \verb+|N|>1+ and |x<0|, an error is raised. There will also
@@ -9336,7 +9613,7 @@ settings of some \TeX\ memory parameters.
% that I can hardly go on working on it! And it takes about 12 minutes for each
% |\xintiiPow2{N}| with such |N|'s of the order of $130000$ (a.t.t.o.w.).
-\subsection{\csbh{xintiiFac}}\label{xintiiFac}
+\subsection{\csh{xintiiFac}}\label{xintiiFac}
|\xintiiFac|\x\etype{\numx} computes the factorial.
@@ -9361,7 +9638,7 @@ used in \csbxint{floatexpr}.
-\subsection{\csbh{xintiiDivision}}\label{xintiiDivision}
+\subsection{\csh{xintiiDivision}}\label{xintiiDivision}
|\xintiiDivision|\m\n\etype{ff} produces |{quotient}{remainder}|, in the sense
@@ -9370,16 +9647,16 @@ of (mathematical) Euclidean division: |M = QN + R|,
formula |M = QN + R| always holds independently of the signs of |N| or |M|.
Division by zero is an error (even if |M| vanishes) and returns |{0}{0}|.
-\subsection{\csbh{xintiiQuo}}\label{xintiiQuo}
+\subsection{\csh{xintiiQuo}}\label{xintiiQuo}
|\xintiiQuo|\m\n\etype{ff} computes the quotient from the Euclidean division.
-\subsection{\csbh{xintiiRem}}\label{xintiiRem}
+\subsection{\csh{xintiiRem}}\label{xintiiRem}
|\xintiiRem|\m\n\etype{ff} computes the remainder from the Euclidean
division.
-\subsection{\csbh{xintiiDivRound}}\label{xintiiDivRound}
+\subsection{\csh{xintiiDivRound}}\label{xintiiDivRound}
|\xintiiDivRound|\m\n\etype{ff} returns the rounded value of the algebraic
quotient $M/N$ of two big integers. The rounding is ``away from zero.''
@@ -9387,7 +9664,7 @@ quotient $M/N$ of two big integers. The rounding is ``away from zero.''
\xintiiDivRound {100}{3}, \xintiiDivRound {101}{3}
\end{everbatim*}
-\subsection{\csbh{xintiiDivTrunc}}\label{xintiiDivTrunc}
+\subsection{\csh{xintiiDivTrunc}}\label{xintiiDivTrunc}
|\xintiiDivTrunc|\m\n\etype{ff} computes $trunc(M/N)$. For positive arguments
$M,N>0$ it is the same as the Euclidean quotient \csbxint{iiQuo}.
@@ -9399,7 +9676,7 @@ $M,N>0$ it is the same as the Euclidean quotient \csbxint{iiQuo}.
\xintiiQuo{-1000}{-57}, \xintiiDivTrunc{-1000}{-57} (t), \xintiiDivRound{-1000}{-57} (r)\par
\end{everbatim*}
-\subsection{\csbh{xintiiDivFloor}}\label{xintiiDivFloor}
+\subsection{\csh{xintiiDivFloor}}\label{xintiiDivFloor}
|\xintiiDivFloor|\m\n\etype{ff} computes $floor(M/N)$. For positive divisor
$N>0$ and arbitrary dividend $M$ it is the same as the Euclidean quotient
@@ -9411,7 +9688,7 @@ $N>0$ and arbitrary dividend $M$ it is the same as the Euclidean quotient
\xintiiQuo{-1000}{-57}, \xintiiDivFloor{-1000}{-57}\par
\end{everbatim*}
-\subsection{\csbh{xintiiMod}}\label{xintiiMod}
+\subsection{\csh{xintiiMod}}\label{xintiiMod}
|\xintiiMod|\m\n\etype{ff} computes $M - N*floor(M/N)$. For positive divisor
$N>0$ and arbitrary dividend $M$ it is the same as the Euclidean remainder
@@ -9427,7 +9704,7 @@ retained as \csa{xintiiModTrunc}.
\xintiiRem {-1000}{-57}, \xintiiMod {-1000}{-57}, \xintiiModTrunc {-1000}{-57}\par
\end{everbatim*}
-\subsection{\csbh{xintNum}}\label{xintNum}
+\subsection{\csh{xintNum}}\label{xintNum}
|\xintNum|\etype{f} is originally an alias for \csbxint{iNum}. But with
\xintfracname loaded its meaning is \hyperref[xintNumFrac]{modified} to accept
@@ -9460,8 +9737,10 @@ called |\xintiCmp| actually),
\clearpage
+\let\xintcorenameUp\undefined
+\csname xintnameUp\endcsname
\section{Macros of the \xintname package}
-\label{sec:xint}
+\RaisedLabel{sec:xint}
This package loads automatically \xintcorename (and \xintkernelname) hence
all macros described in \autoref{sec:core} are still available.
@@ -9522,7 +9801,7 @@ margin annotations.
-\subsection{\csbh{xintiLen}}\label{xintiLen}
+\subsection{\csh{xintiLen}}\label{xintiLen}
|\xintiLen|\n\etype{\Numf} returns the length of the number, after its parsing
via \csbxint{iNum}. The count does not include the sign.
@@ -9534,7 +9813,7 @@ Prior to |1.2o|, the package defined only \csbxint{Len}, which is extended by
\xintfracname to fractions or decimal numbers, hence acquires a bit more
overhead then.
-\subsection{\csbh{xintReverseDigits}} \label{xintReverseDigits}
+\subsection{\csh{xintReverseDigits}} \label{xintReverseDigits}
|\xintReverseDigits|\n\etype{f} will reverse the order of the digits of the
number. \csa{xintRev} is the former denomination and is kept as an alias.
@@ -9554,7 +9833,7 @@ upfront in the output.
\end{everbatim*}
\endgroup
-\subsection{\csbh{xintDecSplit}}
+\subsection{\csh{xintDecSplit}}
\label{xintDecSplit}
|\xintDecSplit|\x\n\etype{\numx f} cuts the |N| (a list of digits) into two
@@ -9580,7 +9859,7 @@ Breaking change with |1.2i|: formerly |N<0| was replaced by its
absolute value. Now, a sign (positive or negative) will create an error.
-\subsection{\csbh{xintDecSplitL}, \csbh{xintDecSplitR}}
+\subsection{\csh{xintDecSplitL}, \csh{xintDecSplitR}}
\label{xintDecSplitL}
\label{xintDecSplitR}
@@ -9590,7 +9869,7 @@ the \csa{xintDecSplit} output.
\noindent|\xintDecSplitR|\x\n\etype{\numx f} returns the second piece
(unbraced) from the \csa{xintDecSplit} output.
-\subsection{\csbh{xintiiE}}\label{xintiiE}
+\subsection{\csh{xintiiE}}\label{xintiiE}
|\xintiiE|\n\x\etype{f\numx } serves to extend |N| with |x| zeroes. The
parameter |x| must be non-negative. The same output would be obtained via
@@ -9601,7 +9880,7 @@ by |10^x| hence produces |0| if |N=0| whereas
\xintiiE {0}{91}\par
\end{everbatim*}
-\subsection{\csbh{xintDSH}}\label{xintDSH}
+\subsection{\csh{xintDSH}}\label{xintDSH}
|\xintDSH|\x\n\etype{\numx f} is parametrized decimal shift. When |x| is
negative, it is like iterating \csbxint{DSL} \verb+|x|+ times (\emph{i.e.}
@@ -9609,7 +9888,7 @@ multiplication by $10^{-x}$). When |x| positive, it is like iterating
\csbxint{DSR} |x| times (and is more efficient), and for a non-negative |N|
this is thus the same as the quotient from the Euclidean division by |10^x|.
-\subsection{\csbh{xintDSHr}, \csbh{xintDSx}}\label{xintDSHr}\label{xintDSx}
+\subsection{\csh{xintDSHr}, \csh{xintDSx}}\label{xintDSHr}\label{xintDSx}
|\xintDSHr|\x\n\etype{\numx f} expects |x| to be zero or positive and it
returns then a value |R| which is correlated to the value |Q| returned by
@@ -9636,16 +9915,16 @@ positive it returns the two numbers |{Q}{R}| described above, each one within
braces. So |Q| is |\xintDSH|\x\n, and |R| is |\xintDSHr|\x\n, but computed
simultaneously.
-\subsection{\csbh{xintiiEq}}\label{xintiiEq}
+\subsection{\csh{xintiiEq}}\label{xintiiEq}
|\xintiiEq|\n\m\etype{ff} returns 1 if |N=M|, 0 otherwise.
-\subsection{\csbh{xintiiNotEq}}\label{xintiiNotEq}
+\subsection{\csh{xintiiNotEq}}\label{xintiiNotEq}
|\xintiiNotEq|\n\m\etype{ff} returns 0 if |N=M|, 1 otherwise.
-\subsection{\csbh{xintiiGeq}}\label{xintiiGeq}
+\subsection{\csh{xintiiGeq}}\label{xintiiGeq}
|\xintiiGeq|\n\m\etype{ff} returns 1 if the \emph{absolute value}
of the first number is at least equal to the absolute value of the second
@@ -9653,64 +9932,64 @@ number. If \verb+|N|<|M|+ it returns 0.
Important: the macro compares \emph{absolute values}.
-\subsection{\csbh{xintiiGt}}\label{xintiiGt}
+\subsection{\csh{xintiiGt}}\label{xintiiGt}
|\xintiiGt|\n\m\etype{ff} returns 1 if |N|$>$|M|, 0 otherwise.
-\subsection{\csbh{xintiiLt}}\label{xintiiLt}
+\subsection{\csh{xintiiLt}}\label{xintiiLt}
|\xintiiLt|\n\m\etype{ff} returns 1 if |N|$<$|M|, 0 otherwise.
-\subsection{\csbh{xintiiGtorEq}}\label{xintiiGxstorEq}
+\subsection{\csh{xintiiGtorEq}}\label{xintiiGxstorEq}
|\xintiiGtorEq|\n\m\etype{ff} returns 1 if |N|$\geqslant$|M|, 0 otherwise.
Extended by \xintfracname to fractions.
-\subsection{\csbh{xintiiLtorEq}}\label{xintiiLtorEq}
+\subsection{\csh{xintiiLtorEq}}\label{xintiiLtorEq}
|\xintiiLtorEq|\n\m\etype{ff} returns 1 if |N|$\leqslant$|M|, 0 otherwise.
-\subsection{\csbh{xintiiIsZero}}\label{xintiiIsZero}
+\subsection{\csh{xintiiIsZero}}\label{xintiiIsZero}
|\xintiiIsZero|\n\etype{f} returns 1 if |N=0|, 0 otherwise.
-\subsection{\csbh{xintiiIsNotZero}}\label{xintiiIsNotZero}
+\subsection{\csh{xintiiIsNotZero}}\label{xintiiIsNotZero}
|\xintiiIsNotZero|\n\etype{f} returns 1 if |N!=0|, 0 otherwise.
-\subsection{\csbh{xintiiIsOne}}\label{xintiiIsOne}
+\subsection{\csh{xintiiIsOne}}\label{xintiiIsOne}
|\xintiiIsOne|\n\etype{f} returns 1 if |N=1|, 0 otherwise.
-\subsection{\csbh{xintiiOdd}}\label{xintiiOdd}
+\subsection{\csh{xintiiOdd}}\label{xintiiOdd}
|\xintiiOdd|\n\etype{f} is 1 if the number is odd and 0 otherwise.
-\subsection{\csbh{xintiiEven}}\label{xintiiEven}
+\subsection{\csh{xintiiEven}}\label{xintiiEven}
|\xintiiEven|\n\etype{f} is 1 if the number is even and 0 otherwise.
-\subsection{\csbh{xintiiMON}}\label{xintiiMON}
+\subsection{\csh{xintiiMON}}\label{xintiiMON}
|\xintiiMON|\n\etype{f} computes |(-1)^N|.
\begin{everbatim*}
\xintiiMON {-280914019374101929}
\end{everbatim*}
-\subsection{\csbh{xintiiMMON}}\label{xintiiMMON}
+\subsection{\csh{xintiiMMON}}\label{xintiiMMON}
|\xintiiMMON|\n\etype{f} computes |(-1)^{N-1}|.
\begin{everbatim*}
\xintiiMMON {280914019374101929}
\end{everbatim*}
-\subsection{\csbh{xintiiifSgn}}\label{xintiiifSgn}
+\subsection{\csh{xintiiifSgn}}\label{xintiiifSgn}
-\csbh{xintiiifSgn}\marg{N}\marg{A}\marg{B}\marg{C}\etype{fnnn} executes either
+\csh{xintiiifSgn}\marg{N}\marg{A}\marg{B}\marg{C}\etype{fnnn} executes either
the \meta{A}, \meta{B} or \meta{C} code, depending on its first argument being
respectively negative, zero, or positive.
-\subsection{\csbh{xintiiifZero}}\label{xintiiifZero}
+\subsection{\csh{xintiiifZero}}\label{xintiiifZero}
\csa{xintiiifZero}\marg{N}\marg{IsZero}\marg{IsNotZero}\etype{fnn} expandably
checks if the first mandatory argument |N| (a number, possibly a fraction if
@@ -9719,7 +9998,7 @@ then either executes the first or the second branch.
Beware that both branches must be present.
-\subsection{\csbh{xintiiifNotZero}}\label{xintiiifNotZero}
+\subsection{\csh{xintiiifNotZero}}\label{xintiiifNotZero}
\csa{xintiiifNotZero}\marg{N}\marg{IsNotZero}\marg{IsZero}\etype{fnn}
expandably checks if the first mandatory argument |N| is not
@@ -9727,39 +10006,39 @@ zero or is zero. It then either executes the first or the second branch.
Beware that both branches must be present.
-\subsection{\csbh{xintiiifOne}}\label{xintiiifOne}
+\subsection{\csh{xintiiifOne}}\label{xintiiifOne}
\csa{xintiiifOne}\marg{N}\marg{IsOne}\marg{IsNotOne}\etype{fnn} expandably
checks if the first mandatory argument |N| is one or not one. It
then either executes the first or the second branch. Beware that both branches
must be present.
-\subsection{\csbh{xintiiifCmp}}\label{xintiiifCmp}
+\subsection{\csh{xintiiifCmp}}\label{xintiiifCmp}
\csa{xintiiifCmp}\marg{A}\marg{B}\marg{A<B}\marg{A=B}\marg{A>B}\etype{ffnnn}
compares its first two arguments and chooses accordingly the correct branch.
-\subsection{\csbh{xintiiifEq}}\label{xintiiifEq}
+\subsection{\csh{xintiiifEq}}\label{xintiiifEq}
\csa{xintiiifEq}\marg{A}\marg{B}\marg{A=B}\marg{not(A=B)}\etype{ffnn} checks
equality of its two first arguments and executes the corresponding branch.
-\subsection{\csbh{xintiiifGt}}\label{xintiiifGt}
+\subsection{\csh{xintiiifGt}}\label{xintiiifGt}
\csa{xintiiifGt}\marg{A}\marg{B}\marg{A>B}\marg{not(A>B)}\etype{ffnn}
checks if $A>B$ and executes the corresponding branch.
-\subsection{\csbh{xintiiifLt}}\label{xintiiifLt}
+\subsection{\csh{xintiiifLt}}\label{xintiiifLt}
\csa{xintiiifLt}\marg{A}\marg{B}\marg{A<B}\marg{not(A<B)}\etype{ffnn}
checks if $A<B$ and executes the corresponding branch.
-\subsection{\csbh{xintiiifOdd}}\label{xintiiifOdd}
+\subsection{\csh{xintiiifOdd}}\label{xintiiifOdd}
\csa{xintiiifOdd}\marg{A}\marg{A odd}\marg{A even}\etype{fnn} checks if $A$ is
and odd integer and executes the corresponding branch.
-\subsection{\csbh{xintiiSum}}\label{xintiiSum}
+\subsection{\csh{xintiiSum}}\label{xintiiSum}
\csa{xintiiSum}\marg{braced things}\etype{{\lowast f}} after expanding its
argument expects to find a sequence of tokens (or braced material). Each is
@@ -9776,7 +10055,7 @@ number: |\xintiiSum {{-1234}}|\dtt{=\xintiiSum {{-1234}}}.
Attention that |\xintiiSum {-1234}| is not legal input and would make the
\TeX{} run fail.
-\subsection{\csbh{xintiiPrd}}\label{xintiiPrd}
+\subsection{\csh{xintiiPrd}}\label{xintiiPrd}
\csa{xintiiPrd}\marg{braced things}\etype{{\lowast f}} after expanding its
argument expects to find a sequence of (of braced items or unbraced
@@ -9802,7 +10081,7 @@ With \xintexprname, the syntax is the natural one:
$2^{200}3^{100}7^{100}=\printnumber{\xinttheiiexpr 2^200 * 3^100 * 7^100\relax}$
\end{everbatim*}
-\subsection{\csbh{xintiiSquareRoot}}
+\subsection{\csh{xintiiSquareRoot}}
\label{xintiiSquareRoot}
|\xintiiSquareRoot|\n\etype{f} returns two braced integers |{M}{d}| which
@@ -9821,7 +10100,7 @@ this gives |k+1/(2k+2)|, not |k|.)
Package \xintfracname has \csbxint{FloatSqrt} for square roots of floating
point numbers.
-\subsection{\csbh{xintiiSqrt}, \csbh{xintiiSqrtR}}
+\subsection{\csh{xintiiSqrt}, \csh{xintiiSqrtR}}
\label{xintiiSqrt}\label{xintiiSqrtR}
\noindent|\xintiiSqrt|\n\ computes the largest integer whose square
@@ -9835,14 +10114,13 @@ produces the rounded, not truncated, square root.\etype{f}
\end{itemize}
\end{everbatim*}
-\subsection{\csbh{xintiiBinomial}}\label{xintiiBinomial}
+\subsection{\csh{xintiiBinomial}}\label{xintiiBinomial}
|\xintiiBinomial{x}{y}|\etype{\numx\numx} computes binomial coefficients.
If |x<0| an out-of-range error is raised. Else, if |y<0| or if |x<y| the macro
-evaluates to \dtt{\xintiiBinomial{1}{-1}} (it was a bit
-unfortunate that the |1.2f| version deliberately raised an out-of-range error
-for the cases |y<0| and |y>x|, with a positive |x|.)
+evaluates to \dtt{\xintiiBinomial{1}{-1}}.
+
%\begin{framed}
The allowable range is $0\leqslant x\leqslant99999999$.
@@ -9895,20 +10173,17 @@ fractions or decimal numbers, and computed the product at the numerator
without truncating them to integers; but the factorial at the denominator
would truncate its argument.
-\subsection{\csbh{xintiiPFactorial}}\label{xintiiPFactorial}
+\subsection{\csh{xintiiPFactorial}}\label{xintiiPFactorial}
|\xintiiPFactorial{a}{b}|\etype{\numx\numx} computes the partial factorial
|(a+1)(a+2)...b|. For |a=b| the product is considered empty hence returns |1|.
%\begin{framed}
- The allowed range with |1.2f| was $0\leqslant a \leqslant b\leqslant99999999$.
-
- It was a bit unfortunate with
- |1.2f| that the code deliberately raised an error if this condition
- was not obeyed by the arguments.
-
- Starting with |1.2h|, $-100000000\leqslant a, b\leqslant99999999$ is
- accepted.
+ The allowed range
+%
+%
+%
+ is $-100000000\leqslant a, b\leqslant99999999$.
The
rule is to interpret the formula as the product of the
$j$'s such that $a<j\leqslant b$, hence in particular if $a\geqslant b$ the
@@ -9945,31 +10220,31 @@ $b-a$ is not too large, one may use an ad hoc function definition such as:
\printnumber{\xinttheexpr mybigpfac(98765432100,98765432120)\relax}
\end{everbatim*}
-\subsection{\csbh{xintiiMax}}\label{xintiiMax}
+\subsection{\csh{xintiiMax}}\label{xintiiMax}
|\xintiiMax|\n\m\etype{ff} returns the largest of the two in the sense
of the order structure on the relative integers (\emph{i.e.} the right-most
number if they are put on a line with positive numbers on the right):
|\xintiiMax {-5}{-6}|\dtt{=\xintiiMax{-5}{-6}}.
-\subsection{\csbh{xintiiMin}}\label{xintiiMin}
+\subsection{\csh{xintiiMin}}\label{xintiiMin}
|\xintiiMin|\n\m\etype{ff} returns the smallest of the two in the sense of the
order structure on the relative integers (\emph{i.e.} the left-most number if
they are put on a line with positive numbers on the right): |\xintiiMin
{-5}{-6}|\dtt{=\xintiiMin{-5}{-6}}.
-\subsection{\csbh{xintiiMaxof}}\label{xintiiMaxof}
+\subsection{\csh{xintiiMaxof}}\label{xintiiMaxof}
\csa{xintiiMaxof}|{{a}{b}{c}...}|\etype{f{$\to$}\lowast f} returns the
maximum. The list argument may be a macro, it is \fexpan ded first.
-\subsection{\csbh{xintiiMinof}}\label{xintiiMinof}
+\subsection{\csh{xintiiMinof}}\label{xintiiMinof}
\csa{xintiiMinof}|{{a}{b}{c}...}|\etype{f{$\to$}\lowast f} returns the
minimum. The list argument may be a macro, it is \fexpan ded first.
-\subsection{\csbh{xintifTrueAelseB}}
+\subsection{\csh{xintifTrueAelseB}}
\label{xintifTrueAelseB}
\csa{xintifTrueAelseB}\marg{f}\marg{true branch}\marg{false branch}\etype{fnn}
@@ -9991,7 +10266,7 @@ worked with input such as |--0|. But it was decided at |1.2o| that the
overhead was not worth it. The same remark applies to the other «Boolean
logic» type macros next.
-\subsection{\csbh{xintifFalseAelseB}}
+\subsection{\csh{xintifFalseAelseB}}
\label{xintifFalseAelseB}
\csa{xintifFalseAelseB}\marg{f}\marg{false branch}\marg{true
@@ -10000,48 +10275,48 @@ logic» type macros next.
{\small
\noindent |\xintiiifzero| is lowercase companion macro.\par }
-\subsection{\csbh{xintNOT}}\label{xintNOT}
+\subsection{\csh{xintNOT}}\label{xintNOT}
\csa{xintNOT}\etype{f} is a synonym for \csa{xintiiIsZero}.
{\small |\xintiiiszero| serves as lowercase companion macro.\par}
-\subsection{\csbh{xintAND}}\label{xintAND}
+\subsection{\csh{xintAND}}\label{xintAND}
|\xintAND{f}{g}|\etype{ff} returns \dtt{1} if |f!=0| and |g!=0| and \dtt{0}
otherwise.
-\subsection{\csbh{xintOR}}\label{xintOR}
+\subsection{\csh{xintOR}}\label{xintOR}
|\xintOR{f}{g}|\etype{ff} returns \dtt{1} if |f!=0| or |g!=0| and \dtt{0}
otherwise.
-\subsection{\csbh{xintXOR}}\label{xintXOR}
+\subsection{\csh{xintXOR}}\label{xintXOR}
|\xintXOR{f}{g}|\etype{ff} returns \dtt{1} if exactly one of |f| or |g|
is true (i.e. non-zero), else \dtt{0}.
-\subsection{\csbh{xintANDof}}\label{xintANDof}
+\subsection{\csh{xintANDof}}\label{xintANDof}
\csa{xintANDof}|{{a}{b}{c}...}|\etype{f{$\to$}\lowast f} returns \dtt{1} if
all are true (i.e. non zero) and \dtt{0} otherwise. The list argument may be a
macro, it (or rather its first token) is \fexpan ded first to deliver its
items.
-\subsection{\csbh{xintORof}}\label{xintORof}
+\subsection{\csh{xintORof}}\label{xintORof}
\csa{xintORof}|{{a}{b}{c}...}|\etype{f{$\to$}\lowast f} returns \dtt{1} if at
least one is true (i.e. does not vanish), else it produces \dtt{0}. The list
argument may be a macro, it is \fexpan ded first.
-\subsection{\csbh{xintXORof}}\label{xintXORof}
+\subsection{\csh{xintXORof}}\label{xintXORof}
\csa{xintXORof}|{{a}{b}{c}...}|\etype{f{$\to$}\lowast f} returns \dtt{1} if an
odd number of them are true (i.e. do not vanish), else it produces \dtt{0}.
The list argument may be a macro, it is \fexpan ded first.
-\subsection{\csbh{xintLen}}\label{xintLen}
+\subsection{\csh{xintLen}}\label{xintLen}
|\xintLen|\etype{\Numf} is originally an alias for \csbxint{iLen}. But with
\xintfracname loaded its meaning is \hyperref[xintLenFrac]{modified} to accept
@@ -10076,7 +10351,7 @@ at |1.3|.\CHANGED{1.3}
With the exception of |\xintNeq| which was renamed to |\xintNotEq|, the above
listed macros all belong to \xintfracname.
-\subsection{Removed macros (they used \csbh{xintNum})}\label{ssec:xintdeprecatedNum}
+\subsection{Removed macros (they used \csh{xintNum})}\label{ssec:xintdeprecatedNum}
These macros filtered their arguments via \csbxint{Num}. They got deprecated
at |1.2o| and removed at |1.3|:\CHANGED{1.3}
@@ -10099,7 +10374,7 @@ at |1.2o| and removed at |1.3|:\CHANGED{1.3}
\csbxint{UniformDeviate} for additional information.
\end{framed}
-\subsection{(WIP) \csbh{xintRandomDigits}}\label{xintRandomDigits}
+\subsection{(WIP) \csh{xintRandomDigits}}\label{xintRandomDigits}
|\xintRandomDigits{N}|\etype{\numx} expands in two steps to |N| random decimal
digits. The argument must be non-negative and is limited by \TeX\ memory
@@ -10112,12 +10387,12 @@ auxiliary file, the macro context may cause a reduced maximum).
\xintRandomDigits{92}
\end{everbatim*}
-\TeXnote the digits are produced eight by eight as if using
-\csbxint{UniformDeviate}|{100000000}| but with less overhead.
+\TeXnote the digits are produced eight by eight by the same method which would
+result from \csbxint{UniformDeviate}|{100000000}| but with less overhead.
-% \subsection{\csbh{\xintOneRandomDigit}}\label{xintOneRandomDigit}
+% \subsection{\csh{\xintOneRandomDigit}}\label{xintOneRandomDigit}
-\subsection{(WIP) \csbh{xintXRandomDigits}}\label{xintXRandomDigits}
+\subsection{(WIP) \csh{xintXRandomDigits}}\label{xintXRandomDigits}
|\xintXRandomDigits{N}|\retype{\numx} expands under exhaustive expansion
(|\edef|, |\write|, |\csname| ...) to |N| random decimal
@@ -10145,7 +10420,10 @@ Transcript written on temp.log.
This can be lifted by increasing the \TeX\ memory settings (installation
dependent).
-\subsection{(WIP) \csbh{xintiiRandRange}}\label{xintiiRandRange}
+\TeXnote the digits are produced eight by eight by the same method which would
+result from \csbxint{UniformDeviate}|{100000000}| but with less overhead.
+
+\subsection{(WIP) \csh{xintiiRandRange}}\label{xintiiRandRange}
|\xintiiRandRange{A}|\etype{f} expands to a random (big) integer |N|
such that |0<=N<A|. It is a supporting macro for \func{randrange}. As with
@@ -10175,7 +10453,10 @@ able to generate all numbers with fourty digits as random numbers, and this
makes the previous section about usage of \csbxint{XRandomDigits} to generate
millions of digits a bit comical...
-\subsection{(WIP) \csbh{xintiiRandRangeAtoB}}\label{xintiiRandRangeAtoB}
+\TeXnote the digits are produced eight by eight by the same method which would
+result from \csbxint{UniformDeviate}|{100000000}| but with less overhead.
+
+\subsection{(WIP) \csh{xintiiRandRangeAtoB}}\label{xintiiRandRangeAtoB}
|\xintiiRandRangeAtoB{A}{B}|\etype{ff} expands to a random (big) integer |N|
such that |A<=N<B|. It is a supporting macro for \func{randrange}. As with
@@ -10191,9 +10472,14 @@ Python's function of the same name, it is an error if |B<=A|.\NewWith{1.3b}
12345678922222222222222222222
\end{everbatim*}
+\TeXnote the digits are produced eight by eight by the same method which would
+result from \csbxint{UniformDeviate}|{100000000}| but with less overhead.
+
\clearpage
+\let\xintnameUp\undefined
+\csname xintfracnameUp\endcsname
\section{Macros of the \xintfracname package}
-\label{sec:frac}
+\RaisedLabel{sec:frac}
First version of this package was in release |1.03| (|2013/04/14|) of the
\xintname bundle.
@@ -10243,7 +10529,7 @@ user manual for various reasons, one being that it is thought few users will
use directly the \xintfracname macros, the \csbxint{expr} interface being more
convenient. For complete documentation refer to |sourcexint.pdf|.
-\subsection{\csbh{xintNum}}\label{xintNumFrac}
+\subsection{\csh{xintNum}}\label{xintNumFrac}
The original \csbxint{Num} \etype{\Ff} from \xintname is made a synonym to
\csbxint{TTrunc} (whose description is to be found farther in this section).
@@ -10255,7 +10541,7 @@ The original \hyperref[xintiNum]{\string\xintNum} from \xintcorename which
does not understand the fraction slash or the scientific notation is still
available under the name \csbxint{iNum}.
-\subsection{\csbh{xintRaw}}\label{xintRaw}
+\subsection{\csh{xintRaw}}\label{xintRaw}
This macro `prints' the\etype{\Ff}
fraction |f| as it is received by the package after its parsing and
@@ -10272,7 +10558,7 @@ denominator:
\xintRaw {178000/25600000}
\end{everbatim*}
-\subsection{\csbh{xintNumerator}}\label{xintNumerator}
+\subsection{\csh{xintNumerator}}\label{xintNumerator}
The input data\etype{\Ff} is parsed as if by \csbxint{Raw} into |A/B[N]|
format and
@@ -10284,7 +10570,7 @@ the macro outputs |A| if |N<=0|, or |A| extended by |N| zeroes if |N>0|.
\xintNumerator {178.000/25600000}
\end{everbatim*}
-\subsection{\csbh{xintDenominator}}\label{xintDenominator}
+\subsection{\csh{xintDenominator}}\label{xintDenominator}
The input data\etype{\Ff} is parsed as if by \csbxint{Raw} into |A/B[N]|
format and
@@ -10296,7 +10582,7 @@ the macro outputs |B| if |N>0|, or |B| extended by \verb+|N|+ zeroes if |N<=0|.
\xintDenominator {178.000/25600000}
\end{everbatim*}
-\subsection{\csbh{xintRawWithZeros}}\label{xintRawWithZeros}
+\subsection{\csh{xintRawWithZeros}}\label{xintRawWithZeros}
This macro parses the input\etype{\Ff} and outputs |A/B|, with |A|
as would be returned by \csa{xintNumerator}|{f}| and |B| as would be returned by
@@ -10309,7 +10595,7 @@ as would be returned by \csa{xintNumerator}|{f}| and |B| as would be returned by
\xintRawWithZeros{\the\numexpr 571*987\relax.123e-10/\the\numexpr-201+59\relax e-7}
\end{everbatim*}
-\subsection{\csbh{xintREZ}}\label{xintREZ}
+\subsection{\csh{xintREZ}}\label{xintREZ}
The input\etype{\Ff} is first parsed into |A/B[N]| as by \csbxint{Raw}, then
trailing zeroes of |A| and |B| are suppressed and |N| is accordingly adjusted.
@@ -10320,7 +10606,7 @@ trailing zeroes of |A| and |B| are suppressed and |N| is accordingly adjusted.
This macro is used internally by various other constructs; its implementation
was redone entirely at |1.3a|, and it got faster on long inputs.
-\subsection{\csbh{xintIrr}}\label{xintIrr}
+\subsection{\csh{xintIrr}}\label{xintIrr}
This puts the fraction\etype{\Ff} into its unique irreducible form:
\begin{everbatim*}
@@ -10340,7 +10626,7 @@ in cases where it turns out that |B=1|.
Use \csbxint{PRaw} on top of \csa{xintIrr} if it is needed to get rid of such a
trailing |/1|.
-\subsection{\csbh{xintPIrr}}\label{xintPIrr}
+\subsection{\csh{xintPIrr}}\label{xintPIrr}
This puts the fraction\etype{\Ff} into irreducible form,
\emph{keeping as is the
@@ -10364,7 +10650,7 @@ polynomials whose coefficients were input in decimal notation, as this
automatically creates internally some |[N]|. Keeping and combining those
|[N]|'s during computations significantly increases their speed.
-\subsection{\csbh{xintJrr}}\label{xintJrr}
+\subsection{\csh{xintJrr}}\label{xintJrr}
This also puts the fraction\etype{\Ff} into its unique irreducible form:
\begin{everbatim*}
@@ -10382,7 +10668,7 @@ But to notice the difference one would need computations with much bigger
numbers than in this example. As \csbxint{Irr}, \csa{xintJrr} does not remove
the trailing |/1| from a fraction reduced to an integer.
-\subsection{\csbh{xintPRaw}}\label{xintPRaw}
+\subsection{\csh{xintPRaw}}\label{xintPRaw}
|PRaw|\etype{\Ff} stands for ``pretty raw''. It does like \csbxint{Raw} apart
from removing the |[N]| part if |N=0| and removing the |B| if |B=1|.
@@ -10390,7 +10676,7 @@ from removing the |[N]| part if |N=0| and removing the |B| if |B=1|.
\xintPRaw {123e10/321e10}, \xintPRaw {123e9/321e10}, \xintPRaw {\xintIrr{861/123}}
\end{everbatim*}
-\subsection{\csbh{xintDecToString}}\label{xintDecToString}
+\subsection{\csh{xintDecToString}}\label{xintDecToString}
This is\etype{\Ff} a macro tailored for printing decimal numbers. It does not
trim trailing zeros, use |\xintDecToString{\xintREZ{<foo>}}| for that.
@@ -10405,7 +10691,7 @@ Consider it an unstable macro, what it does exactly is yet to be decided. It
is a backport from \href{http://ctan.org/pkg/polexpr}{polexpr}'s
|\PolDecToString|, which has now been made an alias to it.
-\subsection{\csbh{xintTrunc}}\label{xintTrunc}
+\subsection{\csh{xintTrunc}}\label{xintTrunc}
\csa{xintTrunc}|{x}{f}|\etype{\numx\Ff} returns the integral part, a dot
(standing for the decimal mark), and
@@ -10456,7 +10742,7 @@ positive, respectively negative.
The digits printed are exact up to and including the last one.
-\subsection{\csbh{xintXTrunc}}\label{xintXTrunc}
+\subsection{\csh{xintXTrunc}}\label{xintXTrunc}
\csa{xintXTrunc}|{x}{f}|\retype{\numx\Ff} is similar to \csbxint{Trunc} with
@@ -10614,7 +10900,7 @@ exhibit the symmetry.
-\subsection{\csbh{xintTFrac}}\label{xintTFrac}
+\subsection{\csh{xintTFrac}}\label{xintTFrac}
\csa{xintTFrac}|{f}|\etype{\Ff} returns the fractional part,
|f=trunc(f)+frac(f)|. Thus if |f<0|, then |-1<frac(f)<=0| and if |f>0| one has
@@ -10643,7 +10929,7 @@ conversion to a floating point number with the precision as set by |\xintDigits|
\xintTFrac {1.122435727e5}\par
\end{everbatim*}
-\subsection{\csbh{xintRound}}\label{xintRound}
+\subsection{\csh{xintRound}}\label{xintRound}
\csa{xintRound}|{x}{f}|\etype{\numx\Ff} returns the start of the decimal
expansion of the fraction |f|, rounded to |x| digits precision after the decimal
@@ -10659,7 +10945,7 @@ zero.
\xintRound {12}{\xintAdd {-1/3}{3/9}}\par
\end{everbatim*}
-\subsection{\csbh{xintFloor}}\label{xintFloor}
+\subsection{\csh{xintFloor}}\label{xintFloor}
|\xintFloor {f}|\etype{\Ff} returns the largest relative integer |N| with
|N|${}\leqslant{}$|f|.
@@ -10668,7 +10954,7 @@ zero.
\end{everbatim*}
Note the trailing |[0]|, see \csbxint{iFloor} if it is not desired.
-\subsection{\csbh{xintCeil}}\label{xintCeil}
+\subsection{\csh{xintCeil}}\label{xintCeil}
|\xintCeil {f}|\etype{\Ff} returns the smallest relative integer |N| with
|N|${}>{}$|f|.
@@ -10676,7 +10962,7 @@ Note the trailing |[0]|, see \csbxint{iFloor} if it is not desired.
\xintCeil {-2.13}, \xintCeil {-2}, \xintCeil {2.13}
\end{everbatim*}
-\subsection{\csbh{xintiTrunc}}\label{xintiTrunc}
+\subsection{\csh{xintiTrunc}}\label{xintiTrunc}
\csa{xintiTrunc}|{x}{f}|\etype{\numx\Ff} returns the integer equal to |10^x|
times what \csa{xintTrunc}|{x}{f}| would produce.
@@ -10690,13 +10976,13 @@ In particular \csa{xintiTrunc}|{0}{f}|'s output is in strict integer format
contrarily to \csa{xintTrunc}|{0}{f}| which produces an output with a decimal
mark, except if |f| turns out to be zero.
-\subsection{\csbh{xintTTrunc}}\label{xintTTrunc}
+\subsection{\csh{xintTTrunc}}\label{xintTTrunc}
\csa{xintTTrunc}|{f}|\etype{\Ff} truncates to an integer (truncation towards
zero). This is the same as |\xintiTrunc {0}{f}| and also the same as
\csbxint{Num}.
-\subsection{\csbh{xintiRound}}\label{xintiRound}
+\subsection{\csh{xintiRound}}\label{xintiRound}
\csa{xintiRound}|{x}{f}|\etype{\numx\Ff} returns the integer equal to |10^x|
times what \csa{xintRound}|{x}{f}| would return.
@@ -10709,7 +10995,7 @@ In particular \csa{xintiRound}|{0}{f}|'s output is in strict integer format
contrarily to \csa{xintRound}|{0}{f}| which produces an output with a decimal
mark, except if |f| turns out to be zero.
-\subsection{\csbh{xintiFloor}}\label{xintiFloor}
+\subsection{\csh{xintiFloor}}\label{xintiFloor}
|\xintiFloor {f}|\etype{\Ff} does the same as \csbxint{Floor} but without the
trailing |/1[0]|.
@@ -10717,7 +11003,7 @@ trailing |/1[0]|.
\xintiFloor {-2.13}, \xintiFloor {-2}, \xintiFloor {2.13}
\end{everbatim*}
-\subsection{\csbh{xintiCeil}}\label{xintiCeil}
+\subsection{\csh{xintiCeil}}\label{xintiCeil}
|\xintiCeil {f}|\etype{\Ff} does the same as \csbxint{Ceil} but its output is
without the |/1[0]|.
@@ -10725,7 +11011,7 @@ without the |/1[0]|.
\xintiCeil {-2.13}, \xintiCeil {-2}, \xintiCeil {2.13}
\end{everbatim*}
-\subsection{\csbh{xintE}}\label{xintE}
+\subsection{\csh{xintE}}\label{xintE}
|\xintE {f}{x}|\etype{\Ff\numx} multiplies the fraction |f| by $10^x$. The
\emph{second} argument |x| must obey the \TeX{} bounds. Example:
@@ -10734,7 +11020,7 @@ without the |/1[0]|.
\end{everbatim*}
Don't feed this example to \csbxint{Num}!
-\subsection{\csbh{xintCmp}}\label{xintCmp}
+\subsection{\csh{xintCmp}}\label{xintCmp}
This\etype{\Ff\Ff} compares two fractions |F| and |G| and produces
|-1|, |0|, or |1| according to |F<G|, |F=G|, |F>G|.
@@ -10742,16 +11028,16 @@ This\etype{\Ff\Ff} compares two fractions |F| and |G| and produces
For choosing branches according to the result of comparing |f| and |g|, see
\csbxint{ifCmp}.
-\subsection{\csbh{xintEq}}\label{xintEq}
+\subsection{\csh{xintEq}}\label{xintEq}
|\xintEq{f}{g}|\etype{\Ff\Ff} returns 1 if |f=g|, 0 otherwise.
-\subsection{\csbh{xintNotEq}}\label{xintNotEq}
+\subsection{\csh{xintNotEq}}\label{xintNotEq}
|\xintNotEq{f}{g}|\etype{\Ff\Ff} returns 0 if |f=g|, 1 otherwise.
-\subsection{\csbh{xintGeq}}\label{xintGeq}
+\subsection{\csh{xintGeq}}\label{xintGeq}
This\etype{\Ff\Ff} compares the \emph{absolute values} of two
fractions.
@@ -10760,52 +11046,52 @@ if not.
Important: the macro compares \emph{absolute values}.
-\subsection{\csbh{xintGt}}\label{xintGt}
+\subsection{\csh{xintGt}}\label{xintGt}
|\xintGt{f}{g}|\etype{\Ff\Ff} returns \dtt{1} if |f|$>$|g|, \dtt{0} otherwise.
-\subsection{\csbh{xintLt}}\label{xintLt}
+\subsection{\csh{xintLt}}\label{xintLt}
|\xintLt{f}{g}|\etype{\Ff\Ff} returns \dtt{1} if |f|$<$|g|, \dtt{0} otherwise.
-\subsection{\csbh{xintGtorEq}}\label{xintGxstorEq}
+\subsection{\csh{xintGtorEq}}\label{xintGxstorEq}
|\xintGtorEq{f}{g}|\etype{\Ff\Ff} returns \dtt{1} if |f|$\geqslant$|g|, \dtt{0} otherwise.
Extended by \xintfracname to fractions.
-\subsection{\csbh{xintLtorEq}}\label{xintLtorEq}
+\subsection{\csh{xintLtorEq}}\label{xintLtorEq}
|\xintLtorEq{f}{g}|\etype{\Ff\Ff} returns \dtt{1} if |f|$\leqslant$|g|, \dtt{0} otherwise.
-\subsection{\csbh{xintIsZero}}\label{xintIsZero}
+\subsection{\csh{xintIsZero}}\label{xintIsZero}
|\xintIsZero{f}|\etype{f} returns \dtt{1} if |f=0|, \dtt{0} otherwise.
-\subsection{\csbh{xintIsNotZero}}\label{xintIsNotZero}
+\subsection{\csh{xintIsNotZero}}\label{xintIsNotZero}
|\xintIsNotZero{f}|\etype{f} returns \dtt{1} if |f!=0|, \dtt{0} otherwise.
-\subsection{\csbh{xintIsOne}}\label{xintIsOne}
+\subsection{\csh{xintIsOne}}\label{xintIsOne}
|\xintIsOne{f}|\etype{f} returns \dtt{1} if |f=1|, \dtt{0} otherwise.
-\subsection{\csbh{xintOdd}}\label{xintOdd}
+\subsection{\csh{xintOdd}}\label{xintOdd}
|\xintOdd{f}|\etype{f} returns \dtt{1} if the integer obtained by truncation is
odd, and \dtt{0} otherwise.
-\subsection{\csbh{xintEven}}\label{xintEven}
+\subsection{\csh{xintEven}}\label{xintEven}
|\xintEven{f}|\etype{f} returns \dtt{1} if the integer obtained by truncation is
even, and \dtt{0} otherwise.
-\subsection{\csbh{xintifSgn}}\label{xintifSgn}
+\subsection{\csh{xintifSgn}}\label{xintifSgn}
-\csbh{xintifSgn}\marg{f}\marg{A}\marg{B}\marg{C}\etype{\Ff nnn} executes either the
+\csh{xintifSgn}\marg{f}\marg{A}\marg{B}\marg{C}\etype{\Ff nnn} executes either the
\meta{A}, \meta{B} or \meta{C} code, depending on its first argument being
respectively negative, zero, or positive.
-\subsection{\csbh{xintifZero}}\label{xintifZero}
+\subsection{\csh{xintifZero}}\label{xintifZero}
\csa{xintifZero}\marg{f}\marg{IsZero}\marg{IsNotZero}\etype{\Ff nn} expandably
checks if the first mandatory argument |N| (a number, possibly a fraction if
@@ -10814,7 +11100,7 @@ then either executes the first or the second branch.
Beware that both branches must be present.
-\subsection{\csbh{xintifNotZero}}\label{xintifNotZero}
+\subsection{\csh{xintifNotZero}}\label{xintifNotZero}
\csa{xintifNotZero}\marg{N}\marg{IsNotZero}\marg{IsZero}\etype{\Ff nn}
expandably checks if the first mandatory argument |f| is not
@@ -10822,71 +11108,71 @@ zero or is zero. It then either executes the first or the second branch.
Beware that both branches must be present.
-\subsection{\csbh{xintifOne}}\label{xintifOne}
+\subsection{\csh{xintifOne}}\label{xintifOne}
\csa{xintifOne}\marg{N}\marg{IsOne}\marg{IsNotOne}\etype{\Ff nn} expandably
checks if the first mandatory argument |f| is one or not one. It
then either executes the first or the second branch. Beware that both branches
must be present.
-\subsection{\csbh{xintifOdd}}\label{xintifOdd}
+\subsection{\csh{xintifOdd}}\label{xintifOdd}
\csa{xintifOdd}\marg{N}\marg{odd}\marg{not odd}\etype{\Ff nn} expandably
checks if the first mandatory argument |f|, after truncation to an integer, is
odd or even. It then executes accordingly the first or the second branch.
Beware that both branches must be present.
-\subsection{\csbh{xintifCmp}}\label{xintifCmp}
+\subsection{\csh{xintifCmp}}\label{xintifCmp}
\csa{xintifCmp}\marg{f}\marg{g}\marg{if f<g}\marg{if f=g}\marg{if
f>g}\etype{\Ff\Ff nnn} compares its first two arguments and chooses accordingly
the correct branch.
-\subsection{\csbh{xintifEq}}\label{xintifEq}
+\subsection{\csh{xintifEq}}\label{xintifEq}
\csa{xintifEq}\marg{f}\marg{g}\marg{YES}\marg{NO}\etype{\Ff\Ff nn} checks
equality of its two first arguments and executes accordingly the |YES| or the
|NO| branch.
-\subsection{\csbh{xintifGt}}\label{xintifGt}
+\subsection{\csh{xintifGt}}\label{xintifGt}
\csa{xintifGt}\marg{f}\marg{g}\marg{YES}\marg{NO}\etype{\Ff\Ff nn}
checks if $f>g$ and in that case executes the |YES| branch.
-\subsection{\csbh{xintifLt}}\label{xintifLt}
+\subsection{\csh{xintifLt}}\label{xintifLt}
\csa{xintifLt}\marg{f}\marg{g}\marg{YES}\marg{NO}\etype{\Ff\Ff nn}
checks if $f<g$ and in that case executes the |YES| branch.
-\subsection{\csbh{xintifInt}}\label{xintifInt}
+\subsection{\csh{xintifInt}}\label{xintifInt}
\csa{xintifInt}|{f}{YES branch}{NO branch}|\etype{\Ff nn} expandably chooses
the |YES| branch if |f| reveals itself after expansion and simplification to
be an integer.
-\subsection{\csbh{xintSgn}}\label{xintSgn}
+\subsection{\csh{xintSgn}}\label{xintSgn}
The sign of a fraction.\etype{\Ff}
-\subsection{\csbh{xintOpp}}\label{xintOpp}
+\subsection{\csh{xintOpp}}\label{xintOpp}
The opposite of a fraction.\etype{\Ff}
Note that |\xintOpp {3}| produces \dtt{\xintOpp
{3}} whereas |\xintiiOpp {3}| produces \dtt{\xintiiOpp {3}}.
-\subsection{\csbh{xintAbs}}\label{xintAbs}
+\subsection{\csh{xintAbs}}\label{xintAbs}
The absolute value\etype{\Ff}. Note that |\xintAbs {-2}|\dtt{=\xintAbs {-2}}
where |\xintiiAbs {-2}| outputs \dtt{=\xintiiAbs {-2}}.
-\subsection{\csbh{xintAdd}}\label{xintAdd}
+\subsection{\csh{xintAdd}}\label{xintAdd}
Computes the addition\etype{\Ff\Ff} of two fractions.
Since |1.3| always uses the least common multiple of the
denominators.\CHANGED{1.3}
-\subsection{\csbh{xintSub}}\label{xintSub}
+\subsection{\csh{xintSub}}\label{xintSub}
Computes the difference\etype{\Ff\Ff} of two fractions (|\xintSub{F}{G}|
computes |F-G|).
@@ -10894,20 +11180,20 @@ computes |F-G|).
Since |1.3| always uses the least common multiple of the
denominators.\CHANGED{1.3}
-\subsection{\csbh{xintMul}}\label{xintMul}
+\subsection{\csh{xintMul}}\label{xintMul}
Computes the product\etype{\Ff\Ff} of two fractions.
Output is not reduced to smallest terms.
-\subsection{\csbh{xintDiv}}\label{xintDiv}
+\subsection{\csh{xintDiv}}\label{xintDiv}
Computes the quotient \etype{\Ff\Ff} of two fractions.
(|\xintDiv{F}{G}| computes |F/G|).
Output is not reduced to smallest terms.
-\subsection{\csbh{xintDivFloor}}
+\subsection{\csh{xintDivFloor}}
\label{xintDivFloor}
Computes the quotient \etype{\Ff\Ff} of two arguments then apply floor
@@ -10918,7 +11204,7 @@ it appended |/1[0]| to output.
\xintDivFloor{-170/3}{23/2}
\end{everbatim*}
-\subsection{\csbh{xintMod}}
+\subsection{\csh{xintMod}}
\label{xintMod}
Computes the remainder associated to the floored division\etype{\Ff\Ff}
@@ -10931,7 +11217,7 @@ Computes the remainder associated to the floored division\etype{\Ff\Ff}
Modified at |1.3| to use a l.c.m. for the denominator of the result.
\CHANGED{1.3}
-\subsection{\csbh{xintDivMod}}
+\subsection{\csh{xintDivMod}}
\label{xintDivMod}
Computes both the floored division and the remainder\etype{\Ff\Ff}
@@ -10940,7 +11226,7 @@ Computes both the floored division and the remainder\etype{\Ff\Ff}
\oodef\foo{\xintDivMod{-170/3}{23/2}}\meaning\foo
\end{everbatim*}
-\subsection{\csbh{xintDivTrunc}}
+\subsection{\csh{xintDivTrunc}}
\label{xintDivTrunc}
Computes the quotient \etype{\Ff\Ff} of two arguments then
@@ -10949,7 +11235,7 @@ truncates to an integer (in strict format).
\xintDivTrunc{-170/3}{23/2}
\end{everbatim*}
-\subsection{\csbh{xintModTrunc}}
+\subsection{\csh{xintModTrunc}}
\label{xintModTrunc}
Computes the remainder\etype{\Ff\Ff} associated with the truncated division of
@@ -10962,7 +11248,7 @@ got associated with floored division.
Modified at |1.3| to use a l.c.m. for the denominator of the result.
\CHANGED{1.3}
-\subsection{\csbh{xintDivRound}}
+\subsection{\csh{xintDivRound}}
\label{xintDivRound}
Computes the quotient \etype{\Ff\Ff} of the two arguments then rounds to an
@@ -10971,11 +11257,11 @@ integer (in strict format).
\xintDivRound{-170/3}{23/2}
\end{everbatim*}
-\subsection{\csbh{xintSqr}}\label{xintSqr}
+\subsection{\csh{xintSqr}}\label{xintSqr}
Computes the square\etype{\Ff} of one fraction.
-\subsection{\csbh{xintPow}}\label{xintPow}
+\subsection{\csh{xintPow}}\label{xintPow}
\csa{xintPow}{|{f}{x}|}:\etype{\Ff\Numf} computes |f^x| with |f| a fraction and
|x| possibly also, but |x| will first get truncated to a (positive or negative)
@@ -10995,14 +11281,14 @@ Within an \csbxint{iiexpr}|..\relax| the infix operator |^| is mapped to
\csa{xintiiPow}; within an \csbxint{expr}-ession it is mapped to
\csa{xintPow}.
-\subsection{\csbh{xintFac}}\label{xintFac}
+\subsection{\csh{xintFac}}\label{xintFac}
This is a convenience variant of \csbxint{iiFac} which applies \csbxint{Num}
to its argument\etype{\Numf}. Notice however that the output will have a trailing
|[0]| according to the \xintfracname format for integers.
-\subsection{\csbh{xintBinomial}}\label{xintBinomial}
+\subsection{\csh{xintBinomial}}\label{xintBinomial}
This is a convenience variant of \csbxint{iiBinomial} which applies
\csbxint{Num} to its arguments\etype{\Numf\Numf}. Notice however that the
@@ -11010,7 +11296,7 @@ output will have a trailing |[0]| according to the \xintfracname format for
integers.
-\subsection{\csbh{xintPFactorial}}\label{xintPFactorial}
+\subsection{\csh{xintPFactorial}}\label{xintPFactorial}
This is a convenience variant of \csbxint{iiPFactorial} which applies
\csbxint{Num} to its arguments\etype{\Numf\Numf}. Notice however that the
@@ -11018,7 +11304,7 @@ output will have a trailing |[0]| according to the \xintfracname format for
integers.
-\subsection{\csbh{xintMax}}\label{xintMax}
+\subsection{\csh{xintMax}}\label{xintMax}
The maximum of two fractions.\etype{\Ff\Ff} Beware that |\xintMax {2}{3}|
produces \dtt{\xintMax {2}{3}}. The original, for use with
@@ -11029,7 +11315,7 @@ integers only with no need of normalization, is available as \csbxint{iiMax}:
\xintMax {2.5}{7.2}
\end{everbatim*}
-\subsection{\csbh{xintMin}}\label{xintMin}
+\subsection{\csh{xintMin}}\label{xintMin}
The maximum of two fractions.\etype{\Ff\Ff} Beware that |\xintMax {2}{3}|
produces \dtt{\xintMax {2}{3}}. The original, for use with
@@ -11040,7 +11326,7 @@ integers only with no need of normalization, is available as \csbxint{iiMin}:
\xintMin {2.5}{7.2}
\end{everbatim*}
-\subsection{\csbh{xintMaxof}}\label{xintMaxof}
+\subsection{\csh{xintMaxof}}\label{xintMaxof}
The maximum of any number of fractions, each within braces, and the whole
thing within braces. \etype{f{$\to$}{\lowast\Ff}}
@@ -11049,7 +11335,7 @@ thing within braces. \etype{f{$\to$}{\lowast\Ff}}
\xintMaxof {{1.23}{1.2299}{1.2301}} and \xintMaxof {{-1.23}{-1.2299}{-1.2301}}
\end{everbatim*}
-\subsection{\csbh{xintMinof}}\label{xintMinof}
+\subsection{\csh{xintMinof}}\label{xintMinof}
The minimum of any number of fractions, each within braces, and the whole
thing within braces. \etype{f{$\to$}{\lowast\Ff}}
@@ -11058,7 +11344,7 @@ thing within braces. \etype{f{$\to$}{\lowast\Ff}}
\xintMinof {{1.23}{1.2299}{1.2301}} and \xintMinof {{-1.23}{-1.2299}{-1.2301}}
\end{everbatim*}
-\subsection{\csbh{xintSum}}\label{xintSum}
+\subsection{\csh{xintSum}}\label{xintSum}
This\etype{f{$\to$}{\lowast\Ff}} computes the sum of fractions. The output
will now always be in the form |A/B[n]|. The original, for big integers only
@@ -11070,7 +11356,7 @@ will now always be in the form |A/B[n]|. The original, for big integers only
No simplification attempted.
-\subsection{\csbh{xintPrd}}\label{xintPrd}
+\subsection{\csh{xintPrd}}\label{xintPrd}
TThis\etype{f{$\to$}{\lowast\Ff}} computes the product of fractions. The output
will now always be in the form |A/B[n]|. The original, for big integers only
@@ -11086,7 +11372,7 @@ No simplification attempted.
$\xintIsOne {21921379213/21921379213}\neq\xintIsOne {1.00000000000000000000000000000001}$
\end{everbatim*}
-\subsection{\csbh{xintDigits}, \csbh{xinttheDigits}}
+\subsection{\csh{xintDigits}, \csh{xinttheDigits}}
\label{xintDigits}
\label{xinttheDigits}
@@ -11095,7 +11381,7 @@ value of |D| to the number of digits to be used by floating point
operations. The default is |16|. The maximal value is |32767|. The macro
|\xinttheDigits|\etype{} serves to print the current value.
-\subsection{\csbh{xintFloat}}\label{xintFloat}
+\subsection{\csh{xintFloat}}\label{xintFloat}
The macro |\xintFloat [P]{f}|\etype{{\upshape[\numx]}\Ff} has an optional
@@ -11154,7 +11440,7 @@ transitive in the number of kept digits.
-\subsection{\csbh{xintPFloat}}\label{xintPFloat}
+\subsection{\csh{xintPFloat}}\label{xintPFloat}
The macro |\xintPFloat [P]{f}|\etype{{\upshape[\numx]}\Ff} is like
\csbxint{Float} but ``pretty-prints'' the output. Its behaviour has changed
@@ -11201,7 +11487,7 @@ Currently trailing zeros are not trimmed.
\end{everbatim*}
-\subsection{\csbh{xintFloatE}}\label{xintFloatE}
+\subsection{\csh{xintFloatE}}\label{xintFloatE}
|\xintFloatE [P]{f}{x}|\etype{{\upshape[\numx]}\Ff\numx} multiplies the input
|f| by $10^x$, and
@@ -11211,7 +11497,7 @@ value of |\xinttheDigits|.
\xintFloatE {1.23e37}{53}
\end{everbatim*}
-\subsection{\csbh{xintFloatAdd}}\label{xintFloatAdd}
+\subsection{\csh{xintFloatAdd}}\label{xintFloatAdd}
|\xintFloatAdd [P]{f}{g}|\etype{{\upshape[\numx]}\Ff\Ff} first replaces |f|
@@ -11221,7 +11507,7 @@ the sum |f'+g'|, correctly rounded to nearest with the same number of
significant places.
-\subsection{\csbh{xintFloatSub}}\label{xintFloatSub}
+\subsection{\csh{xintFloatSub}}\label{xintFloatSub}
|\xintFloatSub [P]{f}{g}|\etype{{\upshape[\numx]}\Ff\Ff} first replaces |f|
@@ -11230,7 +11516,7 @@ places or to the precision from |\xintDigits|. It then produces
the difference |f'-g'| correctly rounded to nearest |P|-float.
-\subsection{\csbh{xintFloatMul}}\label{xintFloatMul}
+\subsection{\csh{xintFloatMul}}\label{xintFloatMul}
|\xintFloatMul [P]{f}{g}|\etype{{\upshape[\numx]}\Ff\Ff} first replaces |f|
@@ -11251,7 +11537,7 @@ See \autoref{ssec:floatingpoint} for more.
% time to come back to it.
\end{framed}
-\subsection{\csbh{xintFloatDiv}}\label{xintFloatDiv}
+\subsection{\csh{xintFloatDiv}}\label{xintFloatDiv}
|\xintFloatDiv [P]{f}{g}|\etype{{\upshape[\numx]}\Ff\Ff} first replaces |f|
@@ -11267,7 +11553,7 @@ exact fraction |f/g|. Indeed the macro arguments are each first individually
rounded to |P| digits of precision. The correct syntax to get the correctly
rounded integer fraction |f/g| is \csbxint{Float}|[P]{f/g}|.
-\subsection{\csbh{xintFloatPow}}\label{xintFloatPow}
+\subsection{\csh{xintFloatPow}}\label{xintFloatPow}
|\xintFloatPow [P]{f}{x}|\etype{{\upshape[\numx]}\Ff\numx} uses either the
optional argument |P| or in its absence the value of |\xinttheDigits|. It
@@ -11284,7 +11570,7 @@ The argument |f| is first rounded to |P| significant places to give
\xintFloatPow [8]{3.1415}{1234567890}
\end{everbatim*}
-\subsection{\csbh{xintFloatPower}}\label{xintFloatPower}
+\subsection{\csh{xintFloatPower}}\label{xintFloatPower}
\csa{xintFloatPower}|[P]{f}{g}|\etype{{\upshape[\numx]}\Ff\Numf} computes a
floating point value |f^g| where the exponent |g| is not constrained to be at
@@ -11364,7 +11650,7 @@ expression proceeds with |\xinttheDigits| digits of precision, and the final
result is then rounded to |Q| digits: thus this makes real sense only if used
with |Q<\xinttheDigits|.
-\subsection{\csbh{xintFloatSqrt}}\label{xintFloatSqrt}
+\subsection{\csh{xintFloatSqrt}}\label{xintFloatSqrt}
\csa{xintFloatSqrt}|[P]{f}|\etype{{\upshape[\numx]}\Ff} computes a floating
point approximation of $\sqrt{|f|}$, either using the optional precision |P| or
@@ -11402,13 +11688,11 @@ transitive.)\par
-\subsection{\csbh{xintFloatFac}}\label{xintFloatFac}
+\subsection{\csh{xintFloatFac}}\label{xintFloatFac}
\csa{xintFloatFac}|[P]{f}|\etype{{\upshape[\numx]}\Numf} returns the
factorial with either \csa{xinttheDigits} or |P| digits of precision.
-% je devrais vérifier mais j'ai écrit cela fin novembre 2015 début décembre je
-% suppose que je savais ce que je disais.
The exact theoretical value differs from the calculated one |Y| by an absolute
@@ -11429,16 +11713,14 @@ The |factorial| function is available in \csbxint{floatexpr}:
\xintthefloatexpr factorial(1000)\relax % same as 1000!
\end{everbatim*}
-\subsection{\csbh{xintFloatBinomial}}\label{xintFloatBinomial}
+\subsection{\csh{xintFloatBinomial}}\label{xintFloatBinomial}
\csa{xintFloatBinomial}|[P]{x}{y}|\etype{{\upshape[\numx]}\Numf\Numf} computes
binomial coefficients with either \csa{xinttheDigits} or |P| digits of
precision.
-When |x<0| an out-of-range error is raised. Else (this was changed in |1.2h|,
-see \autoref{xintiiBinomial}), if |y<0| or if |x<y| the macro
-evaluates to \dtt{\xintFloatBinomial{1}{-1}}.
-
+When |x<0| an out-of-range error is raised. Else if |y<0| or if |x<y| the
+macro evaluates to \dtt{\xintFloatBinomial{1}{-1}}.
The exact theoretical value differs from the calculated one |Y| by an absolute
error strictly less than |0.6 ulp(Y)|.
@@ -11483,7 +11765,7 @@ ${3000\choose 1500}\approx{}$\xintFloatBinomial [24]{3000}{1500}
% 0.3979077671466477799149739359402922 10
% en plus je lui demande 32 chiffres et il m'en sort 34.
-The |binomial| function is available in \csbxint{floatexpr}:
+The associated function in \csbxint{floatexpr} is \func{binomial}:
\begin{everbatim*}
\xintthefloatexpr binomial(3000,1500)\relax
\end{everbatim*}
@@ -11492,33 +11774,32 @@ The computation is based on the formula |(x-y+1)...x/y!| (here one arranges
|y<=x-y| naturally).
-\subsection{\csbh{xintFloatPFactorial}}\label{xintFloatPFactorial}
+\subsection{\csh{xintFloatPFactorial}}\label{xintFloatPFactorial}
\csa{xintFloatPFactorial}|[P]{x}{y}|\etype{{\upshape[\numx]}\Numf\Numf}
computes the product |(x+1)...y|.
-The inputs |x| and |y| must evaluate to non-negative integers less in absolute
-value than $10^8$. For |x=y| the product is considered empty hence the
-returned value is |1|.
-It was a bit unfortunate with |1.2f| that the code deliberately raised an
-error if the condition |0<=x<=y<10^8| was violated. See
-\autoref{xintiiPFactorial} for the now prevailing rules.
-But only for the range |0<=x<=y<10^8| is it to be considered that the
-behaviour is fixed and will not change in the future.
+
+The arguments must be integers (they are expanded inside |\numexpr|)
+and the allowed range is $-100000000\leqslant x, y\leqslant99999999$. If
+$x\geqslant y$ the product is considered empty hence returns one (as a
+floating point value).
+See also \csbxint{iiPFactorial}.
+
The exact theoretical value differs from the calculated one |Y| by an absolute
error strictly less than |0.6 ulp(Y)|.
-The |pfactorial| function is available in \csbxint{floatexpr}:
+The associated function in \csbxint{floatexpr} is \func{pfactorial}:
\begin{everbatim*}
\xintthefloatexpr pfactorial(2500,5000)\relax
\end{everbatim*}
\xintDigits:=16;
-\subsection{\csbh{xintFrac}}\label{xintFrac}
+\subsection{\csh{xintFrac}}\label{xintFrac}
This is a \LaTeX{} only macro,\etype{\Ff} to be used in math mode only. It
will print a fraction, internally represented as something equivalent to
@@ -11534,7 +11815,7 @@ the minus sign to the numerator) is not done automatically and must be the
result of macros such as |\xintIrr|, |\xintREZ|, or |\xintNum| (for fractions
being in fact integers.)
-\subsection{\csbh{xintSignedFrac}}\label{xintSignedFrac}
+\subsection{\csh{xintSignedFrac}}\label{xintSignedFrac}
This is as \csbxint{Frac}\etype{\Ff} except that a negative fraction has the
@@ -11543,7 +11824,7 @@ sign put in front, not in the numerator.
\[\xintFrac{-355/113}=\xintSignedFrac {-355/113}\]
\end{everbatim*}
-\subsection{\csbh{xintFwOver}}\label{xintFwOver}
+\subsection{\csh{xintFwOver}}\label{xintFwOver}
This does the same as \csa{xintFrac}\etype{\Ff} except that the \csa{over}
primitive is used for the fraction (in case the denominator is not one; and a
@@ -11554,7 +11835,7 @@ $\xintFwOver {178.000/1}$, |$\xintFwOver {3.5/5.7}$| gives $\xintFwOver
{5}}}}$| gives $\xintFwOver {\xintNum {\xintiiFac{10}/\xintiiSqr{\xintiiFac
{5}}}}$.
-\subsection{\csbh{xintSignedFwOver}}\label{xintSignedFwOver}
+\subsection{\csh{xintSignedFwOver}}\label{xintSignedFwOver}
This is as \csbxint{FwOver}\etype{\Ff} except that a negative fraction has the
sign put in front, not in the numerator.
@@ -11562,7 +11843,7 @@ sign put in front, not in the numerator.
\[\xintFwOver{-355/113}=\xintSignedFwOver {-355/113}\]
\end{everbatim*}
-\subsection{\csbh{xintLen}}\label{xintLenFrac}
+\subsection{\csh{xintLen}}\label{xintLenFrac}
The original \csbxint{Len} macro\etype{\Ff} is extended to accept a fraction
on input: the length of |A/B[n]| is the length of |A| plus the length of |B|
@@ -11584,9 +11865,10 @@ however does not expand its argument) from \xintkernelname for counting more
general tokens (or rather braced items).
\clearpage
-
+\let\xintfracnameUp\undefined
+\csname xintexprnameUp\endcsname
\section{Macros of the \xintexprname package}%
-\label{sec:expr}
+\RaisedLabel{sec:expr}
\localtableofcontents
@@ -11594,14 +11876,10 @@ The \xintexprname package was first released with version |1.07|
(|2013/05/25|) of the \xintname bundle. It was substantially enhanced with
release |1.1| from |2014/10/28|.
-Release |1.2| removed a limitation to numbers of at most $5000$ digits, and
-there is now a float variant of the factorial. Also the ``pseudo-functions''
-\func{qint}, \func{qfrac}, \func{qfloat} (|'q'| stands for ``quick''), were
-added to handle very big inputs and avoid scanning it digit per digit.
+Release |1.2| removed a limitation to numbers of at most $5000$ digits, among
+other changes.
-The package loads automatically \xintfracname and \xinttoolsname (it is now
-the only arithmetic package from the \xintname bundle which loads
-\xinttoolsname).
+The package loads automatically \xintfracname and \xinttoolsname.
\begin{itemize}
\item for using the \func{gcd} and \func{lcm} functions, it is necessary to
load package \xintgcdname.
@@ -11618,7 +11896,7 @@ the only arithmetic package from the \xintname bundle which loads
Please refer to \autoref{sec:xintexprsyntax} for a more detailed description
of the syntax elements for expressions.
-\subsection{The \csbh{xintexpr} expressions}
+\subsection{The \csh{xintexpr} expressions}
\label{xintexpr}
\label{xinttheexpr}
\label{thexintexpr}
@@ -11705,8 +11983,7 @@ operators and functions. This section now adds some complementary information.
Alternatively the macro \csbxint{exprSafeCatcodes} resets all
characters potentially needed by \csbxint{expr} to their standard catcodes
- and \csbxint{exprRestoreCatcodes} restores the status prevailing at the time
- of the previous \csa{xintexprSafeCatcodes}.
+ and \csbxint{exprRestoreCatcodes} restores the former status.
\item Count registers and |\numexpr|-essions are accepted (LaTeX{}'s counters
can be inserted using |\value|) natively without |\the| or |\number| as
@@ -11849,26 +12126,45 @@ Inside an expression one may prefix, for example a |:| with |\string|. Or, for
a more radical way, there is \csbxint{exprSafeCatcodes}. This is a
non-expandable step as it changes catcodes.
-\subsubsection{\csbh{xintexprSafeCatcodes}}
+\subsubsection{\csh{xintexprSafeCatcodes}}
\label{xintexprSafeCatcodes}
-This macro sets the catcodes of the relevant characters to safe values. This
-is used internally by \csbxint{NewExpr} (restoring the catcodes on exit),
-hence \csa{xintNewExpr} does not have to be protected against active
-characters.
+This macro sets the catcodes of many characters to safe values. This is used
+internally by \csbxint{NewExpr} (restoring the catcodes on exit), hence it
+does not have to be protected against active characters when used at
+top-level.
-Attention however that if the whole
-\begin{everbatim}
-\xintNewExpr \foo [N] {<expression with #1,...>}
-\end{everbatim}
-has been fetched as a macro argument, it will be too late then for
-\csa{xintNewExpr} to sanitize the catcodes of the (active) characters within
-the expression.
+Also \csbxint{defvar}, \csbxint{deffunc}, ..., use it before fetching their
+semi-colon delimited arguments, so they can be used (also in the document
+body) for example with Babel+French which makes the semi-colon active in the
+(\LaTeX) document body.\CHANGED{1.3c}
+
+As \csbxint{NewExpr} and \csbxint{deffunc} and variants use internally some
+|\scantokens|, they will (reasonably) succeed in sanitizing catcodes in the
+expressions, even if all is from the replacement text of some macro whose
+definition was done under some special catcode regime.
+
+But \csbxint{deffunc}, \csbxint{defvar} and variants need the (catcode other)
+semi-colon as delimiter. Thus make sure the semi-colon has its normal catcode
+when using \csbxint{deffunc} inside some macro definition.
-\subsubsection{\csbh{xintexprRestoreCatcodes}}
+The macros \csbxint{deffunc} and variants ignore completely the colon in |:=|
+(which furthermore is optional) so it can have any (reasonable) frozen catcode.
+
+The macros \csbxint{defvar} and variants are also compatible with any
+reasonable frozen catcode of the colon |:| in |:=|, and the colon presence is
+only optional.\NewWith{1.3c}
+
+\subsubsection{\csh{xintexprRestoreCatcodes}}
\label{xintexprRestoreCatcodes}
-Restores the catcodes to the earlier state.
+Restores the catcodes to the earlier state. More precisely,
+\csbxint{exprSafeCatcodes} sets a toggle (with local scope). If the toggle is
+set already it does not restore the current catcodes. The next
+\csa{xintexprRestoreCatcodes} unsets the toggle.\CHANGED{1.3c}
+So, in case of nesting, the
+catcodes are restored to what they were when the \emph{first} un-paired
+\csbxint{exprSafeCatcodes} got executed.
\bigskip
@@ -11936,6 +12232,7 @@ the least affected from the fact that the surrounding ``environment'' is the
|\xintiiexpr| one.
\subsection{Memory considerations}
+\label{ssec:memory}
The parser creates an undefined control sequence for each intermediate
computation evaluation: addition, subtraction, etc\dots Thus, a moderately sized
@@ -11988,7 +12285,295 @@ inside an expression, but its use will need only as many |\csname|'s as were
needed for the function arguments plus one more for encapsulating the function
result.
-\subsection{The \csbh{xintNewExpr} macro}
+\subsection{\csh{xintiexpr}, \csh{xinttheiexpr}}
+\label{xintiexpr}\label{xinttheiexpr}\label{thexintiexpr}
+
+Equivalent\etype{x} to doing |\xintexpr round(...)\relax| (more precisely,
+|round| is applied to each one of the evaluated values, if the expression was
+comma separated). Thus, only the \emph{final result value} is rounded to an
+integer. Half integers are rounded towards $+\infty$ for positive numbers and
+towards $-\infty$ for negative ones.
+
+An optional parameter |d>0| within brackets, immediately after |\xintiexpr|
+is allowed: it instructs the expression to do its final rounding to the
+nearest value with that many digits after the decimal mark, \emph{i.e.},
+|\xintiexpr [d] <expression>\relax| is equivalent (in case of a single
+expression) to |\xintexpr round(<expression>, d)\relax|.
+
+|\xintiexpr [0] ...| is the same as |\xintiexpr ...|.\footnote{Incidentally
+ using |round(...,0)| in place of |round(...)| in |\xintexpr| would leave a
+ trailing dot in the produced value.}
+
+If truncation rather than rounding is needed use (in case of a single
+expression, naturally) |\xintexpr trunc(...)\relax| for truncation to an
+integer or |\xintexpr trunc(...,d)\relax| for truncation to a decimal number
+with |d>0| digits after the decimal mark.
+
+Perhaps in the future some meaning will be given to using negative value for
+the optional parameter |d|.\footnote{Thanks to KT for this suggestion.}
+
+|\thexintiexpr| is synonym to |\xinttheiexpr|.
+
+\subsection{\csh{xintiiexpr}, \csh{xinttheiiexpr}}
+\label{xintiiexpr}\label{xinttheiiexpr}\label{thexintiiexpr}
+
+This variant\etype{x} does not know fractions. It deals almost only with long
+integers. Comma separated lists of expressions are allowed.
+
+\begin{framed}
+ It maps |/| to the \emph{rounded} quotient. The operator
+ |//| is, like in |\xintexpr...\relax|, mapped to \emph{truncated} division.
+ The Euclidean quotient (which for positive operands is like the truncated
+ quotient) was, prior to release |1.1|, associated to |/|. The function
+ |quo(a,b)| can still be employed.
+\end{framed}
+
+The \csbxint{iiexpr}-essions use the `ii' macros for addition, subtraction,
+multiplication, power, square, sums, products, Euclidean quotient and
+remainder.
+
+The |round|, |trunc|, |floor|, |ceil| functions are still available, and are
+about the only places where fractions can be used, but |/| within, if not
+somehow hidden will be executed as integer rounded division. To avoid this one
+can wrap the input in \dtt{qfrac}: this means however that none of the normal
+expression parsing will be executed on the argument.
+
+To understand the illustrative examples, recall that |round| and |trunc| have
+a second (non negative) optional argument. In a normal \csbxint{expr}-essions,
+|round| and |trunc| are mapped to \csbxint{Round} and \csbxint{Trunc}, in
+\csbxint{iiexpr}-essions, they are mapped to \csbxint{iRound} and
+\csbxint{iTrunc}.
+
+
+\begin{everbatim*}
+\xinttheiiexpr 5/3, round(5/3,3), trunc(5/3,3), trunc(\xintDiv {5}{3},3),
+trunc(\xintRaw {5/3},3)\relax{} are problematic, but
+%
+\xinttheiiexpr 5/3, round(qfrac(5/3),3), trunc(qfrac(5/3),3), floor(qfrac(5/3)),
+ceil(qfrac(5/3))\relax{} work!
+\end{everbatim*}
+
+On the other hand decimal numbers and scientific numbers can be used directly
+as arguments to the |num|, |round|, or any function producing an integer.
+
+\begin{framed}
+ Scientific numbers will be
+ represented with as many zeroes as necessary, thus one does not want to
+ insert \dtt{num(1e100000)} for example in an \csa{xintiiexpr}ession !
+\end{framed}
+
+%
+\begin{everbatim*}
+\xinttheiiexpr num(13.4567e3)+num(10000123e-3)\relax % should (num truncates) compute 13456+10000
+\end{everbatim*}
+%
+
+The |reduce| function is not available and will raise un error. The |frac|
+function also. The |sqrt| function is mapped to \csbxint{iiSqrt} which gives
+a truncated square root. The |sqrtr| function is mapped to \csbxint{iiSqrtR}
+which gives a rounded square root.
+
+One can use the Float macros if one is careful to use |num|, or |round|
+etc\dots on their output.
+
+\begin{everbatim*}
+\xinttheiiexpr \xintFloatSqrt [20]{2}, \xintFloatSqrt [20]{3}\relax % no operations
+
+\noindent The next example requires the |round|, and one could not put the |+| inside it:
+
+\xinttheiiexpr round(\xintFloatSqrt [20]{2},19)+round(\xintFloatSqrt [20]{3},19)\relax
+
+(the second argument of |round| and |trunc| tells how many digits from after the
+decimal mark one should keep.)
+\end{everbatim*}
+
+The whole point of \csbxint{iiexpr} is to gain some speed in
+\emph{integer-only} algorithms, and the above explanations related to how to
+nevertheless use fractions therein are a bit peripheral. We observed
+(2013/12/18) of the order of $30$\% speed gain when dealing with numbers with
+circa one hundred digits (1.2: this info may be obsolete).
+
+
+|\thexintiiexpr| is synonym to |\xinttheiiexpr|.
+
+\subsection{\csh{xintboolexpr},
+ \csh{xinttheboolexpr}}
+\label{xintboolexpr}\label{xinttheboolexpr}\label{thexintboolexpr}
+
+
+Equivalent\etype{x} to doing |\xintexpr ...\relax| and returning $1$ if the
+result does not vanish, and $0$ is the result is zero. As |\xintexpr|, this
+can be used on comma separated lists of expressions, and will return a
+comma separated list of $0$'s and $1$'s.
+
+|\thexintboolexpr| is synonym to |\xinttheboolexpr|.
+
+There is slight quirk in case it is used as a sub-expression: the boolean
+expression needs at least one logic operation else the value is not
+standardized to |1| or |0|, for example we get from
+\begin{everbatim*}
+\xinttheexpr \xintboolexpr 1.23\relax\relax\newline
+\end{everbatim*}which is to be compared with
+\begin{everbatim*}
+\xinttheboolexpr 1.23\relax
+\end{everbatim*}
+
+A related issue existed with
+|\xinttheexpr \xintiexpr 1.23\relax\relax|, which was fixed with |1.1|
+release, and I decided back then not to add the needed overhead also to the
+|\xintboolexpr| context, as one only needs to use |?(1.23)| for example or
+involve the |1.23| in any logic operation like |1.23 'and' 3.45|, or involve
+the |\xintboolexpr ..\relax | itself with any logical operation, contrarily to
+the sub-|\xintiexpr| case where |\xinttheexpr 1+\xintiexpr 1.23\relax\relax|
+did behave contrarily to expectations until |1.1|.
+
+
+\subsection{\csh{xintfloatexpr},
+ \csh{xintthefloatexpr}}
+\label{xintfloatexpr}\label{xintthefloatexpr}\label{thexintfloatexpr}
+
+\csbxint{floatexpr}|...\relax|\etype{x} is exactly like |\xintexpr...\relax|
+but with the four binary operations and the power function are mapped to
+\csa{xintFloatAdd}, \csa{xintFloatSub}, \csa{xintFloatMul}, \csa{xintFloatDiv}
+and \csa{xintFloatPower}, respectively.\footnote{Since |1.2f| the \string^
+ handles half-integer exponents, contrarily to \csa{xintFloatPower}.}
+
+The target precision for the computation is from the
+current setting of |\xintDigits|. Comma separated lists of expressions are
+allowed.
+
+An optional (positive) parameter within brackets is allowed: the final float
+will have that many digits of precision. This is provided to get rid of
+possibly irrelevant last digits, thus makes sense only if this parameter is
+less than the |\xinttheDigits| precision.
+
+Since |1.2f| all float operations first round their arguments; a parsed number
+is not rounded prior to its use as operand to such a float operation.
+
+|\thexintfloatexpr| is synonym to |\xintthefloatexpr|.
+
+|\xintDigits:=36;|\xintDigits:=36;
+%
+\leftedline{|\xintthefloatexpr
+ (1/13+1/121)*(1/179-1/173)/(1/19-1/18)\relax|}
+%
+\leftedline{\dtt{\xintthefloatexpr
+ (1/13+1/121)*(1/179-1/173)/(1/19-1/18)\relax}}
+% 0.00564487459334466559166166079096852897
+%
+\leftedline{|\xintthefloatexpr\xintexpr
+ (1/13+1/121)*(1/179-1/173)/(1/19-1/18)\relax\relax|}
+%
+\leftedline{\dtt{\xintthefloatexpr\xintexpr
+ (1/13+1/121)*(1/179-1/173)/(1/19-1/18)\relax\relax}}
+
+\xintDigits := 16;
+
+The latter is the rounding of the exact result. The former one has
+its last three digits wrong due to the cumulative effect of rounding errors
+in the intermediate computations, as compared to exact evaluations.
+
+
+
+
+I recall here from \autoref{ssec:floatingpoint} that with release |1.2f| the
+float macros for addition, subtraction, multiplication and division round
+their arguments first to |P| significant places with |P| the asked-for
+precision of the output; and similarly the power macros and the
+square root macro. This does not modify anything for computations with
+arguments having at most |P| significant places already.
+
+\subsection{Using an expression parser within another one}
+
+This was already illustrated before. In the following:
+\begin{everbatim*}
+\xintthefloatexpr \xintexpr add(1/i, i=1234..1243)\relax ^100\relax
+\end{everbatim*},
+the inner sum is computed exactly. Then it will be rounded to |\xinttheDigits|
+significant digits, and then its power will be evaluated as a float operation.
+One should avoid the "|\xintthe|" parsers in inner positions as this induces
+digit by digit parsing of the inner computation result by the outer parser.
+Here is the same computation done with floats all the way:
+\begin{everbatim*}
+\xintthefloatexpr add(1/i, i=1234..1243)^100\relax
+\end{everbatim*}
+
+Not surprisingly this differs from the previous one which was exact until
+raising to the |100|th power.
+
+The fact that the inner expression occurs inside a bigger one has nil
+influence on its behaviour. There is the limitation though that the outputs
+from \csbxint{expr} and \csbxint{floatexpr} can not be used directly in
+\csbxint{theiiexpr} integer-only parser. But one can do:
+\begin{everbatim*}
+\xinttheiiexpr round(\xintfloatexpr 3.14^10\relax)\relax % or trunc
+\end{everbatim*}
+
+
+\subsection{The \csh{xintthecoords} macro}
+\label{xintthecoords}
+
+It converts a comma separated list into the format for list of coordinates as
+expected by the |TikZ| |coordinates| syntax. The code had to work around the
+problem that |TikZ| seemingly allows only a maximal number of about one
+hundred expansion steps for the list to be entirely produced. Presumably to
+catch an infinite loop.
+\begin{everbatim*}
+\begin{figure}[htbp]
+\centering\begin{tikzpicture}[scale=10]\xintDigits:=8;
+ \clip (-1.1,-.25) rectangle (.3,.25);
+ \draw [blue] (-1.1,0)--(1,0);
+ \draw [blue] (0,-1)--(0,+1);
+ \draw [red] plot[smooth] coordinates {%
+ \xintthecoords % (converts what is next into (x1, y1) (x2, y2)... format)
+ \xintfloatexpr seq((x^2-1,mul(x-t,t=-1+[0..4]/2)),x=-1.2..[0.1]..+1.2) \relax };
+\end{tikzpicture}
+\caption{Coordinates with \cs{xintthecoords}.}
+\end{figure}
+\end{everbatim*}
+
+% Notice: if x goes no take exactly value 1 or -1, the origin appears slightly
+% off the curve, not MY fault!!!
+
+\csbxint{thecoords} should be followed immediately by \csbxint{floatexpr} or
+\csbxint{iexpr} or \csbxint{iiexpr}, but not |\xintthefloatexpr|, etc\dots
+
+Besides, as |TikZ| will not understand the |A/B[N]| format which is used on
+output by |\xintexpr|, |\xintexpr| is not really usable with |\xintthecoords|
+for a |TikZ| picture, but one may use it on its own, and the reason for the
+spaces in and between coordinate pairs is to allow if necessary to print on
+the page for examination with about correct line-breaks.
+
+\begin{everbatim*}
+\edef\x{\xintthecoords \xintexpr rrseq(1/2,1/3; @1+@2, x=1..20)\relax }
+\meaning\x +++
+\end{everbatim*}
+
+
+\subsection{\csh{xintifboolexpr}}\label{xintifboolexpr}
+
+\csh{xintifboolexpr}|{<expr>}{YES}{NO}|\etype{xnn} does |\xinttheexpr
+<expr>\relax| and then executes the |YES| or the |NO| branch depending on
+whether the outcome was non-zero or zero. |<expr>| can involve various |&| and
+\verb+|+, parentheses, |all|, |any|, |xor|, the |bool| or |togl| operators, but
+is not limited to them: the most general computation can be done, the test is on
+whether the outcome of the computation vanishes or not.
+
+Will not work on an expression composed of comma separated sub-expressions.
+
+\subsection{\csh{xintifboolfloatexpr}}\label{xintifboolfloatexpr}
+
+\csh{xintifboolfloatexpr}|{<expr>}{YES}{NO}|\etype{xnn} does |\xintthefloatexpr
+<expr>\relax| and then executes the |YES| or the |NO| branch depending on
+whether the outcome was non zero or zero.
+
+\subsection{\csh{xintifbooliiexpr}}\label{xintifbooliiexpr}
+
+\csh{xintifbooliiexpr}|{<expr>}{YES}{NO}|\etype{xnn} does |\xinttheiiexpr
+<expr>\relax| and then executes the |YES| or the |NO| branch depending on
+whether the outcome was non zero or zero.
+
+\subsection{The \csh{xintNewExpr} macro}
\label{xintNewExpr}
The macro is used as:
@@ -12203,7 +12788,7 @@ the parser will find |][#4:| and not |][:|.
discussion that follows applies to them too.
\end{framed}
-\subsubsection {Conditional operators and \csbh{NewExpr}}
+\subsubsection {Conditional operators and \csh{NewExpr}}
\label{sssec:cond}
The |?| and |??| conditional operators cannot be parsed by |\xintNewExpr| when
@@ -12234,7 +12819,7 @@ Another example
Again, this macro gobbles the false branches, as would have the operator |??|
inside an |\xintexpr|-ession.
-\subsubsection{External macros and \csbh{xintNewExpr}; the protect function}
+\subsubsection{External macros and \csh{xintNewExpr}; the protect function}
\label{sssec:protect}
For macros within such a created \xintname-formula macro, there
@@ -12269,10 +12854,10 @@ way; the |+|, |*|, etc\dots symbols, the functions from the \csbxint{expr}
syntax, none should ever be included in a protected string.
-\subsubsection{Limitations of \csbxint{NewExpr} and \csbxint{deffunc}}
+\subsubsection{Limitations of \csh{NewExpr} and \csh{deffunc}}
\label{sssec:limitations}
-\csa{xintNewExpr} will pre-evaluate everything as long as it does not contain
+\csbxint{NewExpr} will pre-evaluate everything as long as it does not contain
the macro parameters |#1|, |#2|, ... and the special measures to take when
these are inside branches to |?| and |??| (replace these operators by |if| and
|ifsgn|) or as arguments to macros external to \xintexprname (use |protect|)
@@ -12334,299 +12919,7 @@ have no issue. Anyway, one should never use |\xinttheexpr| for sub-expressions
but only |\xintexpr|, so this restriction on the \csa{xintNewExpr} syntax
isn't really one.
-\subsection{The \csbh{xintNewFunction} macro}
-
-See \autoref{xintNewFunction} for its documentation.
-
-\subsection{\csbh{xintiexpr}, \csbh{xinttheiexpr}}
-\label{xintiexpr}\label{xinttheiexpr}\label{thexintiexpr}
-
-Equivalent\etype{x} to doing |\xintexpr round(...)\relax| (more precisely,
-|round| is applied to each one of the evaluated values, if the expression was
-comma separated). Thus, only the \emph{final result value} is rounded to an
-integer. Half integers are rounded towards $+\infty$ for positive numbers and
-towards $-\infty$ for negative ones.
-
-An optional parameter |d>0| within brackets, immediately after |\xintiexpr|
-is allowed: it instructs the expression to do its final rounding to the
-nearest value with that many digits after the decimal mark, \emph{i.e.},
-|\xintiexpr [d] <expression>\relax| is equivalent (in case of a single
-expression) to |\xintexpr round(<expression>, d)\relax|.
-
-|\xintiexpr [0] ...| is the same as |\xintiexpr ...|.\footnote{Incidentally
- using |round(...,0)| in place of |round(...)| in |\xintexpr| would leave a
- trailing dot in the produced value.}
-
-If truncation rather than rounding is needed use (in case of a single
-expression, naturally) |\xintexpr trunc(...)\relax| for truncation to an
-integer or |\xintexpr trunc(...,d)\relax| for truncation to a decimal number
-with |d>0| digits after the decimal mark.
-
-Perhaps in the future some meaning will be given to using negative value for
-the optional parameter |d|.\footnote{Thanks to KT for this suggestion.}
-
-|\thexintiexpr| is synonym to |\xinttheiexpr|.
-
-\subsection{\csbh{xintiiexpr}, \csbh{xinttheiiexpr}}
-\label{xintiiexpr}\label{xinttheiiexpr}\label{thexintiiexpr}
-
-This variant\etype{x} does not know fractions. It deals almost only with long
-integers. Comma separated lists of expressions are allowed.
-
-\begin{framed}
- It maps |/| to the \emph{rounded} quotient. The operator
- |//| is, like in |\xintexpr...\relax|, mapped to \emph{truncated} division.
- The Euclidean quotient (which for positive operands is like the truncated
- quotient) was, prior to release |1.1|, associated to |/|. The function
- |quo(a,b)| can still be employed.
-\end{framed}
-
-The \csbxint{iiexpr}-essions use the `ii' macros for addition, subtraction,
-multiplication, power, square, sums, products, Euclidean quotient and
-remainder.
-
-The |round|, |trunc|, |floor|, |ceil| functions are still available, and are
-about the only places where fractions can be used, but |/| within, if not
-somehow hidden will be executed as integer rounded division. To avoid this one
-can wrap the input in \dtt{qfrac}: this means however that none of the normal
-expression parsing will be executed on the argument.
-
-To understand the illustrative examples, recall that |round| and |trunc| have
-a second (non negative) optional argument. In a normal \csbxint{expr}-essions,
-|round| and |trunc| are mapped to \csbxint{Round} and \csbxint{Trunc}, in
-\csbxint{iiexpr}-essions, they are mapped to \csbxint{iRound} and
-\csbxint{iTrunc}.
-
-
-\begin{everbatim*}
-\xinttheiiexpr 5/3, round(5/3,3), trunc(5/3,3), trunc(\xintDiv {5}{3},3),
-trunc(\xintRaw {5/3},3)\relax{} are problematic, but
-%
-\xinttheiiexpr 5/3, round(qfrac(5/3),3), trunc(qfrac(5/3),3), floor(qfrac(5/3)),
-ceil(qfrac(5/3))\relax{} work!
-\end{everbatim*}
-
-On the other hand decimal numbers and scientific numbers can be used directly
-as arguments to the |num|, |round|, or any function producing an integer.
-
-\begin{framed}
- Scientific numbers will be
- represented with as many zeroes as necessary, thus one does not want to
- insert \dtt{num(1e100000)} for example in an \csa{xintiiexpr}ession !
-\end{framed}
-
-%
-\begin{everbatim*}
-\xinttheiiexpr num(13.4567e3)+num(10000123e-3)\relax % should (num truncates) compute 13456+10000
-\end{everbatim*}
-%
-
-The |reduce| function is not available and will raise un error. The |frac|
-function also. The |sqrt| function is mapped to \csbxint{iiSqrt} which gives
-a truncated square root. The |sqrtr| function is mapped to \csbxint{iiSqrtR}
-which gives a rounded square root.
-
-One can use the Float macros if one is careful to use |num|, or |round|
-etc\dots on their output.
-
-\begin{everbatim*}
-\xinttheiiexpr \xintFloatSqrt [20]{2}, \xintFloatSqrt [20]{3}\relax % no operations
-
-\noindent The next example requires the |round|, and one could not put the |+| inside it:
-
-\xinttheiiexpr round(\xintFloatSqrt [20]{2},19)+round(\xintFloatSqrt [20]{3},19)\relax
-
-(the second argument of |round| and |trunc| tells how many digits from after the
-decimal mark one should keep.)
-\end{everbatim*}
-
-The whole point of \csbxint{iiexpr} is to gain some speed in
-\emph{integer-only} algorithms, and the above explanations related to how to
-nevertheless use fractions therein are a bit peripheral. We observed
-(2013/12/18) of the order of $30$\% speed gain when dealing with numbers with
-circa one hundred digits (1.2: this info may be obsolete).
-
-
-|\thexintiiexpr| is synonym to |\xinttheiiexpr|.
-
-\subsection{\csbh{xintboolexpr},
- \csbh{xinttheboolexpr}}
-\label{xintboolexpr}\label{xinttheboolexpr}\label{thexintboolexpr}
-
-
-Equivalent\etype{x} to doing |\xintexpr ...\relax| and returning $1$ if the
-result does not vanish, and $0$ is the result is zero. As |\xintexpr|, this
-can be used on comma separated lists of expressions, and will return a
-comma separated list of $0$'s and $1$'s.
-
-|\thexintboolexpr| is synonym to |\xinttheboolexpr|.
-
-There is slight quirk in case it is used as a sub-expression: the boolean
-expression needs at least one logic operation else the value is not
-standardized to |1| or |0|, for example we get from
-\begin{everbatim*}
-\xinttheexpr \xintboolexpr 1.23\relax\relax\newline
-\end{everbatim*}which is to be compared with
-\begin{everbatim*}
-\xinttheboolexpr 1.23\relax
-\end{everbatim*}
-
-A related issue existed with
-|\xinttheexpr \xintiexpr 1.23\relax\relax|, which was fixed with |1.1|
-release, and I decided back then not to add the needed overhead also to the
-|\xintboolexpr| context, as one only needs to use |?(1.23)| for example or
-involve the |1.23| in any logic operation like |1.23 'and' 3.45|, or involve
-the |\xintboolexpr ..\relax | itself with any logical operation, contrarily to
-the sub-|\xintiexpr| case where |\xinttheexpr 1+\xintiexpr 1.23\relax\relax|
-did behave contrarily to expectations until |1.1|.
-
-
-\subsection{\csbh{xintfloatexpr},
- \csbh{xintthefloatexpr}}
-\label{xintfloatexpr}\label{xintthefloatexpr}\label{thexintfloatexpr}
-
-\csbxint{floatexpr}|...\relax|\etype{x} is exactly like |\xintexpr...\relax|
-but with the four binary operations and the power function are mapped to
-\csa{xintFloatAdd}, \csa{xintFloatSub}, \csa{xintFloatMul}, \csa{xintFloatDiv}
-and \csa{xintFloatPower}, respectively.\footnote{Since |1.2f| the \string^
- handles half-integer exponents, contrarily to \csa{xintFloatPower}.}
-
-The target precision for the computation is from the
-current setting of |\xintDigits|. Comma separated lists of expressions are
-allowed.
-
-An optional (positive) parameter within brackets is allowed: the final float
-will have that many digits of precision. This is provided to get rid of
-possibly irrelevant last digits, thus makes sense only if this parameter is
-less than the |\xinttheDigits| precision.
-
-Since |1.2f| all float operations first round their arguments; a parsed number
-is not rounded prior to its use as operand to such a float operation.
-
-|\thexintfloatexpr| is synonym to |\xintthefloatexpr|.
-
-|\xintDigits:=36;|\xintDigits:=36;
-%
-\leftedline{|\xintthefloatexpr
- (1/13+1/121)*(1/179-1/173)/(1/19-1/18)\relax|}
-%
-\leftedline{\dtt{\xintthefloatexpr
- (1/13+1/121)*(1/179-1/173)/(1/19-1/18)\relax}}
-% 0.00564487459334466559166166079096852897
-%
-\leftedline{|\xintthefloatexpr\xintexpr
- (1/13+1/121)*(1/179-1/173)/(1/19-1/18)\relax\relax|}
-%
-\leftedline{\dtt{\xintthefloatexpr\xintexpr
- (1/13+1/121)*(1/179-1/173)/(1/19-1/18)\relax\relax}}
-
-\xintDigits := 16;
-
-The latter is the rounding of the exact result. The former one has
-its last three digits wrong due to the cumulative effect of rounding errors
-in the intermediate computations, as compared to exact evaluations.
-
-
-
-
-I recall here from \autoref{ssec:floatingpoint} that with release |1.2f| the
-float macros for addition, subtraction, multiplication and division round
-their arguments first to |P| significant places with |P| the asked-for
-precision of the output; and similarly the power macros and the
-square root macro. This does not modify anything for computations with
-arguments having at most |P| significant places already.
-
-\subsection{Using an expression parser within another one}
-
-This was already illustrated before. In the following:
-\begin{everbatim*}
-\xintthefloatexpr \xintexpr add(1/i, i=1234..1243)\relax ^100\relax
-\end{everbatim*},
-the inner sum is computed exactly. Then it will be rounded to |\xinttheDigits|
-significant digits, and then its power will be evaluated as a float operation.
-One should avoid the "|\xintthe|" parsers in inner positions as this induces
-digit by digit parsing of the inner computation result by the outer parser.
-Here is the same computation done with floats all the way:
-\begin{everbatim*}
-\xintthefloatexpr add(1/i, i=1234..1243)^100\relax
-\end{everbatim*}
-
-Not surprisingly this differs from the previous one which was exact until
-raising to the |100|th power.
-
-The fact that the inner expression occurs inside a bigger one has nil
-influence on its behaviour. There is the limitation though that the outputs
-from \csbxint{expr} and \csbxint{floatexpr} can not be used directly in
-\csbxint{theiiexpr} integer-only parser. But one can do:
-\begin{everbatim*}
-\xinttheiiexpr round(\xintfloatexpr 3.14^10\relax)\relax % or trunc
-\end{everbatim*}
-
-
-\subsection{The \csbh{xintthecoords} macro}
-\label{xintthecoords}
-
-It converts a comma separated list into the format for list of coordinates as
-expected by the |TikZ| |coordinates| syntax. The code had to work around the
-problem that |TikZ| seemingly allows only a maximal number of about one
-hundred expansion steps for the list to be entirely produced. Presumably to
-catch an infinite loop.
-\begin{everbatim*}
-\begin{figure}[htbp]
-\centering\begin{tikzpicture}[scale=10]\xintDigits:=8;
- \clip (-1.1,-.25) rectangle (.3,.25);
- \draw [blue] (-1.1,0)--(1,0);
- \draw [blue] (0,-1)--(0,+1);
- \draw [red] plot[smooth] coordinates {%
- \xintthecoords % (converts what is next into (x1, y1) (x2, y2)... format)
- \xintfloatexpr seq((x^2-1,mul(x-t,t=-1+[0..4]/2)),x=-1.2..[0.1]..+1.2) \relax };
-\end{tikzpicture}
-\caption{Coordinates with \cs{xintthecoords}.}
-\end{figure}
-\end{everbatim*}
-
-% Notice: if x goes no take exactly value 1 or -1, the origin appears slightly
-% off the curve, not MY fault!!!
-
-\csbxint{thecoords} should be followed immediately by \csbxint{floatexpr} or
-\csbxint{iexpr} or \csbxint{iiexpr}, but not |\xintthefloatexpr|, etc\dots
-
-Besides, as |TikZ| will not understand the |A/B[N]| format which is used on
-output by |\xintexpr|, |\xintexpr| is not really usable with |\xintthecoords|
-for a |TikZ| picture, but one may use it on its own, and the reason for the
-spaces in and between coordinate pairs is to allow if necessary to print on
-the page for examination with about correct line-breaks.
-
-\begin{everbatim*}
-\edef\x{\xintthecoords \xintexpr rrseq(1/2,1/3; @1+@2, x=1..20)\relax }
-\meaning\x +++
-\end{everbatim*}
-
-
-\subsection{\csbh{xintifboolexpr}}\label{xintifboolexpr}
-
-\csh{xintifboolexpr}|{<expr>}{YES}{NO}|\etype{xnn} does |\xinttheexpr
-<expr>\relax| and then executes the |YES| or the |NO| branch depending on
-whether the outcome was non-zero or zero. |<expr>| can involve various |&| and
-\verb+|+, parentheses, |all|, |any|, |xor|, the |bool| or |togl| operators, but
-is not limited to them: the most general computation can be done, the test is on
-whether the outcome of the computation vanishes or not.
-
-Will not work on an expression composed of comma separated sub-expressions.
-
-\subsection{\csbh{xintifboolfloatexpr}}\label{xintifboolfloatexpr}
-
-\csh{xintifboolfloatexpr}|{<expr>}{YES}{NO}|\etype{xnn} does |\xintthefloatexpr
-<expr>\relax| and then executes the |YES| or the |NO| branch depending on
-whether the outcome was non zero or zero.
-
-\subsection{\csbh{xintifbooliiexpr}}\label{xintifbooliiexpr}
-
-\csh{xintifbooliiexpr}|{<expr>}{YES}{NO}|\etype{xnn} does |\xinttheiiexpr
-<expr>\relax| and then executes the |YES| or the |NO| branch depending on
-whether the outcome was non zero or zero.
-
-\subsection{\csbh{xintNewFloatExpr}}\label{xintNewFloatExpr}
+\subsection{\csh{xintNewFloatExpr}}\label{xintNewFloatExpr}
This is exactly like \csbxint{NewExpr} except that the created formulas are
set-up to use |\xintthefloatexpr|. Careful though that the |[...]| list syntax
@@ -12663,7 +12956,7 @@ The |sqrt(2)| in the first |sqrt(#1)*sqrt(2)| NewFloatExpression was computed
with only \dtt{\xinttheDigits} digits of precision. In the second one, the
|sqrt(2)| gets pre-evaluated with \dtt{32} digits of precision.
-\subsection{\csbh{xintNewIExpr}}\label{xintNewIExpr}
+\subsection{\csh{xintNewIExpr}}\label{xintNewIExpr}
Like \csbxint{NewExpr} but using |\xinttheiexpr|. As |\xintiexpr| admits an
optional rounding argument |[N]| the same caveat when square brackets come
@@ -12671,16 +12964,28 @@ first in the expression as in the discussion of \csbxint{NewFloatExpr}
applies.
-\subsection{\csbh{xintNewIIExpr}}\label{xintNewIIExpr}
+\subsection{\csh{xintNewIIExpr}}\label{xintNewIIExpr}
Like \csbxint{NewExpr} but using |\xinttheiiexpr|.
-\subsection{\csbh{xintNewBoolExpr}}\label{xintNewBoolExpr}
+\subsection{\csh{xintNewBoolExpr}}\label{xintNewBoolExpr}
Like \csbxint{NewExpr} but using |\xinttheboolexpr|.
\xintDigits:= 16;
+\subsection{The \cshnolabel{xintdefvar}, \cshnolabel{xintdefiivar}, \cshnolabel{xintdeffloatvar} macros}
+
+See \autoref{xintdefvar} for their documentation.
+
+\subsection{The \cshnolabel{xintdeffunc}, \cshnolabel{xintdefiifunc}, \cshnolabel{xintdeffloatfunc} macros}
+
+See \autoref{xintdeffunc} for their documentation.
+
+\subsection{The \cshnolabel{xintNewFunction} macro}
+
+See \autoref{xintNewFunction} for its documentation.
+
\subsection{Technicalities}
As already mentioned \csa{xintNewExpr}|\myformula[n]| does not check the prior
@@ -12762,8 +13067,10 @@ principles are necessarily different due to the aim of achieving expandability.
\clearpage
+\let\xintexprnameUp\undefined
+\csname xintbinhexnameUp\endcsname
\section{Macros of the \xintbinhexname package}
-\label{sec:binhex}
+\RaisedLabel{sec:binhex}
\localtableofcontents
@@ -12857,19 +13164,19 @@ power of two multiplicand is not implemented.
% \clearpage
-\subsection{\csbh{xintDecToHex}}\label{xintDecToHex}
+\subsection{\csh{xintDecToHex}}\label{xintDecToHex}
Converts from decimal to hexadecimal.\etype{f}
\texttt{\string\xintDecToHex \string{\printnumber{2718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003}\string}}\endgraf\noindent\dtt{->\printnumber{\xintDecToHex{2718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003}}}
-\subsection{\csbh{xintDecToBin}}\label{xintDecToBin}
+\subsection{\csh{xintDecToBin}}\label{xintDecToBin}
Converts from decimal to binary.\etype{f}
\texttt{\string\xintDecToBin \string{\printnumber{2718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003}\string}}\endgraf\noindent\dtt{->\printnumber{\xintDecToBin{2718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003}}}
-\subsection{\csbh{xintHexToDec}}\label{xintHexToDec}
+\subsection{\csh{xintHexToDec}}\label{xintHexToDec}
Converts from hexadecimal to decimal.\etype{f}
@@ -12877,7 +13184,7 @@ Converts from hexadecimal to decimal.\etype{f}
\string{\printnumber{11A9397C66949A97051F7D0A817914E3E0B17C41B11C48BAEF2B5760BB38D272F46DCE46C6032936BF37DAC918814C63}\string}}\endgraf\noindent
\dtt{->\printnumber{\xintHexToDec{11A9397C66949A97051F7D0A817914E3E0B17C41B11C48BAEF2B5760BB38D272F46DCE46C6032936BF37DAC918814C63}}}
-\subsection{\csbh{xintBinToDec}}\label{xintBinToDec}
+\subsection{\csh{xintBinToDec}}\label{xintBinToDec}
Converts from binary to decimal.\etype{f}
@@ -12885,7 +13192,7 @@ Converts from binary to decimal.\etype{f}
\string{\printnumber{100011010100100111001011111000110011010010100100110101001011100000101000111110111110100001010100000010111100100010100111000111110000010110001011111000100000110110001000111000100100010111010111011110010101101010111011000001011101100111000110100100111001011110100011011011100111001000110110001100000001100101001001101101011111100110111110110101100100100011000100000010100110001100011}\string}}\endgraf\noindent
\dtt{->\printnumber{\xintBinToDec{100011010100100111001011111000110011010010100100110101001011100000101000111110111110100001010100000010111100100010100111000111110000010110001011111000100000110110001000111000100100010111010111011110010101101010111011000001011101100111000110100100111001011110100011011011100111001000110110001100000001100101001001101101011111100110111110110101100100100011000100000010100110001100011}}}
-\subsection{\csbh{xintBinToHex}}\label{xintBinToHex}
+\subsection{\csh{xintBinToHex}}\label{xintBinToHex}
Converts from binary to hexadecimal.\etype{f} The input is first zero-filled
to |4N| binary digits, hence the output will have |N| hexadecimal digits
@@ -12895,7 +13202,7 @@ to |4N| binary digits, hence the output will have |N| hexadecimal digits
\string{\printnumber{100011010100100111001011111000110011010010100100110101001011100000101000111110111110100001010100000010111100100010100111000111110000010110001011111000100000110110001000111000100100010111010111011110010101101010111011000001011101100111000110100100111001011110100011011011100111001000110110001100000001100101001001101101011111100110111110110101100100100011000100000010100110001100011}\string}}\endgraf\noindent
\dtt{->\printnumber{\xintBinToHex{100011010100100111001011111000110011010010100100110101001011100000101000111110111110100001010100000010111100100010100111000111110000010110001011111000100000110110001000111000100100010111010111011110010101101010111011000001011101100111000110100100111001011110100011011011100111001000110110001100000001100101001001101101011111100110111110110101100100100011000100000010100110001100011}}}
-\subsection{\csbh{xintHexToBin}}\label{xintHexToBin}
+\subsection{\csh{xintHexToBin}}\label{xintHexToBin}
Converts from hexadecimal to binary. Up to three leading zeroes of the output
are trimmed.\etype{f}
@@ -12904,7 +13211,7 @@ are trimmed.\etype{f}
\string{\printnumber{11A9397C66949A97051F7D0A817914E3E0B17C41B11C48BAEF2B5760BB38D272F46DCE46C6032936BF37DAC918814C63}\string}}\endgraf\noindent
\dtt{->\printnumber{\xintHexToBin{11A9397C66949A97051F7D0A817914E3E0B17C41B11C48BAEF2B5760BB38D272F46DCE46C6032936BF37DAC918814C63}}}
-\subsection{\csbh{xintCHexToBin}}\label{xintCHexToBin}
+\subsection{\csh{xintCHexToBin}}\label{xintCHexToBin}
Converts from hexadecimal to binary.\etype{f} Same as \csbxint{HexToBin}, but
an input with |N| hexadecimal digits will give an output with exactly |4N|
@@ -12936,8 +13243,10 @@ $000000001111101001010001\xrightarrow{\text{\string\xintBinToHex}}
\par
\end{everbatim*}
\clearpage
+\let\xintbinhexnameUp\undefined
+\csname xintgcdnameUp\endcsname
\section{Macros of the \xintgcdname package}
-\label{sec:gcd}
+\RaisedLabel{sec:gcd}
\localtableofcontents
@@ -12954,7 +13263,7 @@ loading by the user of package \xinttoolsname.
%% \clearpage
-\subsection{\csbh{xintGCD}, \csbh{xintiiGCD}}\label{xintGCD}\label{xintiiGCD}
+\subsection{\csh{xintGCD}, \csh{xintiiGCD}}\label{xintGCD}\label{xintiiGCD}
|\xintGCD|\n\m\etype{\Numf\Numf} computes the greatest common divisor. It is
positive, except when both |N| and |M| vanish, in which case the macro returns
@@ -12967,26 +13276,26 @@ zero.
\csa{xintiiGCD} skips the \csbxint{Num} overhead.\etype{ff}
-\subsection{\csbh{xintGCDof}}\label{xintGCDof}
+\subsection{\csh{xintGCDof}}\label{xintGCDof}
\csa{xintGCDof}|{{a}{b}{c}...}|\etype{f{$\to$}{\lowast\Numf}} computes the greatest common divisor of all
integers |a|, |b|, \dots{} The list argument
may be a macro, it is \fexpan ded first and must contain at least one item.
-\subsection{\csbh{xintLCM}, \csbh{xintiiLCM}}\label{xintLCM}\label{xintiiLCM}
+\subsection{\csh{xintLCM}, \csh{xintiiLCM}}\label{xintLCM}\label{xintiiLCM}
|\xintGCD|\n\m\etype{\Numf\Numf} computes the least common multiple. It is
|0| if one of the two integers vanishes.
\csa{xintiiLCM} skips the \csbxint{Num} overhead.\etype{ff}
-\subsection{\csbh{xintLCMof}}\label{xintLCMof}
+\subsection{\csh{xintLCMof}}\label{xintLCMof}
\csa{xintLCMof}|{{a}{b}{c}...}|\etype{f{$\to$}{\lowast\Numf}} computes the least
common multiple of all integers |a|, |b|, \dots{} The list argument may be a
macro, it is \fexpan ded first and must contain at least one item.
-\subsection{\csbh{xintBezout}}\label{xintBezout}
+\subsection{\csh{xintBezout}}\label{xintBezout}
|\xintBezout|\n\m\etype{\Numf\Numf} returns three numbers |U|, |V|,
|D| within braces where |D| is the (non-negative) GCD, and \dtt{UN + VM = D}.
@@ -13001,7 +13310,7 @@ U: \meaning\U, V: \meaning\V, D: \meaning\D\par
AU+BV: \xinttheiiexpr 123456789012345*\U+9876543210321*\V\relax
\end{everbatim*}
-\subsection{\csbh{xintEuclideAlgorithm}}\label{xintEuclideAlgorithm}
+\subsection{\csh{xintEuclideAlgorithm}}\label{xintEuclideAlgorithm}
|\xintEuclideAlgorithm|\n\m\etype{\Numf\Numf} applies the Euclide algorithm
and keeps a copy of all quotients and remainders.
@@ -13014,7 +13323,7 @@ third is the GCD, the fourth is |M| then the first quotient and
remainder, the second quotient and remainder, \dots until the
final quotient and last (zero) remainder.
-\subsection{\csbh{xintBezoutAlgorithm}}\label{xintBezoutAlgorithm}
+\subsection{\csh{xintBezoutAlgorithm}}\label{xintBezoutAlgorithm}
|\xintBezoutAlgorithm|\n\m\etype{\Numf\Numf} applies the Euclide algorithm
and keeps a copy of all quotients and remainders. Furthermore it computes the
@@ -13030,7 +13339,7 @@ The first item is the number of steps, the second is |N|, then
remainder, the top left entry of the first matrix, the bottom left
entry, and then these four things at each step until the end.
-\subsection{\csbh{xintTypesetEuclideAlgorithm}}\label{xintTypesetEuclideAlgorithm}
+\subsection{\csh{xintTypesetEuclideAlgorithm}}\label{xintTypesetEuclideAlgorithm}
This macro is just an example of how to organize the data returned by
\csa{xintEuclideAlgorithm}.\ntype{\Numf\Numf} Copy the source code to a new
@@ -13041,7 +13350,7 @@ macro and modify it to what is needed.
\leftedline{|\xintTypesetEuclideAlgorithm {123456789012345}{9876543210321}|}
\xintTypesetEuclideAlgorithm {123456789012345}{9876543210321}
-\subsection{\csbh{xintTypesetBezoutAlgorithm}}%
+\subsection{\csh{xintTypesetBezoutAlgorithm}}%
\label{xintTypesetBezoutAlgorithm}
This macro is just an example of how to organize the data returned by
@@ -13054,8 +13363,10 @@ macro and modify it to what is needed.
\xintTypesetBezoutAlgorithm {10000}{1113}
\clearpage
+\let\xintgcdnameUp\undefined
+\csname xintseriesnameUp\endcsname
\section{Macros of the \xintseriesname package}
-\label{sec:series}
+\RaisedLabel{sec:series}
\localtableofcontents
@@ -13082,7 +13393,7 @@ stage not immediately.
\end{framed}
%% \clearpage
-\subsection{\csbh{xintSeries}}\label{xintSeries}
+\subsection{\csh{xintSeries}}\label{xintSeries}
\csa{xintSeries}|{A}{B}{\coeff}|\etype{\numx\numx\Ff} computes
$\sum_{\text{|n=A|}}^{\text{|n=B|}}$|\coeff{n}|. The initial and final indices
@@ -13130,7 +13441,8 @@ factor of \dtt{\xintNum {\xintDenominator\w/\xintDenominator\z}}.
\everb|@
\def\coeffleibnitz #1{\the\numexpr\ifodd #1 1\else-1\fi\relax/#1[0]}
\cnta 1
-\loop % in this loop we recompute from scratch each partial sum!
+\loop
+% in this loop we recompute from scratch each partial sum!
% we can afford that, as \xintSeries is fast enough.
\noindent\hbox to 2em{\hfil\texttt{\the\cnta.} }%
\xintTrunc {12}{\xintSeries {1}{\cnta}{\coeffleibnitz}}\dots
@@ -13147,7 +13459,7 @@ factor of \dtt{\xintNum {\xintDenominator\w/\xintDenominator\z}}.
\ifnum\cnta < 30 \advance\cnta 1 \repeat
\end{multicols}
-\subsection{\csbh{xintiSeries}}\label{xintiSeries}
+\subsection{\csh{xintiSeries}}\label{xintiSeries}
\def\coeff #1{\xintiTrunc {40}
{\the\numexpr\ifodd #1 -2\else2\fi\relax/\the\numexpr 2*#1+1\relax [0]}}%
@@ -13209,7 +13521,7 @@ estimated wrongly the 39th and 40th digits of the exact result%
%
and that the sum of rounded terms fared a bit better.
-\subsection{\csbh{xintRationalSeries}}\label{xintRationalSeries}
+\subsection{\csh{xintRationalSeries}}\label{xintRationalSeries}
\noindent \csa{xintRationalSeries}|{A}{B}{f}{\ratio}|\etype{\numx\numx\Ff\Ff}
@@ -13303,7 +13615,7 @@ $\sum_{n=\the\cnta}^{\the\numexpr 2*\cnta-1\relax} \frac{\the\cnta^n}{n!}/%
\end{everbatim*}
-\subsection{\csbh{xintRationalSeriesX}}\label{xintRationalSeriesX}
+\subsection{\csh{xintRationalSeriesX}}\label{xintRationalSeriesX}
\noindent\csa{xintRationalSeriesX}|{A}{B}{\first}{\ratio}{\g}|%
@@ -13422,7 +13734,7 @@ needs a general calculus of special functions. This is why the package
\csbxint{FxPtPowerSeries} for fixed-point computations and a (tentative naive)
\csbxint{FloatPowerSeries}.
-\subsection{\csbh{xintPowerSeries}}\label{xintPowerSeries}
+\subsection{\csh{xintPowerSeries}}\label{xintPowerSeries}
\csa{xintPowerSeries}|{A}{B}{\coeff}{f}|\etype{\numx\numx\Ff\Ff}
evaluates the sum
@@ -13490,7 +13802,7 @@ approach, is much less acute since release |1.1| and its new policy regarding
\end{everbatim*}
-\subsection{\csbh{xintPowerSeriesX}}\label{xintPowerSeriesX}
+\subsection{\csh{xintPowerSeriesX}}\label{xintPowerSeriesX}
%{\small\hspace*{\parindent}New with release |1.04|.\par}
@@ -13526,7 +13838,7 @@ an expanding only context, doing |\edef\g{\f}| is no option, then
\end{everbatim*}
-\subsection{\csbh{xintFxPtPowerSeries}}\label{xintFxPtPowerSeries}
+\subsection{\csh{xintFxPtPowerSeries}}\label{xintFxPtPowerSeries}
\csa{xintFxPtPowerSeries}|{A}{B}{\coeff}{f}{D}|\etype{\numx\numx}
computes
@@ -13602,7 +13914,7 @@ last |k| may usually be trusted. If we are optimistic and the series is
alternating we may even replace |N| with $\sqrt{|N|}$ to get the number |k|
of digits possibly of dubious significance.
-\subsection{\csbh{xintFxPtPowerSeriesX}}\label{xintFxPtPowerSeriesX}
+\subsection{\csh{xintFxPtPowerSeriesX}}\label{xintFxPtPowerSeriesX}
\noindent\csa{xintFxPtPowerSeriesX}|{A}{B}{\coeff}{\f}{D}|%
@@ -13676,7 +13988,7 @@ I guess there should be some macro to do this final truncating, or
better, rounding, at a given number |D'<D| of digits. Maybe for the next
release.
-\subsection{\csbh{xintFloatPowerSeries}}\label{xintFloatPowerSeries}
+\subsection{\csh{xintFloatPowerSeries}}\label{xintFloatPowerSeries}
\noindent\csa{xintFloatPowerSeries}|[P]{A}{B}{\coeff}{f}|%
@@ -13708,7 +14020,7 @@ with |\coeff{n}|, and the sum is done adding one term at a time with
%
\leftedline{\dtt{\xintFloatPowerSeries [8]{1}{30}{\coefflog}{-1/2[0]}}}
-\subsection{\csbh{xintFloatPowerSeriesX}}\label{xintFloatPowerSeriesX}
+\subsection{\csh{xintFloatPowerSeriesX}}\label{xintFloatPowerSeriesX}
\noindent\csa{xintFloatPowerSeriesX}|[P]{A}{B}{\coeff}{f}|%
@@ -13998,8 +14310,10 @@ earlier result gets validated. Finally if we do want the rounding we can
always do it on a value computed with |D+1| truncation.
\clearpage
+\let\xintseriesnameUp\undefined
+\csname xintcfracnameUp\endcsname
\section{Macros of the \xintcfracname package}
-\label{sec:cfrac}
+\RaisedLabel{sec:cfrac}
\localtableofcontents
@@ -14268,7 +14582,7 @@ $$\pi\to [\xintListWithSep{,}
\end{everbatim*}
-\subsection{\csbh{xintCFrac}}\label{xintCFrac}
+\subsection{\csh{xintCFrac}}\label{xintCFrac}
\csa{xintCFrac}|{f}|\ntype{\Ff} is a math-mode only, \LaTeX{} with |amsmath|
only, macro which first computes then displays with the help of |\cfrac| the
@@ -14280,7 +14594,7 @@ package. This macro is \fexpan dable in the sense that it prepares expandably
the whole expression with the multiple |\cfrac|'s, but it is not completely
expandable naturally as |\cfrac| isn't.
-\subsection{\csbh{xintGCFrac}}\label{xintGCFrac}
+\subsection{\csh{xintGCFrac}}\label{xintGCFrac}
\csa{xintGCFrac}|{a+b/c+d/e+f/g+h/...+x/y}|\ntype{f} uses similarly |\cfrac|
to prepare the typesetting with the |amsmath| |\cfrac| (\LaTeX{}) of a
@@ -14306,7 +14620,7 @@ for example. One of the reasons is that \csa{xintGCFrac} tries to
determine the signs of the numerators and chooses accordingly to use
$+$ or $-$.
-\subsection{\csbh{xintGGCFrac}}\label{xintGGCFrac}
+\subsection{\csh{xintGGCFrac}}\label{xintGGCFrac}
\csa{xintGGCFrac}|{a+b/c+d/e+f/g+h/...+x/y}|\ntype{f} is a clone of
\csbxint{GCFrac}, hence again \LaTeX{} specific with package
@@ -14323,7 +14637,7 @@ space.
\[\xintGGCFrac {1+q/1+q^2/1+q^3/1+q^4/1+q^5/\ddots}\]
\end{everbatim*}
-\subsection{\csbh{xintGCtoGCx}}\label{xintGCtoGCx}
+\subsection{\csh{xintGCtoGCx}}\label{xintGCtoGCx}
%{\small New with release |1.05|.\par}
\csa{xintGCtoGCx}|{sepa}{sepb}{a+b/c+d/e+f/...+x/y}|\etype{nnf} returns the list
@@ -14341,7 +14655,7 @@ $$\xintGCtoGCx {+\cfrac}{\\}{a+b/...}\endcfrac$$
$$\xintGCtoGCx {+\cfrac\xintFwOver}{\\\xintFwOver}{a+b/...}\endcfrac$$
|
-\subsection{\csbh{xintFtoC}}\label{xintFtoC}
+\subsection{\csh{xintFtoC}}\label{xintFtoC}
\csa{xintFtoC}|{f}|\etype{\Ff} computes the
coefficients of the simple continued fraction of |f| and returns them as a list
@@ -14351,7 +14665,7 @@ coefficients of the simple continued fraction of |f| and returns them as a list
\fdef\test{\xintFtoC{-5262046/89233}}\texttt{\meaning\test}
\end{everbatim*}
-\subsection{\csbh{xintFtoCs}}\label{xintFtoCs}
+\subsection{\csh{xintFtoCs}}\label{xintFtoCs}
\csa{xintFtoCs}|{f}|\etype{\Ff} returns the comma separated list of the
coefficients of the simple continued fraction of |f|. Notice that starting with
@@ -14361,7 +14675,7 @@ mode spaces are produced in the typeset output by \TeX{} itself).
\[ \xintSignedFrac{-5262046/89233} \to [\xintFtoCs{-5262046/89233}]\]
\end{everbatim*}
-\subsection{\csbh{xintFtoCx}}\label{xintFtoCx}
+\subsection{\csh{xintFtoCx}}\label{xintFtoCx}
\csa{xintFtoCx}|{sep}{f}|\etype{n\Ff} returns the list of the
coefficients of the simple continued fraction of |f| separated with the
@@ -14390,7 +14704,7 @@ then the whole thing as argument to \csbxint{GGCFrac}:
\[\xintGGCFrac {\xintFtoCx {+1/\highlight}{208341/66317}}\]
\end{everbatim*}
-\subsection{\csbh{xintFtoGC}}\label{xintFtoGC}
+\subsection{\csh{xintFtoGC}}\label{xintFtoGC}
\csa{xintFtoGC}|{f}|\etype{\Ff} does the same as \csa{xintFtoCx}|{+1/}{f}|. Its
output may thus be used in the package macros expecting such an `inline
@@ -14404,7 +14718,7 @@ format'.
566827/208524=\xintFtoGC {566827/208524}
\end{everbatim*}
-\subsection{\csbh{xintFGtoC}}\label{xintFGtoC}
+\subsection{\csh{xintFGtoC}}\label{xintFGtoC}
\csa{xintFGtoC}|{f}{g}|\etype{\Ff\Ff} computes the common initial coefficients
to
@@ -14433,7 +14747,7 @@ braced numbers. This list can then be manipulated via macros from
\fdef\test{\xintFGtoC{1.41421356237309}{1.4142135623731}}\meaning\test
\end{everbatim*}
-\subsection{\csbh{xintFtoCC}}\label{xintFtoCC}
+\subsection{\csh{xintFtoCC}}\label{xintFtoCC}
\csa{xintFtoCC}|{f}|\etype{\Ff} returns the `centered' continued fraction of
|f|, in `inline format'. %
@@ -14444,7 +14758,7 @@ braced numbers. This list can then be manipulated via macros from
\[\xintFrac{566827/208524} = \xintGCFrac{\xintFtoCC{566827/208524}}\]
\end{everbatim*}
-\subsection{\csbh{xintCstoF}}\label{xintCstoF}
+\subsection{\csh{xintCstoF}}\label{xintCstoF}
\csa{xintCstoF}|{a,b,c,d,...,z}|\etype{f} computes the fraction corresponding to
the coefficients, which may be fractions or even macros expanding to such
@@ -14469,7 +14783,7 @@ A generalized continued fraction may produce a reducible fraction
factors but will not do simplifications which would be obvious to a human, like
simplification by 3 in the result above).
-\subsection{\csbh{xintCtoF}}\label{xintCtoF}
+\subsection{\csh{xintCtoF}}\label{xintCtoF}
\csa{xintCtoF}|{{a}{b}{c}...{z}}|\etype{f} computes the fraction corresponding
to the coefficients, which may be fractions or even macros.
@@ -14484,7 +14798,7 @@ done by |\xintApply|, but if we try with |\xintApply { \xintiiPow 3}| where the
space will stop this expansion, we can check that |\xintCtoF| will itself
provoke the needed coefficient expansion.% ok
-\subsection{\csbh{xintGCtoF}}\label{xintGCtoF}
+\subsection{\csh{xintGCtoF}}\label{xintGCtoF}
\csa{xintGCtoF}|{a+b/c+d/e+f/g+......+v/w+x/y}|\etype{f} computes the fraction
defined by the inline generalized continued fraction. Coefficients may be
@@ -14506,7 +14820,7 @@ The macro tries its best not to accumulate superfluous factor in the
denominators, but doesn't reduce the fraction to irreducible form before
returning it and does not do simplifications which would be obvious to a human.
-\subsection{\csbh{xintCstoCv}}\label{xintCstoCv}
+\subsection{\csh{xintCstoCv}}\label{xintCstoCv}
\csa{xintCstoCv}|{a,b,c,d,...,z}|\etype{f} returns the sequence of the
corresponding convergents, each one within braces.
@@ -14528,7 +14842,7 @@ fractions, but otherwise it is not necessarily the case.
{-.3}{-5},7.3/4.57,\xintCstoF{3/4,9,-1/3}}}}\]
\end{everbatim*}
-\subsection{\csbh{xintCtoCv}}\label{xintCtoCv}
+\subsection{\csh{xintCtoCv}}\label{xintCtoCv}
\csa{xintCtoCv}|{{a}{b}{c}...{z}}|\etype{f} returns the sequence of the
corresponding convergents, each one within braces.
@@ -14536,7 +14850,7 @@ corresponding convergents, each one within braces.
\fdef\test{\xintCtoCv {11111111111}}\texttt{\meaning\test}
\end{everbatim*}
-\subsection{\csbh{xintGCtoCv}}\label{xintGCtoCv}
+\subsection{\csh{xintGCtoCv}}\label{xintGCtoCv}
\csa{xintGCtoCv}|{a+b/c+d/e+f/g+......+v/w+x/y}|\etype{f} returns the list of
the corresponding convergents. The coefficients may be fractions, but must then
@@ -14553,7 +14867,7 @@ with |\xintApply\xintIrr|.
\end{everbatim*}
-\subsection{\csbh{xintFtoCv}}\label{xintFtoCv}
+\subsection{\csh{xintFtoCv}}\label{xintFtoCv}
\csa{xintFtoCv}|{f}|\etype{\Ff} returns the list of the (braced) convergents of
|f|, with no separator. To be treated with \csbxint{AssignArray} or
@@ -14562,7 +14876,7 @@ with |\xintApply\xintIrr|.
\[\xintListWithSep{\to}{\xintApply\xintFrac{\xintFtoCv{5211/3748}}}\]
\end{everbatim*}
-\subsection{\csbh{xintFtoCCv}}\label{xintFtoCCv}
+\subsection{\csh{xintFtoCCv}}\label{xintFtoCCv}
\csa{xintFtoCCv}|{f}|\etype{\Ff} returns the list of the (braced) centered
convergents of |f|, with no separator. To be treated with \csbxint{AssignArray}
@@ -14571,7 +14885,7 @@ or \csbxint{ListWithSep}.
\[\xintListWithSep{\to}{\xintApply\xintFrac{\xintFtoCCv{5211/3748}}}\]
\end{everbatim*}
-\subsection{\csbh{xintCntoF}}\label{xintCntoF}
+\subsection{\csh{xintCntoF}}\label{xintCntoF}
\csa{xintCntoF}|{N}{\macro}|\etype{\numx f} computes the fraction |f| having
@@ -14591,7 +14905,7 @@ these trailing square brackets, for example if the coefficients are known to be
\csbxint{PRaw}, or \csbxint{Irr} (the latter is overkill in the case of integer
coefficients, as the fraction is guaranteed to be irreducible then).
-\subsection{\csbh{xintGCntoF}}\label{xintGCntoF}
+\subsection{\csh{xintGCntoF}}\label{xintGCntoF}
\csa{xintGCntoF}|{N}{\macroA}{\macroB}|\etype{\numx ff} returns the fraction |f|
corresponding to the inline generalized continued fraction
@@ -14606,7 +14920,7 @@ The |N| parameter is given to a |\numexpr|.
There is also \csbxint{GCntoGC} to get the `inline format' continued
fraction.
-\subsection{\csbh{xintCntoCs}}\label{xintCntoCs}
+\subsection{\csh{xintCntoCs}}\label{xintCntoCs}
\csa{xintCntoCs}|{N}{\macro}|\etype{\numx f} produces the comma separated list
of the corresponding coefficients, from |n=0| to |n=N|. The |N| is given to a
@@ -14618,7 +14932,7 @@ of the corresponding coefficients, from |n=0| to |n=N|. The |N| is given to a
\[ \xintFrac{\xintCntoF{5}{\macro}}=\xintCFrac{\xintCntoF {5}{\macro}}\]
\end{everbatim*}
-\subsection{\csbh{xintCntoGC}}\label{xintCntoGC}
+\subsection{\csh{xintCntoGC}}\label{xintCntoGC}
%
\csa{xintCntoGC}|{N}{\macro}|\etype{\numx f} evaluates the |c(j)=\macro{j}| from
@@ -14632,7 +14946,7 @@ pair of braces, they may thus be fractions.
\[\xintGCFrac{\xintCntoGC {5}{\macro}}\]
\end{everbatim*}
-\subsection{\csbh{xintGCntoGC}}\label{xintGCntoGC}
+\subsection{\csh{xintGCntoGC}}\label{xintGCntoGC}
\csa{xintGCntoGC}|{N}{\macroA}{\macroB}|\etype{\numx ff} evaluates the
coefficients and then returns the corresponding
@@ -14648,7 +14962,7 @@ $\xintGCntoGC {5}{\an}{\bn}=\xintGCFrac {\xintGCntoGC {5}{\an}{\bn}} =
\displaystyle\xintFrac {\xintGCntoF {5}{\an}{\bn}}$\par
\end{everbatim*}
-\subsection{\csbh{xintCstoGC}}\label{xintCstoGC}
+\subsection{\csh{xintCstoGC}}\label{xintCstoGC}
\csa{xintCstoGC}|{a,b,..,z}|\etype{f} transforms a comma separated list (or
something expanding to such a list) into an `inline format' continued fraction
@@ -14657,7 +14971,7 @@ without expansion. The output can then be used in \csbxint{GCFrac} for example.
\begin{everbatim*}
\[\xintGCFrac {\xintCstoGC {-1,1/2,-1/3,1/4,-1/5}}=\xintSignedFrac{\xintCstoF {-1,1/2,-1/3,1/4,-1/5}}\]
\end{everbatim*}
-\subsection{\csbh{xintiCstoF}, \csbh{xintiGCtoF}, \csbh{xintiCstoCv}, \csbh{xintiGCtoCv}}\label{xintiCstoF}
+\subsection{\csh{xintiCstoF}, \csh{xintiGCtoF}, \csh{xintiCstoCv}, \csh{xintiGCtoCv}}\label{xintiCstoF}
\label{xintiGCtoF}
\label{xintiCstoCv}
\label{xintiGCtoCv}
@@ -14666,7 +14980,7 @@ Essentially\etype{f} the same as the corresponding macros without the
`i', but for integer-only input. Infinitesimally faster, mainly for
internal use by the package.
-\subsection{\csbh{xintGCtoGC}}\label{xintGCtoGC}
+\subsection{\csh{xintGCtoGC}}\label{xintGCtoGC}
\csa{xintGCtoGC}|{a+b/c+d/e+f/g+......+v/w+x/y}|\etype{f} expands (with the
usual meaning) each one of the coefficients and returns an inline continued
@@ -14748,9 +15062,11 @@ also more computations as the numerators may be either
$1$ or $-1$.
\clearpage
+\let\xintcfracnameUp\undefined
+\csname xinttoolsnameUp\endcsname
\section{Macros of the \xinttoolsname package}
-\label{sec:tools}
+\RaisedLabel{sec:tools}
\localtableofcontents
@@ -14770,7 +15086,7 @@ first, then the non expandable utilities.
A brief overview is in \autoref{sec:sometoolsutils} and \autoref{sec:examples}
has more examples of use of macros of this package.
-\subsection{\csbh{xintRevWithBraces}}\label{xintRevWithBraces}
+\subsection{\csh{xintRevWithBraces}}\label{xintRevWithBraces}
%{\small New in release |1.06|.\par}
@@ -14810,7 +15126,7 @@ The macro \csa{xintReverseWithBracesNoExpand}\etype{n} does the same job
without the initial expansion of its argument.
-\subsection{\csbh{xintZapFirstSpaces}, \csbh{xintZapLastSpaces}, \csbh{xintZapSpaces}, \csbh{xintZapSpacesB}}
+\subsection{\csh{xintZapFirstSpaces}, \csh{xintZapLastSpaces}, \csh{xintZapSpaces}, \csh{xintZapSpacesB}}
\label{xintZapFirstSpaces}
\label{xintZapLastSpaces}
\label{xintZapSpaces}
@@ -14856,7 +15172,6 @@ its argument, nor brace removal of any sort, nor does it alter \meta{stuff} in
anyway apart from stripping away all \emph{ending} spaces. The same remarks as
for \csbxint{ZapFirstSpaces} apply.
-% ATTENTION à l'\ignorespaces fait par \color!
\begingroup
\def\x { \a { \X } { \b \Y } }
%
@@ -14906,7 +15221,7 @@ all leading and all ending spaces and possibly removing one level of braces if
material, and are not removed (one would need a second application for that;
recall though that the \xintname zapping macros do not expand their argument).
-\subsection{\csbh{xintCSVtoList}}
+\subsection{\csh{xintCSVtoList}}
\label{xintCSVtoList}
\label{xintCSVtoListNoExpand}
@@ -15053,7 +15368,7 @@ without removal of spaces around the commas, there is
\endgroup
-\subsection{\csbh{xintNthElt}}\label{xintNthElt}
+\subsection{\csh{xintNthElt}}\label{xintNthElt}
\def\macro #1{\the\numexpr 9-#1\relax}
@@ -15114,7 +15429,7 @@ first expanding the list argument: |\xintNthEltNoExpand {-4}{\u\v\w T\x\y\z}| is
If |x| is strictly larger (in absolute value) than the length of the list
then |\xintNthElt| produces empty contents.
-\subsection{\csbh{xintKeep}}\label{xintKeep}
+\subsection{\csh{xintKeep}}\label{xintKeep}
\csa{xintKeep\x}\marg{list}\etype{\numx f} expands the token list argument |L|
and produces a new list, depending on the value of |x|:
@@ -15146,7 +15461,7 @@ argument.
\end{everbatim*}
-\subsection{\csbh{xintKeepUnbraced}}\label{xintKeepUnbraced}
+\subsection{\csh{xintKeepUnbraced}}\label{xintKeepUnbraced}
Same as \csbxint{Keep} but no brace pairs are added around the kept items from
the head of the list in the case |x>0|: each such item will lose one level of
@@ -15170,7 +15485,7 @@ its list argument.
\noindent\fdef\test {\xintKeepUnbraced {-7}{123456789}}\meaning\test\par
\end{everbatim*}
-\subsection{\csbh{xintTrim}}\label{xintTrim}
+\subsection{\csh{xintTrim}}\label{xintTrim}
\csa{xintTrim\x}\marg{list}\etype{\numx f} expands the list argument and
gobbles its first |x| elements.
@@ -15195,7 +15510,7 @@ argument.
\noindent\fdef\test {\xintTrim {-7}{123456789}}\meaning\test\par
\end{everbatim*}
-\subsection{\csbh{xintTrimUnbraced}}\label{xintTrimUnbraced}
+\subsection{\csh{xintTrimUnbraced}}\label{xintTrimUnbraced}
Same as \csbxint{Trim} but in case of a negative |x| (cutting items from
the tail), the kept items from the head are not enclosed in brace pairs. They
@@ -15214,7 +15529,7 @@ argument.
\noindent\fdef\test {\xintTrimUnbraced {-7}{123456789}}\meaning\test\par
\end{everbatim*}
-\subsection{\csbh{xintListWithSep}}\label{xintListWithSep}
+\subsection{\csh{xintListWithSep}}\label{xintListWithSep}
\def\macro #1{\the\numexpr 9-#1\relax}
@@ -15242,7 +15557,7 @@ job without the initial expansion of the \meta{list} argument.
\oodef\foo{\xintListWithSep{\FOO}{ \bat\baz\biz\buz}}\meaning\foo\par
\end{everbatim*}
-\subsection{\csbh{xintApply}}\label{xintApply}
+\subsection{\csh{xintApply}}\label{xintApply}
\def\macro #1{\the\numexpr 9-#1\relax}
@@ -15281,7 +15596,7 @@ The macro \csa{xintApplyNoExpand}\etype{fn} does the same job without the first
initial expansion which gave the \meta{list} of braced tokens to which |\macro|
is applied.
-\subsection{\csbh{xintApplyUnbraced}}\label{xintApplyUnbraced}
+\subsection{\csh{xintApplyUnbraced}}\label{xintApplyUnbraced}
\csa{xintApplyUnbraced}|{\macro}|\marg{list}\etype{ff} is like \csbxint{Apply}.
@@ -15308,7 +15623,7 @@ The macro \csa{xintApplyUnbracedNoExpand}\etype{fn} does the same job without
the first initial expansion which gave the \meta{list} of braced tokens to which
|\macro| is applied.
-\subsection{\csbh{xintSeq}}\label{xintSeq}
+\subsection{\csh{xintSeq}}\label{xintSeq}
\csa{xintSeq}|[d]{x}{y}|\etype{{{\upshape[\numx]}}\numx\numx} generates
expandably |{x}{x+d}...| up to and possibly including |{y}| if |d>0| or down
@@ -15341,7 +15656,7 @@ efficiently) and does not stress the input save stack.
-\subsection{\csbh{xintloop}, \csbh{xintbreakloop}, \csbh{xintbreakloopanddo}, \csbh{xintloopskiptonext}}
+\subsection{\csh{xintloop}, \csh{xintbreakloop}, \csh{xintbreakloopanddo}, \csh{xintloopskiptonext}}
\label{xintloop}
\label{xintbreakloop}
\label{xintbreakloopanddo}
@@ -15497,9 +15812,9 @@ illustrate use of the nesting capabilities of |\xintloop|.%
\end{everbatim*}
-\subsection{\csbh{xintiloop}, \csbh{xintiloopindex}, \csbh{xintouteriloopindex},
- \csbh{xintbreakiloop}, \csbh{xintbreakiloopanddo}, \csbh{xintiloopskiptonext},
-\csbh{xintiloopskipandredo}}
+\subsection{\csh{xintiloop}, \csh{xintiloopindex}, \csh{xintouteriloopindex},
+ \csh{xintbreakiloop}, \csh{xintbreakiloopanddo}, \csh{xintiloopskiptonext},
+\csh{xintiloopskipandredo}}
\label{xintiloop}
\label{xintbreakiloop}
\label{xintbreakiloopanddo}
@@ -15653,7 +15968,7 @@ and |\xintouteriloopindex| not to be confronted with a hard to digest
The next utilities are not compatible with expansion-only context.
\end{framed}
-\subsection{\csbh{xintApplyInline}}\label{xintApplyInline}
+\subsection{\csh{xintApplyInline}}\label{xintApplyInline}
\csa{xintApplyInline}|{\macro}|\marg{list}\ntype{o{\lowast f}} works non
@@ -15742,7 +16057,7 @@ this does not work:\par
|
\noindent But see \csbxint{For}.
-\subsection{\csbh{xintFor}, \csbh{xintFor*}}\label{xintFor}\label{xintFor*}
+\subsection{\csh{xintFor}, \csh{xintFor*}}\label{xintFor}\label{xintFor*}
\csbxint{For}\ntype{on} is a new kind of for loop.\footnote{first introduced
with \xintname |1.09c| of |2013/10/09|.} Rather than using macros
@@ -15913,7 +16228,7 @@ The iterated macros as well as the list items are allowed to contain explicit
|\par| tokens.
-\subsection{\csbh{xintifForFirst}, \csbh{xintifForLast}}
+\subsection{\csh{xintifForFirst}, \csh{xintifForLast}}
\label{xintifForFirst}\label{xintifForLast}
\csbxint{ifForFirst}\,\texttt{\{YES branch\}\{NO branch\}}\etype{nn}
@@ -15953,7 +16268,7 @@ times in the replacement text of the loop.
\end{itemize}
\end{framed}
-\subsection{ \csbh{xintBreakFor}, \csbh{xintBreakForAndDo}}
+\subsection{ \csh{xintBreakFor}, \csh{xintBreakForAndDo}}
\label{xintBreakFor}\label{xintBreakForAndDo}
One may immediately terminate an \csbxint{For} or \csbxint{For*} loop with
@@ -15971,7 +16286,7 @@ One may immediately terminate an \csbxint{For} or \csbxint{For*} loop with
There is also \csbxint{BreakForAndDo}. Both are illustrated by various examples
in the next section which is devoted to ``forever'' loops.
-\subsection{\csbh{xintintegers}, \csbh{xintdimensions}, \csbh{xintrationals}}
+\subsection{\csh{xintintegers}, \csh{xintdimensions}, \csh{xintrationals}}
\label{xintegers}\label{xintintegers}
\label{xintdimensions}\label{xintrationals}
@@ -16076,7 +16391,7 @@ printing of fixed points numbers should be dealt with via dedicated packages
such as |numprint| or |siunitx|.\par
-\subsection{\csbh{xintForpair}, \csbh{xintForthree}, \csbh{xintForfour}}\label{xintForpair}\label{xintForthree}\label{xintForfour}
+\subsection{\csh{xintForpair}, \csh{xintForthree}, \csh{xintForfour}}\label{xintForpair}\label{xintForthree}\label{xintForfour}
The syntax\ntype{on} is illustrated in this
example. The notation is the usual one for |n|-uples, with parentheses and
@@ -16108,7 +16423,7 @@ about using distinct macro parameters.
replacement text.
-\subsection{\csbh{xintAssign}}\label{xintAssign}
+\subsection{\csh{xintAssign}}\label{xintAssign}
\csa{xintAssign}\meta{braced things}\csa{to}%
\meta{as many cs as they are things} %\ntype{{(f$\to$\lowast [x)}{\lowast N}}
@@ -16181,7 +16496,7 @@ sion.
As usual successive space characters in input make for a single \TeX\ space token.
-\subsection{\csbh{xintAssignArray}}\label{xintAssignArray}
+\subsection{\csh{xintAssignArray}}\label{xintAssignArray}
\xintAssignArray \xintBezout {1000}{113}\to\Bez
@@ -16213,7 +16528,7 @@ For this, one should rather do |\xintAssignArray| within a group starting with
|\globaldefs 1|.
-\subsection{\csbh{xintDigitsOf}}\label{xintDigitsOf}
+\subsection{\csh{xintDigitsOf}}\label{xintDigitsOf}
This is a synonym for \csbxint{AssignArray},\ntype{fN} to be used to define
an array giving all the digits of a given (positive, else the minus sign will
@@ -16226,13 +16541,15 @@ be treated as first item) number.
|\digits{123}=|\digits{123}.
\endgroup
-\subsection{\csbh{xintRelaxArray}}\label{xintRelaxArray}
+\subsection{\csh{xintRelaxArray}}\label{xintRelaxArray}
\csa{xintRelaxArray}\csa{myArray} %\ntype{N}
%
(globally) sets to \csa{relax} all macros which were defined by the previous
\csa{xintAssignArray} with \csa{myArray} as array macro.
+\clearpage
+\let\xinttoolsnameUp\undefined
\ifnum\NoSourceCode=1
\bigskip
@@ -16242,13 +16559,19 @@ be treated as first item) number.
%
\centeredline{|sourcexint.pdf|,}
%
- which will open in a PDF viewer via |texdoc sourcexint.pdf|. To
- produce a single file including both the user documentation and the
- source code, run |tex xint.dtx| to generate |xint.tex| (if not already
- available), then edit |xint.tex| to set the |\NoSourceCode| toggle to |0|,
- then run thrice |latex| on |xint.tex| and finally |dvipdfmx| on |xint.dvi|.
- Alternatively, run |pdflatex| either directly on |xint.dtx|, or on
- |xint.tex| with |\NoSourceCode| set to |0|.
+ which will open in a PDF viewer via |texdoc sourcexint.pdf|.
+
+ To produce a single file including both the user documentation and the
+ source code:
+ \begin{itemize}
+ \item run |etex| on |xint.dtx| to generate |xint.tex| among other files,
+ \item edit |xint.tex| to set the |\NoSourceCode| toggle within it to |0|,
+ \item run |make clean| and then |make xint.pdf|.
+ \end{itemize}
+ This will need |latexmk|; if not available you will need in replacement of
+ the last step to execute manually |latex| on |xint.tex| (twice) then
+ |makeindex -s xint-gind.ist| on all |.idx| files, then again |latex| twice
+ and finally |dvipdfmx|.
\end{framed}
\fi
@@ -16263,60 +16586,259 @@ be treated as first item) number.
\makeatletter
\@gobble\fi
\StopEventually{\end{document}\endinput}
-
\ifnum\dosourcexint=1
\renewcommand{\etocaftertochook}{\addvspace{\bigskipamount}}
\etocsettocstyle {}{}
+\clearpage
+% \newgeometry{%hmarginratio=4:3,
+% hscale=0.7,vscale=0.75}% ATTENTION \newgeometry fait
+% % un reset de vscale si on ne le
+% % précise pas ici !!!
\else
\clearpage
\fi
+\makeatletter
+
\def\MARGEPAGENO{1.25em}
\etocsettocdepth{subsubsection}% 2015/09/15
\etocdepthtag.toc {implementation}
\addtocontents{toc}{\gdef\string\sectioncouleur{[named]{RoyalPurple}}}
-\makeatletter
\def\storedlinecounts {}
\def\StoreCodelineNo #1{\edef\storedlinecounts{%
\unexpanded\expandafter{\storedlinecounts}%
{{#1}{\the\c@CodelineNo}}}\c@CodelineNo\z@ }
+% Customizing doc.sty's indexing
+% ==============================
+
+% cf xintkernel.sty's \XINT_setcatcodes : this is default across xint
+% codebase
+\def\xintMakePrivateLetters{%
+ \catcode`_ 11 \catcode`: 11 \catcode`^ 11
+ \catcode`@ 11 \catcode`? 11 }
+% additionally, the ! is generally of catcode letter in xintexpr.sty
+\odef\xintexprMakePrivateLetters{\xintMakePrivateLetters \catcode`! 11 }
+
+\let\MakePrivateLetters\xintMakePrivateLetters
-\def\macro@font {\ttbfamily }
+\edef\quotechar{\string&}
+\def\index@prologue{}
-\def\MicroFont {\ttzfamily\color[named]{Purple}\makestarlowast }
+\def\PrintPackageIndex#1{\@input@{\jobname#1.ind}}
+\def\PrintMainIndex{\@input@{\jobname.ind}}
+
+\immediate\openout\@indexfile=\jobname.idx
+\typeout{Writing index file \jobname.idx}
+
+% because it got redefined by hyperref
+{\catcode`| 12
+\gdef\@wrindex #1%
+ {%
+ \protected@write\package@indexfile{}{\string\indexentry{#1|hyperpage}{\thepage}}%
+ \protected@write\@indexfile{}{\string\indexentry{#1|hyperpage}{\thepage}}%
+ \endgroup
+ \@esphack
+ }%
+}
+
+% \macrocode
+% ==========
+% 2014/11/04 did some hack with active characters à la upquote for
+% straight quotes, but this is now irrelevant as we use suitable font
+% from newtxtt with straight quotes.
+
+%
+% Actually, I should not at all rely on the doc class, I should do it all by
+% myself. As I don't use at all \DocInput (which caused me loads of problems
+% back then when I was trying to get a workflow satisfying my views on how
+% .dtx files should be structured), there is not much rationale for using the
+% doc class.
+
+\def\macrocode{\macro@code
+ \frenchspacing \@vobeyspaces
+ \makestarlowast
+ \xmacro@code }
+
+\def\macro@font {\ttbfamily }% slashed 0
+
+% \lverb
+% ======
+
+% Définition de \lverb
+% Has become more complicated for 1.2l
+\catcode`_ 11
+{\catcode32\active%
+\gdef\myobeyspaces{\catcode32\active\def {\leavevmode\kern\fontcharwd\font`X}}}
+\def\lverbpercent {\catcode32\active\lverbpercent_a}%
+\def\lverbpercent_a #1{%
+ \if\XINT_sptoken\detokenize{#1}\xint_dothis{\catcode32 10 }\fi
+ \if-\detokenize{#1}\xint_dothis{\par #1}\fi
+ \if(\detokenize{#1}\xint_dothis{\par\bgroup\myobeyspaces\obeylines}\fi
+ \if:\detokenize{#1}\xint_dothis{}\fi
+ \if)\detokenize{#1}\xint_dothis{\egroup\everypar{\hskip-\parindent\everypar{}}}\fi
+ \if!\detokenize{#1}\xint_dothis{\lverbpercent}\fi
+ \ifx#1\lverbpercent\xint_dothis{\catcode32 10 \par #1}\fi
+ \xint_orthat{\catcode32 10 #1}%
+}
+\catcode`_ 8
+\long\def\lverb {%
+ \relax\par\smallskip%\noindent\null
+ \begingroup
+ \bgroup
+ \aftergroup\@@par \aftergroup\endgroup \aftergroup\medskip
+ \let\do\do@noligs \verbatim@nolig@list
+ \let\do\@makeother \dospecials
+ \catcode32 10 \catcode`\& 14 \catcode`\$ 0
+ \catcode`\% \active
+ \begingroup\lccode`\~`\%\lowercase{\endgroup\let~\lverbpercent}%
+ \MicroFont % sera donc en couleur.
+ \@lverb
+}
+
+\def\@lverb #1{\catcode`#1\active
+ \lccode`\~`#1\lowercase{\let~\egroup}}%
+
+\def\MicroFont {%\ttzfamily
+ \color[named]{Purple}\makestarlowast }
+
+% privatecodecomments
+% ===================
+\newenvironment{privatecodecomments}
+ {\par \textbf{\textcolor{red}{COMMENTAIRES PRIVÉS.}}\par
+ \begingroup\lccode`\~`\%\lowercase{\endgroup\let~\lverbpercent}%
+ \catcode`\%\active}
+ {\par \textbf{\textcolor{red}{FIN DES COMMENTAIRES PRIVÉS.}}\par}
+
+% \changed
+% ========
+
+\def\changed#1#2{%
+ \par\smallskip\noindent
+ \textbf{#1\if\relax\detokenize{#2}\relax\else\space(#2)\fi.}%
+% \hangindent\leftmarginii
+ \hangindent\parindent
+}
+
+% Hyperlinks
+% ==========
+
+% renew some definitions (new labels, prefixed with src-)
+
+% hyperlink and slash
+\DeclareRobustCommand\csbxint[1]
+ {\hyperref[\detokenize{src-xint#1}]%
+ {{\char92\mbox{xint}\-\endlinechar-1
+ \makestarlowast \catcode`_ 12 \catcode`^ 12
+ \scantokens\expandafter{\detokenize{#1}}}}}
+
+\DeclareRobustCommand\csbXINT[1]
+ {\hyperref[\detokenize{src-XINT#1}]%
+ {{\char92\mbox{XINT}\-\endlinechar-1
+ \makestarlowast \catcode`_ 12 \catcode`^ 12
+ \scantokens\expandafter{\detokenize{#1}}}}}
+
+\DeclareRobustCommand\csb [1]
+ {\hyperref[\detokenize{src-#1}]%
+ {{\char92 \endlinechar-1
+ \makestarlowast \catcode`_ 12 \catcode`^ 12
+ \scantokens\expandafter{\detokenize{#1}}}}}
+
+% hyperlink and no slash
+\DeclareRobustCommand\csbn[1]
+ {\hyperref[\detokenize{src-#1}]%
+ {{\endlinechar-1
+ \makestarlowast \catcode`_ 12 \catcode`^ 12
+ \scantokens\expandafter{\detokenize{#1}}}}}
+
+% HACK OF \@sect
+% ==============
+% goal is to add labels but without having to modify currently
+% existing mark-up in sources. But KOMA annoyingly makes an extra
+% step needed. 2018/06/11
+\let\original@sect\@sect
+\def\@sect#1#2#3#4#5#6[#7]#8{\original@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]%
+ {\begingroup
+ %not possible because of KOMA wrappers
+ %\def\csh##1{\csa{##1}\label{\detokenize{src-##1}}}%
+ \let\csh\cshintitle
+ \let\cshn\cshnintitle
+ #8%
+ \endgroup}%
+}%
+\def\cshintitle#1{\csa{#1}%
+ \label{\detokenize{src-#1}}%
+ %\expandafter\DescribeMacro\csname#1\endcsname
+ }
+% \csan: no backslash
+\def\cshnintitle#1{\csan{#1}\label{\detokenize{src-#1}}}
+
+%% END OF MACRO DEFINITIONS FOR SOURCEXINT
+
+\def\xintImpRunningHeader{{\catcode`,12\relax
+ \DOCxintfrontpage,
+ \xintkernelnameimp,
+ \xinttoolsnameimp,
+ \xintcorenameimp,
+ \xintnameimp,
+ \xintbinhexnameimp,
+ \xintgcdnameimp,
+ \xintfracnameimp,
+ \xintseriesnameimp,
+ \xintcfracnameimp, \xintexprnameimp, \DOCxintindices}}
+\markboth{\xintImpRunningHeader}{\xintImpRunningHeader}
\makeatother
+\section{Introduction to the implementation (recent changes)}
-\bigskip
This is \expandafter|\xintbndlversion| of \expandafter|\xintbndldate|.
\begin{itemize}
+\item Release |1.3c| of |2018/06/17|:
+ \begin{itemize}[nosep]
+ \item \csbxint{globaldefstrue} to give global scope to definitions done by
+ \csbxint{defvar}, \csbxint{deffunc}, \csbxint{NewExpr}, et.\@ al.
+ \item \csbn{qraw()} to allow bypassing the normal mode of functioning
+ and reduce memory footprint from parsing (very many) comma separated
+ numerical items.
+ \item the colon in the |:=| part of the syntax for
+ \csbxint{defvar} and variants is now optional; and if present it may be
+ an active character or have any (reasonable) catcode.
+ \item \csbxint{defvar}, \csbxint{deffunc} and their variants try to set the
+ catcode of the semi-colon which delimits their arguments; of course this
+ will not work if that catcode is already frozen.
+ \item \csbxint{exprSafeCatcodes} sets a toggle to allow some nested usage.
+ \item \csbxint{UniformDeviate} is better documented and |sourcexint.pdf| is
+ better hyperlinked and includes indices for the macros defined by each
+ package.
+ \item since |1.3| release, \xintfracnameimp (hence \xintexprnameimp) loaded
+ \xintgcdnameimp in contradiction to what documentation says. Removed for now.
+ \end{itemize}
\item Release |1.3b| of |2018/05/18|:
\begin{itemize}[nosep]
- \item |\xintUniformDeviate|,
- \item |random()|, |qrand()|, |randrange()|,
- \item and their support macros |\XINTinRandomFloatSdigits|,
- |\XINTinRandomFloatSixteen|, |\xintRandomDigits|, |\xintiiRandRange|,
- |\xintiiRandRangeAtoB|,
- \item also |\xintXRandomDigits|,
- \item functions defined via |\xintdeffunc| (et al.) to be without argument can be
- used as |foo()|: |foo(nil)| syntax not anymore required.
+ \item \csbxint{UniformDeviate}, \csbn{random()}, \csbn{qrand()},
+ \csbn{randrange()},
+ \item and their support macros \csbXINT{inRandomFloatSdigits},
+ \csbXINT{inRandomFloatSixteen}, \csbxint{RandomDigits},
+ \csbxint{iiRandRange}, \csbxint{iiRandRangeAtoB}, also
+ \csbxint{XRandomDigits},
+ \item functions defined via \csbxint{deffunc} (et al.) to be without
+ argument can be used as |foo()|: |foo(nil)| syntax not anymore required.
\end{itemize}
\item Release |1.3a| of |2018/03/07|:
\begin{itemize}[nosep]
\item removes from \xintcorenameimp, \xintnameimp and \xintfracnameimp the
whole deprecation mechanism, as there are no more currently any
deprecated macro,
- \item adds |ifone()| and |ifint()| conditionals to the expression parsers,
- \item has a completely redone |\XINT_factortens|, in the style of |1.2|
+ \item adds \csbn{ifone()} and \csbn{ifint()} conditionals to the expression parsers,
+ \item has a completely redone \csbXINT{_factortens}, in the style of |1.2|
release (but about 100 digits at least are needed for noticeable speed
gain),
- \item and last but not least fixes via addition of |\xintExpandArgs| the
+ \item and last but not least fixes via addition of \csbxint{ExpandArgs} the
meaning of user defined functions, which in case of recursivity (as made
possible at |1.3|) were badly inefficient for lack of expansion of their
arguments.
@@ -16326,9 +16848,9 @@ This is \expandafter|\xintbndlversion| of \expandafter|\xintbndldate|.
\item removed all macros previously deprecated at |1.2o|,
\item modified addition, subtraction and modulo operations to use a least
common multiple for the denominator of the result,
- \item added |\xintPIrr|, |\xintDecToString| and |preduce()|,
+ \item added \csbxint{PIrr}, \csbxint{DecToString} and \csbn{preduce()},
\item and last but not least refactored extensively the
- |\xintNewExpr/\xintdeffunc| mechanism. It got both leaner and stronger
+ \csbxint{NewExpr}/\csbxint{deffunc} mechanism. It got both leaner and stronger
and makes possible recursive function definitions.
\end{itemize}
@@ -16336,7 +16858,7 @@ This is \expandafter|\xintbndlversion| of \expandafter|\xintbndldate|.
\begin{itemize}[nosep]
\item fix to an |1.2l| \xintcorenameimp subtraction bug causing a breakage
under some rare circumstances |:-(|. It was caused by a refactoring
- left-over (extra |!| in |\XINT_sub_l_Ida| replacement text), and should
+ left-over (extra |!| in |XINT_sub_l_Ida| replacement text), and should
have been detected by the test suite, but manual testing from early days
was not yet entirely included in our automated procedure.
\item new feature: tacit multiplication in front of digits, for example
@@ -16346,7 +16868,7 @@ This is \expandafter|\xintbndlversion| of \expandafter|\xintbndldate|.
\item Release |1.2p| of |2017/12/05|
had some breaking changes:
\begin{itemize}[nosep]
- \item new output for the |\xintBezout| macro (\xintgcdnameimp),
+ \item new output for the \csbxint{Bezout} macro (\xintgcdnameimp),
\item the \xintexprnameimp operators |/:| (aka |'mod'|) and |//|, and the
supporting macros from \xintcorenameimp and \xintfracnameimp, are now
associated with the \emph{floored} division. Formerly it was the
@@ -16355,22 +16877,22 @@ This is \expandafter|\xintbndlversion| of \expandafter|\xintbndldate|.
\end{itemize}
Improvements and new features:
\begin{itemize}[nosep]
- \item \xinttoolsnameimp macro |\xintListWithSep| is faster (first update
+ \item \xinttoolsnameimp macro \csbxint{ListWithSep} is faster (first update
since |1.04-2013/04/25|...).
- \item |divmod()| function added to the \xintexprnameimp parsers,
- \item |\xintdefvar|, |\xintdeffloatvar|, |\xintdefiivar| extended to allow
+ \item \csbn{divmod()} function added to the \xintexprnameimp parsers,
+ \item \csbxint{defvar}, \csbxint{deffloatvar}, \csbxint{defiivar} extended to allow
multiple simultaneous assignments.
\end{itemize}
-
+
\item Release |1.2o| of |2017/08/29| deprecated those macros from
\xintcorenameimp and \xintnameimp which filtered their arguments via
- |\xintNum|. Currently these macros execute as formerly but raise an error
+ \csbxint{Num}. Currently these macros execute as formerly but raise an error
message. This deprecation is overruled for most if \xintfracnameimp is
loaded as it provides their proper definitions. Some however (like
|\xintiAdd|) remain deprecated even if loading \xintfracnameimp. All these
deprecated macros are destined to be removed at some future release.
- A few macros got renamed (e.g. |\xintNot| became |\xintNOT|.) Former names
+ A few macros got renamed (e.g. |\xintNot| became \csbxint{NOT}.) Former names
emit a deprecation error and will get removed at some future release.
\item Release |1.2n| of |2017/08/06| removed the \xintbinhexnameimp
@@ -16385,35 +16907,35 @@ This is \expandafter|\xintbndlversion| of \expandafter|\xintbndldate|.
(slowly) tens of thousands of digits.)
\item Release |1.2l| of |2017/07/26| refactored the subtraction and also
- |\xintiiCmp| got a rewrite. It should certainly use |\pdfstrcmp| for
+ \csbxint{iiCmp} got a rewrite. It should certainly use |\pdfstrcmp| for
dramatic speed-up but I do not want to have to worry about multi-engine
usage.
Some utility routines in \xintcorenameimp manipulating blocks of eight
digits and still in |O(N^2)| style got rewritten analogously to the
- |1.2i| version of macros such as |\xintInc|. Also |\xintiNum| was
+ |1.2i| version of macros such as \csbxint{Inc}. Also \csbxint{iNum} was
revisited.
The arithmetic macros of \xintcorenameimp and all macros of
- \xintfracnameimp using |\XINT_infrac| were made compatible with arguments
+ \xintfracnameimp using \csbXINT{_infrac} were made compatible with arguments
using non-delimited |\the\numexpr| or |\the\mathcode| etc... But
- |\xintiiAbs| and |\xintiiOpp| were not modified (to avoid some overhead)
- as well as routines such as |\xintInc| which are primarily for internal
+ \csbxint{iiAbs} and \csbxint{iiOpp} were not modified (to avoid some overhead)
+ as well as routines such as \csbxint{Inc} which are primarily for internal
usage.
\item Release |1.2i| of |2016/12/13| rewrote some legacy macros like
- |\xintDSR| or |\xintDecSplit| in the style of the techniques of |1.2|. But
+ \csbxint{DSR} or \csbxint{DecSplit} in the style of the techniques of |1.2|. But
this means also that they got limited to about \dtt{22480} digits for
the former and \dtt{19970} digits for the latter (this is with the input
stack size at \dtt{5000} and the maximal expansion depth at \dtt{10000}.)
This is not really an issue from the point of view of calling macros (such
- as |\xintTrunc|, |\xintRound|), because they usually had since |1.2| their
+ as \csbxint{Trunc}, \csbxint{Round}), because they usually had since |1.2| their
own limitation at about \dtt{19950} digits from other code parts (such as
- division.) The macro |\xintXTrunc| (which is not f-expandable however) can
+ division.) The macro \csbxint{XTrunc} (which is not f-expandable however) can
produce tens of thousands of digits and it escapes these limitations. Old
- macros such as |\xintLength| are not limited either (incidentally it got a
- lifting in |1.2i|.) The macros from \xinttoolsnameimp (|\xintKeep|,
- |\xintTrim|, |\xintNthElt|) also are not limited (but slower.)
+ macros such as \csbxint{Length} are not limited either (incidentally it got a
+ lifting in |1.2i|.) The macros from \xinttoolsnameimp (\csbxint{Keep},
+ \csbxint{Trim}, \csbxint{NthElt}) also are not limited (but slower.)
\item Release |1.2| of |2015/10/10| entirely rewrote the core
arithmetic routines located in \xintcorenameimp. The parser of
@@ -16423,7 +16945,7 @@ This is \expandafter|\xintbndlversion| of \expandafter|\xintbndldate|.
\item Extensive changes in release |1.1| of |2014/10/28| were located in
\xintexprnameimp. Also with that release, packages \xintkernelnameimp and
\xintcorenameimp were extracted from \xinttoolsnameimp and \xintnameimp,
- and |\xintAdd| was modified to not multiply denominators blindly.
+ and \csbxint{Add} was modified to not multiply denominators blindly.
\end{itemize}
@@ -16433,7 +16955,7 @@ Some parts of the code still date back to the initial release, and
the code.
Warning: pay attention when looking at the code to the catcode configuration
-as found in |\XINT_setcatcodes|. Additional temporary configuration is used
+as found in \csbXINT{_setcatcodes}. Additional temporary configuration is used
at some locations. For example |!| is of catcode letter in \xintexprnameimp
and there are locations with funny catcodes e.g. using some letters with the
math shift catcode.
@@ -16448,9 +16970,12 @@ math shift catcode.
%\let<*xintkernel>\gardesinactifs
%</dtx>^^A--------------------------------------------------------
%<*xintkernel>^^A-------------------------------------------------
-% \clearpage
+%^^A -*- coding: utf-8; mode: doctex; fill-column: 78; -*-
+% \clearpage\csname xintkernelnameUp\endcsname
+% \StartPackageIndex{kernel}
+% \let\MakePrivateLetters\xintMakePrivateLetters
% \section {Package \xintkernelnameimp implementation}
-% \label{sec:kernelimp}
+% \RaisedLabel{sec:kernelimp}
%
% \localtableofcontents
%
@@ -16460,12 +16985,15 @@ math shift catcode.
% loaded by both |xintcore.sty| and |xinttools.sty| hence by all other
% packages.
%
-% First appeared as a separate package with release |1.1|.
+% \changed{1.1}{}
+% separated package.
%
-% |1.2i| adds \csa{xintreplicate}, \csa{xintgobble}, \csa{xintLengthUpTo}
-% and \csa{xintLastItem}, and improves the efficiency of \csa{xintLength}.
+% \changed{1.2i}{}
+% \csbxint{replicate}, \csbxint{gobble}, \csbxint{LengthUpTo}
+% and \csbxint{LastItem}, and faster \csbxint{Length}.
%
-% |1.3b| adds \csa{xintUniformDeviate}.
+% \changed{1.3b}{}
+% \csbxint{UniformDeviate}.
%
% \subsection{Catcodes, \protect\eTeX{} and reload detection}
%
@@ -16508,6 +17036,8 @@ math shift catcode.
\fi
\ifx\z\relax\else\expandafter\z\fi%
% \end{macrocode}
+% \subsubsection{\csh{XINT_setcatcodes}, \csh{XINT_storecatcodes},
+% \csh{XINT_restorecatcodes_endinput}}
% \begin{macrocode}
\def\PrepareCatcodes
{%
@@ -16623,7 +17153,7 @@ math shift catcode.
\fi
\XINT_providespackage
\ProvidesPackage {xintkernel}%
- [2018/05/18 1.3b Paraphernalia for the xint packages (JFB)]%
+ [2018/06/17 1.3c Paraphernalia for the xint packages (JFB)]%
% \end{macrocode}
% \subsection{Constants}
% \begin{macrocode}
@@ -16663,8 +17193,9 @@ math shift catcode.
\fi
% \end{macrocode}
% \subsection{Token management utilities}
-% \lverb|1.3b added the \xint_gobandstop_... macros because this is handy for
-% \xintRandomDigits.|
+% \changed{1.3b}{}
+% |\xint_gobandstop_...| macros because this is handy for
+% \csbxint{RandomDigits}.
% \begin{macrocode}
\def\XINT_tmpa { }%
\ifx\XINT_tmpa\space\else
@@ -16712,9 +17243,6 @@ math shift catcode.
\long\def\xint_secondoftwo_thenstop #1#2{ #2}%
\long\def\xint_exchangetwo_keepbraces #1#2{{#2}{#1}}%
% \end{macrocode}
-% \lverb|&
-% |
-%
% \subsection{``gob til'' macros and UD style fork}
% \begin{macrocode}
\long\def\xint_gob_til_R #1\R {}%
@@ -16747,17 +17275,29 @@ math shift catcode.
\long\def\xint_afterfi #1#2\fi {\fi #1}%
% \end{macrocode}
% \subsection{\csh{xint_bye}, \csh{xint_Bye}}
-% \lverb|\xint_Bye is new with 1.2i for \xintDSRr and \xintRound. Also
-% \xint_bye_thenstop.|
+% \changed{1.09}{}
+% |\xint_bye|
+% \changed{1.2i}{}
+% |\xint_Bye| for \csbxint{DSRr} and \csbxint{Round}. Also |\xint_bye_thenstop|.
% \begin{macrocode}
\long\def\xint_bye #1\xint_bye {}%
\long\def\xint_Bye #1\xint_bye {}%
\long\def\xint_bye_thenstop #1\xint_bye { }%
% \end{macrocode}
% \subsection{\csh{xintdothis}, \csh{xintorthat}}
-% \lverb|New with 1.1. Public names without underscores with 1.2. Used as
-% \if..\xint_dothis{..}\fi <multiple times> followed by \xint_orthat{...}. To
-% be used with less probable things first.|
+% \changed{1.1}{}
+% \changed{1.2}{} names without underscores.
+%
+% To be used this way:
+% \lverb|
+%( \if..\xint_dothis{..}\fi
+%: \if..\xint_dothis{..}\fi
+%: \if..\xint_dothis{..}\fi
+%: ...more such...
+%: \xint_orthat{...}
+%) |
+% Ancient testing indicated it is more efficient to list first the more
+% improbable clauses.
% \begin{macrocode}
\long\def\xint_dothis #1#2\xint_orthat #3{\fi #1}% 1.1
\let\xint_orthat \xint_firstofone
@@ -16765,38 +17305,41 @@ math shift catcode.
\let\xintorthat \xint_firstofone
% \end{macrocode}
% \subsection{\csh{xint_zapspaces}}
-% \lverb|1.1. This little utility zaps leading, intermediate, trailing,
-% spaces in completely expanding context (\edef, \csname . . . \endcsname).
-% $centeredline$bgroup\xint_zapspaces foo<space>\xint_gobble_i$egroup
+% \changed{1.1}{}
+%
+% This little utility zaps leading, intermediate, trailing, spaces in
+% completely expanding context (|\edef|, |\csname...\endcsname|).
+% \centeredline{Usage: |\xint_zapspaces foo<space>\xint_gobble_i|}
%
% Will remove some brace pairs (but not spaces inside them). By the way the
-% \zap@spaces of LaTeX2e handles unexpectedly things such as \zap@spaces 1
-% {22} 3 4 \@empty (spaces are not all removed). This does not happen with
-% \xint_zapspaces.
+% |\zap@spaces| of LaTeX2e handles unexpectedly things such as
+% \centeredline{|\zap@spaces 1 {22} 3 4 \@empty|} (spaces are not all
+% removed). This does not happen with |\xint_zapspaces|.
%
-% Explanation: if there are leading spaces, then the first #1 will be empty,
-% and the first #2 being undelimited will be stripped from all the remaining
+% Explanation: if there are leading spaces, then the first |#1| will be empty,
+% and the first |#2| being undelimited will be stripped from all the remaining
% leading spaces, if there was more than one to start with. Of course
-% brace-stripping may occur. And this iterates: each time a #2 is removed,
-% either we then have spaces and next #1 will be empty, or we have no spaces
-% and #1 will end at the first space. Ultimately #2 will be \xint_gobble_i.
+% brace-stripping may occur. And this iterates: each time a |#2| is removed,
+% either we then have spaces and next |#1| will be empty, or we have no spaces
+% and |#1| will end at the first space. Ultimately |#2| will be
+% |\xint_gobble_i|.
%
% This is not really robust as it may switch the expansion order of macros,
-% and the \xint_zapspaces token might end up being fetched up by a macro. But
-% it is enough for our purposes, for example:
-% $centeredline$bgroup\the\numexpr \xint_zapspaces 1 2 \xint_gobble_i\relax$egroup
-% expands to 12, and not 12\relax.
+% and the |\xint_zapspaces| token might end up being fetched up by a macro.
+% But it is enough for our purposes, for example:
+% \centeredline{|\the\numexpr\xint_zapspaces 1 2 \xint_gobble_i\relax|}
+% expands to |12|, not to |12\relax|.
%
+% \changed{1.2e}{} |\xint_zapspaces_o|. Expansion of |#1| should not gobble a
+% space!
%
-% 1.2e adds \xint_zapspaces_o. Expansion of #1 should not gobble a space!
-%
-% Made long with 1.2i.|
+% \changed{1.2i}{} made |\long|.
% \begin{macrocode}
\long\def\xint_zapspaces #1 #2{#1#2\xint_zapspaces }% 1.1
\long\def\xint_zapspaces_o #1{\expandafter\xint_zapspaces#1 \xint_gobble_i}%
% \end{macrocode}
% \subsection{\csh{odef}, \csh{oodef}, \csh{fdef}}
-% \lverb|May be prefixed with \global. No parameter text.|
+% May be prefixed with |\global|. No parameter text.
% \begin{macrocode}
\def\xintodef #1{\expandafter\def\expandafter#1\expandafter }%
\def\xintoodef #1{\expandafter\expandafter\expandafter\def
@@ -16809,19 +17352,16 @@ math shift catcode.
\ifdefined\fdef\else\let\fdef\xintfdef\fi
% \end{macrocode}
% \subsection{\csh{xintReverseOrder}}
-% \lverb|\xintReverseOrder: does NOT expand its argument.
-%
-% Attention: removes brace pairs.
+% \changed{1.0}{} does not expand its argument. The whole of xint codebase now
+% contains only two calls to |\XINT_rord_main| (in \xintgcdnameimp).
%
-% For contents with only digit tokens a faster reverse macro is provided as
-% \xintReverseDigits from 1.2 xintcore.sty.
+% Attention: removes brace pairs (and swallows spaces).
%
-% At 1.3a, \XINT_factortens from xintfrac.sty was redone in a faster
-% \numexpr-expansion style, and it stopped using this. There remains only
-% two calls from xintgcd.sty to \XINT_rord_main.
+% For digit tokens a faster reverse macro is provided by (|1.2|)
+% \csbxint{ReverseDigits} in \xintnameimp.
%
-% For comma separated items, 1.2g has (not user documented) \xintCSVReverse in
-% xinttools.sty.|
+% For comma separated items, |1.2g| has \csbxint{CSVReverse} in
+% \xinttoolsnameimp.
% \begin{macrocode}
\def\xintReverseOrder {\romannumeral0\xintreverseorder }%
\long\def\xintreverseorder #1%
@@ -16844,13 +17384,13 @@ math shift catcode.
}}\XINT_rord_cleanup { }%
% \end{macrocode}
% \subsection{\csh{xintLength}}
-% \lverb|\xintLength does NOT expand its argument. See \xintNthElt{0} from
-% xinttools.sty which f-expands its argument.
+% \changed{1.0}{} does not expand its argument. See \csbxint{NthElt}|{0}| from
+% \xinttoolsnameimp which f-expands its argument.
%
-% 1.2g has (not user documented) \xintCSVLength in xinttools.sty.
+% \changed{1.2g}{} added \csbxint{CSVLength} to \xinttoolsnameimp.
%
-% 1.2i has rewritten this venerable macro. New code is about 40$% faster
-% across all lengths. Was again slightly changed for 1.2j (cosmetic).|
+% \changed{1.2i}{} rewrote this venerable macro. New code about 40\%
+% faster across all lengths.
% \begin{macrocode}
\def\xintLength {\romannumeral0\xintlength }%
\def\xintlength #1{\long\def\xintlength ##1%
@@ -16873,9 +17413,9 @@ math shift catcode.
}%
% \end{macrocode}
% \subsection{\csh{xintLastItem}}
-% \lverb|New with 1.2i (2016/12/10). Output empty if input empty. One level
-% of braces removed in output. Does NOT expand its argument.
-% |
+% \changed{1.2i}{2016/12/10}
+% Output empty if input empty. One level
+% of braces removed in output. Does not expand its argument.
% \begin{macrocode}
\def\xintLastItem {\romannumeral0\xintlastitem }%
\long\def\xintlastitem #1%
@@ -16902,14 +17442,12 @@ math shift catcode.
\long\def\XINT_last_loop_endh #1#2#3#4#5#6#7#8#9\xint_bye{ #8}%
% \end{macrocode}
% \subsection{\csh{xintLengthUpTo}}
-% \lverb|1.2i for use by \xintKeep and \xintTrim.
+% \changed{1.2i}{} for use by \csbxint{Keep} and \csbxint{Trim}
+% (\xinttoolsnameimp). The argument N **must be non-negative**.
%
-% \xintLengthUpTo{N}{List} produces -0 if length(List)>N, else it returns
+% |\xintLengthUpTo{N}{List}| produces |-0| if length(List)>N, else it returns
% N-length(List). Hence subtracting it from N always computes min(N,length(List)).
-%
-% Does not expand its second argument (it is used by \xintKeep and \xintTrim
-% with already expanded argument). Not a user macro. 1.2j rewrote the ending
-% and changed the loop interface. The argument N **must be non-negative**.|
+% \changed{1.2j}{} changed ending and interface to core loop.
% \begin{macrocode}
\def\xintLengthUpTo {\romannumeral0\xintlengthupto}%
\long\def\xintlengthupto #1#2%
@@ -16946,21 +17484,23 @@ math shift catcode.
}%
% \end{macrocode}
% \subsection{\csh{xintreplicate}}
-% \lverb+Added with 1.2i. This is cloned from \prg_replicate:nn from expl3, see Joseph's post
+% \changed{1.2i}{}
+%
+% This is cloned from LaTeX3's |\prg_replicate:nn|, see Joseph's post
% at
-% $centeredline{$catcode125=2 http://tex.stackexchange.com/questions/16189/repeat-command-n-times}
+% \centeredline{http://tex.stackexchange.com/questions/16189/repeat-command-n-times}
% I
-% posted there an alternative not using the chained \csname's but it is a bit
+% posted there an alternative not using the chained |\csname|'s but it is a bit
% less efficient (except perhaps for thousands of repetitions).
-% The code in Joseph's post does |#1| replications when input #1 is negative
+% The code in Joseph's post does |abs(#1)| replications when input |#1| is negative
% and then activates an error triggering macro; here we simply do nothing when
-% #1 is negative.
+% |#1| is negative.
+% \centeredline{Usage: |\romannumeral\xintreplicate{N}{stuff}|}
%
-% When #1 is already explicit digits (even #1=0, but non-negative) one can
-% call the macro directly
-% as \romannumeral\XINT_rep #1\endcsname {foo} to skip the \numexpr.
-%
-% Expansion must be triggered by a \romannumeral.+
+% When |N| is already explicit digits (even |N=0|, but non-negative) one can
+% call the macro as
+% \centeredline{|\romannumeral\XINT_rep N\endcsname {foo}|}
+% to skip the |\numexpr|.
% \begin{macrocode}
\def\xintreplicate#1%
{\expandafter\XINT_replicate\the\numexpr#1\endcsname}%
@@ -17014,14 +17554,12 @@ math shift catcode.
{\xint_c_ #1#1#1#1#1#1#1#1#1}%
% \end{macrocode}
% \subsection{\csh{xintgobble}}
-% \lverb|Added with 1.2i.
-% I hesitated about allowing as many as 9^6-1=531440 tokens to gobble, but
-% 9^5-1=59058 is too low for playing with long decimal expansions.
+% \changed{1.2i}{}
%
-% Like for \xintreplicate, a \romannumeral is needed to trigger expansion.
+% I hesitated about allowing as many as |9^6-1=531440| tokens to gobble, but
+% |9^5-1=59058| is too low for playing with long decimal expansions.
+% \centeredline{Usage: |\romannumeral\xintgobble{N}...|}
%
-% I wrote in a similar spirit an \xintcount. But it proved slower than the
-% upgraded 1.2i \xintLength in all the range up to thousands of tokens.|
% \begin{macrocode}
\def\xintgobble #1%
{\csname xint_c_\expandafter\XINT_gobble_a\the\numexpr#1.0}%
@@ -17130,7 +17668,7 @@ math shift catcode.
{\noexpand\csname XINT_g67\expandafter\noexpand\csname XINT_g61\endcsname}%
% \end{macrocode}
% \subsection{(WIP) \csh{xintUniformDeviate}}
-% \lverb|1.3b. See user manual for related information.|
+% \changed{1.3b}{} See user manual for related information.
% \begin{macrocode}
\ifdefined\xint_texuniformdeviate
\expandafter\xint_firstoftwo
@@ -17172,9 +17710,11 @@ math shift catcode.
}%
% \end{macrocode}
% \subsection{\csh{xintMessage}, \csh{ifxintverbose}}
-% \lverb|1.2c added it for use by \xintdefvar and \xintdeffunc of xintexpr.
-% 1.2e uses \write128 rather than \write16 for compatibility with future
-% extended range of output streams, in LuaTeX in particular.|
+% \changed{1.2c}{} for use by \csbxint{defvar} and \csbxint{deffunc} of
+% \xintexprnameimp.
+%
+% \changed{1.2e}{} uses |\write128| rather than |\write16| for compatibility
+% with future extended range of output streams, in LuaTeX in particular.
% \begin{macrocode}
\def\xintMessage #1#2#3{%
\immediate\write128{Package #1 #2: (on line \the\inputlineno)}%
@@ -17182,16 +17722,18 @@ math shift catcode.
}%
\newif\ifxintverbose
% \end{macrocode}
+% \subsection{\csh{ifxintglobaldefs}, \csh{XINT_global}}\label{src-xintglobaldefstrue}
+% \changed{1.3c}{}
+% \begin{macrocode}
+\newif\ifxintglobaldefs
+\def\XINT_global{\ifxintglobaldefs\global\fi}%
+% \end{macrocode}
% \subsection{(WIP) Expandable error message}
-% \lverb|&
-% Incorporated in 1.2l release, but really belongs to next major release.
-%
-% This is copied over from l3kernel code. I am using \ ! / control sequence
-% though, which must be left undefined. \xintError: would be 6 letters more
-% already. Utiliser \FPE: ? (mais ce n'est pas uniquement du « floating point »)
+% \changed{1.2l}{} but really belongs to next major release beyond |1.3|.
%
-% Always used in context where expansion was launched by a
-% \romannumeral0 or \romannumeral`^^@.|
+% This is copied over from l3kernel code. I am using |\ ! /| control sequence
+% though, which must be left undefined. |\xintError:| would be 6 letters more
+% already.
% \begin{macrocode}
\def\XINT_expandableerror #1#2{%
\def\XINT_expandableerror ##1{%
@@ -17199,21 +17741,34 @@ math shift catcode.
\XINT_expandableerror_continue\xint_firstofone{#2#1##1#1}}%
\def\XINT_expandableerror_continue ##1#1##2#1{##1}%
}%
-\begingroup\lccode`$ 32 \catcode`/ 11 \catcode`! 11 \catcode32 11 %
-\lowercase{\endgroup\XINT_expandableerror$\ ! /\let\ ! /\xint_undefined}%
+\begingroup\lccode`$ 32 \catcode`/ 11 \catcode`! 11 \catcode32 11 % $
+% \end{macrocode}
+% \odef\MakePrivateLetters{\xintMakePrivateLetters
+% \catcode`/ 11 \catcode`! 11 \catcode32 11\relax}
+% \SpecialIndex{\ ! /}\let\MakePrivateLetters\xintMakePrivateLetters
+%^^A using \SpecialMainIndex does not not work, and trying without
+%^^A \SpecialIndex and letting doc parsing next line does not work either
+% \SpecialEscapechar{\+}^^A avoid doc.sty indexing erroneously \<space>
+% \begin{macrocode}
+\lowercase{\endgroup\XINT_expandableerror$\ ! /\let\ ! /\xint_undefined}% $
+% \end{macrocode}
+%^^A the special escapechar is used only for one macrocode environment
+% \begin{macrocode}
\XINT_restorecatcodes_endinput%
% \end{macrocode}
-%
% \StoreCodelineNo {xintkernel}
-%
+% \cleardoublepage\StopPackageIndex\let\xintkernelnameUp\undefined
%\gardesactifs
%\let</xintkernel>\relax
%\let<*xinttools>\gardesinactifs
%</xintkernel>^^A-------------------------------------------------
%<*xinttools>^^A--------------------------------------------------
-% \clearpage
+%^^A -*- coding: utf-8; mode: doctex; -*-
+% \clearpage\csname xinttoolsnameUp\endcsname
+% \StartPackageIndex{tools}
+% \let\MakePrivateLetters\xintMakePrivateLetters
% \section{Package \xinttoolsnameimp implementation}
-% \label{sec:toolsimp}
+% \RaisedLabel{sec:toolsimp}
%
% \localtableofcontents
%
@@ -17278,7 +17833,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xinttools}%
- [2018/05/18 1.3b Expandable and non-expandable utilities (JFB)]%
+ [2018/06/17 1.3c Expandable and non-expandable utilities (JFB)]%
% \end{macrocode}
% \lverb|\XINT_toks is used in macros such as \xintFor. It is not used
% elsewhere in the xint bundle.|
@@ -19139,7 +19694,11 @@ math shift catcode.
\XINT_last:f:csv_loop {#9}.%
}%
% \end{macrocode}
-% \subsubsection{Public names for the undocumented csv macros}
+% \subsubsection{Public names for the undocumented csv macros:
+% \csh{xintCSVLength}, \csh{xintCSVKeep}, \csh{xintCSVTrim},
+% \csh{xintCSVNthEltPy}, \csh{xintCSVReverse},
+% \csh{xintCSVFirstItem}, \csh{xintCSVLastItem}}
+%
% \lverb|Completely unstable macros: currently they expand the list argument
% and want no final comma. But for matters of xintexpr.sty I could as well
% decide to require a final comma, and then I could simplify implementation
@@ -19156,17 +19715,19 @@ math shift catcode.
\let\XINT_tmpa\relax \let\XINT_tmpb\relax \let\XINT_tmpc\relax
\XINT_restorecatcodes_endinput%
% \end{macrocode}
-%
% \StoreCodelineNo {xinttools}
-%
+% \cleardoublepage\StopPackageIndex\let\xinttoolsnameUp\undefined
%\gardesactifs
%\let</xinttools>\relax
%\let<*xintcore>\gardesinactifs
%</xinttools>^^A--------------------------------------------------
%<*xintcore>^^A---------------------------------------------------
-% \clearpage
+%^^A -*- coding: utf-8; mode: doctex -*-
+% \clearpage\csname xintcorenameUp\endcsname
+% \StartPackageIndex{core}
+% \let\MakePrivateLetters\xintMakePrivateLetters
% \section{Package \xintcorenameimp implementation}
-% \label{sec:coreimp}
+% \RaisedLabel{sec:coreimp}
%
% \localtableofcontents
%
@@ -19239,7 +19800,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintcore}%
- [2018/05/18 1.3b Expandable arithmetic on big integers (JFB)]%
+ [2018/06/17 1.3c Expandable arithmetic on big integers (JFB)]%
% \end{macrocode}
% \subsection{(WIP!) Error conditions and exceptions}
% \lverb|As per the Mike Cowlishaw/IBM's General Decimal Arithmetic Specification
@@ -19315,6 +19876,9 @@ math shift catcode.
\csname XINT_InvalidOperation_istrapped\endcsname
\csname XINT_Overflow_istrapped\endcsname
\csname XINT_Underflow_istrapped\endcsname
+% \end{macrocode}
+% \odef\MakePrivateLetters{\xintMakePrivateLetters \catcode`- 11 }
+% \begin{macrocode}
\catcode`- 11
\def\XINT_ConversionSyntax-signal {{InvalidOperation}}%
\let\XINT_DivisionImpossible-signal\XINT_ConversionSyntax-signal
@@ -19362,7 +19926,10 @@ math shift catcode.
% .. others ..
}%
\def\XINT_RaiseFlag #1{\expandafter\xint_gobble_i\csname XINT_#1Flag_ON\endcsname}%
-%% NOT IMPLEMENTED! WORK IN PROGRESS! (ALL SIGNALS TRAPPED, NO HANDLERS USED)
+% \end{macrocode}
+% NOT IMPLEMENTED! WORK IN PROGRESS! (ALL SIGNALS TRAPPED, NO HANDLERS USED)
+% \odef\MakePrivateLetters{\xintMakePrivateLetters \catcode`. 11 }
+% \begin{macrocode}
\catcode`. 11
\let\XINT_Clamped.handler\xint_firstofone % WIP
\def\XINT_InvalidOperation.handler#1{_NaN}% WIP
@@ -19378,6 +19945,7 @@ math shift catcode.
\def\XINT_Underflow.handler#1{_NaN}% WIP
\catcode`. 12
% \end{macrocode}
+% \let\MakePrivateLetters\xintMakePrivateLetters
% \subsection{Counts for holding needed constants}
% \begin{macrocode}
\ifdefined\m@ne\let\xint_c_mone\m@ne
@@ -19416,7 +19984,7 @@ math shift catcode.
\expandafter#1\the\numexpr ##1##2##3##4##5##6##7##8\relax
}}\XINT_cuz_small{ }%
% \end{macrocode}
-% \subsection{\csh{xintNum}}
+% \subsection{\csh{xintNum}, \csh{xintiNum}}
% \lverb|&
% For example \xintNum {----+-+++---+----000000000000003}
%
@@ -19433,6 +20001,8 @@ math shift catcode.
%
% Also, up to 1.2k inclusive, the macro fetched tokens eight by eight, and not
% nine by nine as is done now. I have no idea why.
+%
+% \xintNum gets redefined by $xintfracnameimp.
% |
% \begin{macrocode}
\def\xintiNum {\romannumeral0\xintinum }%
@@ -20153,7 +20723,7 @@ math shift catcode.
% it reduced the allowable numbers for addition from 19976 digits to 19968
% digits.|
%
-% \subsection{\csbh{xintiiAdd}}
+% \subsection{\csh{xintiiAdd}}
% \lverb|1.2l: \xintiiAdd made robust against non terminated input.|
% \begin{macrocode}
\def\xintiiAdd {\romannumeral0\xintiiadd }%
@@ -22479,17 +23049,19 @@ math shift catcode.
}%
\XINT_restorecatcodes_endinput%
% \end{macrocode}
-%
% \StoreCodelineNo {xintcore}
-%
+% \cleardoublepage\StopPackageIndex\let\xintcorenameUp\undefined
%\gardesactifs
%\let</xintcore>\relax
%\let<*xint>\gardesinactifs
%</xintcore>^^A---------------------------------------------------
%<*xint>^^A-------------------------------------------------------
-% \clearpage
+%^^A -*- coding: utf-8; mode: doctex -*-
+% \clearpage\csname xintnameUp\endcsname
+% \StartPackageIndex{xint}
+% \let\MakePrivateLetters\xintMakePrivateLetters
% \section{Package \xintnameimp implementation}
-% \label{sec:xintimp}
+% \RaisedLabel{sec:xintimp}
%
% \localtableofcontents
%
@@ -22550,7 +23122,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xint}%
- [2018/05/18 1.3b Expandable operations on big integers (JFB)]%
+ [2018/06/17 1.3c Expandable operations on big integers (JFB)]%
% \end{macrocode}
% \subsection{More token management}
% \begin{macrocode}
@@ -22561,7 +23133,7 @@ math shift catcode.
\long\def\xint_secondofthree_thenstop #1#2#3{ #2}%
\long\def\xint_thirdofthree_thenstop #1#2#3{ #3}%
% \end{macrocode}
-% \subsection{(WIP) A constant needed by \csh{xintRandomDigits} et al.}
+% \subsection{(WIP) A constant needed by \cshnolabel{xintRandomDigits} et al.}
% \begin{macrocode}
\ifdefined\xint_texuniformdeviate
\unless\ifdefined\xint_c_nine_x^viii
@@ -22570,13 +23142,15 @@ math shift catcode.
\fi
\fi
% \end{macrocode}
-% \subsection{\csh{xintLen}}
+% \subsection{\csh{xintLen}, \csh{xintiLen}}
% \lverb|\xintLen gets extended to fractions by xintfrac.sty: A/B is given
% length len(A)+len(B)-1 (somewhat arbitrary). It applies \xintNum to its
% argument. A minus sign is accepted and ignored.
%
%
% For parallelism with \xintiNum/\xintNum, 1.2o defines \xintiLen.
+%
+% \xintLen gets redefined by $xintfracnameimp.
% |
% \begin{macrocode}
\def\xintiLen {\romannumeral0\xintilen }%
@@ -22679,7 +23253,7 @@ math shift catcode.
\def\XINT_iie_neg #1.#2;{ #2}%
% \end{macrocode}
% \subsection{\csh{xintDecSplit}}
-% \lverb!DECIMAL SPLIT
+% \lverb@DECIMAL SPLIT
%
% The macro \xintDecSplit {x}{A} cuts A which is composed of digits (leading
% zeroes ok, but no sign) (*) into two (each possibly empty) pieces L and R.
@@ -22698,7 +23272,7 @@ math shift catcode.
% Entirely rewritten for 1.2i (2016/12/11).
%
% Attention: \xintDecSplit not robust against non terminated second argument.
-% !
+% @
% \begin{macrocode}
\def\xintDecSplit {\romannumeral0\xintdecsplit }%
\def\xintdecsplit #1#2%
@@ -22811,7 +23385,7 @@ math shift catcode.
\def\XINT_splitr_finish #1.#2.{ #2}%
% \end{macrocode}
% \subsection{\csh{xintDSHr}}
-% \lverb!DECIMAL SHIFTS \xintDSH {x}{A}$\
+% \lverb@DECIMAL SHIFTS \xintDSH {x}{A}$\
% si x <= 0, fait A -> A.10^(|x|).
% si x > 0, et A >=0, fait A -> quo(A,10^(x))$\
% si x > 0, et A < 0, fait A -> -quo(-A,10^(x))$\
@@ -22821,7 +23395,7 @@ math shift catcode.
% Badly named macros.
%
% Rewritten for 1.2i, this was old code and \xintDSx has changed interface.
-% !
+% @
% \begin{macrocode}
\def\xintDSHr {\romannumeral0\xintdshr }%
% \end{macrocode}
@@ -22888,21 +23462,22 @@ math shift catcode.
}%
% \end{macrocode}
% \subsection{\csh{xintDSx}}
-% \lverb!&
-% --> Attention le cas x=0 est traité dans la même catégorie que x > 0 <--$\
-% si x < 0, fait A -> A.10^(|x|)$\
-% si x >= 0, et A >=0, fait A -> {quo(A,10^(x))}{rem(A,10^(x))}$\
-% si x >= 0, et A < 0, d'abord on calcule {quo(-A,10^(x))}{rem(-A,10^(x))}$\
-% puis, si le premier n'est pas nul on lui donne le signe -$\
-% si le premier est nul on donne le signe - au second.
+% \lverb@&
+% --> Attention le cas x=0 est traité dans la même catégorie que x > 0 <--
%
+%( si x < 0, fait A -> A.10^(|x|)
+%: si x >= 0, et A >=0, fait A -> {quo(A,10^(x))}{rem(A,10^(x))}
+%: si x >= 0, et A < 0, d'abord on calcule {quo(-A,10^(x))}{rem(-A,10^(x))}
+%: puis, si le premier n'est pas nul on lui donne le signe -
+%: si le premier est nul on donne le signe - au second.
+%)
% On peut donc toujours reconstituer l'original A par 10^x Q \pm R
% où il faut prendre le signe plus si Q est positif ou nul et le signe moins si
% Q est strictement négatif.
%
% Rewritten for 1.2i, this was old code.
%
-% !
+% @
% \begin{macrocode}
\def\xintDSx {\romannumeral0\xintdsx }%
\def\xintdsx #1#2%
@@ -24807,17 +25382,19 @@ math shift catcode.
\fi
\XINT_restorecatcodes_endinput%
% \end{macrocode}
-%
% \StoreCodelineNo {xint}
-%
+% \cleardoublepage\StopPackageIndex\let\xintnameUp\undefined
%\gardesactifs
%\let</xint>\relax
%\let<*xintbinhex>\gardesinactifs
%</xint>^^A-------------------------------------------------------
%<*xintbinhex>^^A-------------------------------------------------
-% \clearpage
+%^^A -*- coding: utf-8; mode: doctex; -*-
+% \clearpage\csname xintbinhexnameUp\endcsname
+% \StartPackageIndex{binhex}
+% \let\MakePrivateLetters\xintMakePrivateLetters
% \section{Package \xintbinhexnameimp implementation}
-% \label{sec:binheximp}
+% \RaisedLabel{sec:binheximp}
%
% \localtableofcontents
%
@@ -24891,7 +25468,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintbinhex}%
- [2018/05/18 1.3b Expandable binary and hexadecimal conversions (JFB)]%
+ [2018/06/17 1.3c Expandable binary and hexadecimal conversions (JFB)]%
% \end{macrocode}
% \subsection{Constants, etc...}
% \lverb|1.2n switches to \csname-governed expansion at various places.|
@@ -25458,17 +26035,19 @@ math shift catcode.
\def\XINT_chtb_main {\csname space\csname\XINT_htb_loop}%
\XINT_restorecatcodes_endinput%
% \end{macrocode}
-%
% \StoreCodelineNo {xintbinhex}
-%
+% \cleardoublepage\StopPackageIndex\let\xintbinhexnameUp\undefined
%\gardesactifs
%\let</xintbinhex>\relax
%\let<*xintgcd>\gardesinactifs
%</xintbinhex>^^A-------------------------------------------------
%<*xintgcd>^^A----------------------------------------------------
-% \clearpage
+%^^A -*- coding: utf-8; mode: doctex; -*-
+% \clearpage\csname xintgcdnameUp\endcsname
+% \StartPackageIndex{gcd}
+% \let\MakePrivateLetters\xintMakePrivateLetters
% \section{Package \xintgcdnameimp implementation}
-% \label{sec:gcdimp}
+% \RaisedLabel{sec:gcdimp}
%
% \localtableofcontents
%
@@ -25543,7 +26122,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintgcd}%
- [2018/05/18 1.3b Euclide algorithm with xint package (JFB)]%
+ [2018/06/17 1.3c Euclide algorithm with xint package (JFB)]%
% \end{macrocode}
% \subsection{\csh{xintGCD}, \csh{xintiiGCD}}
% \lverb|1.09a added \xintnum filtering from \xintiabs. This is a bit overhead
@@ -26175,17 +26754,19 @@ math shift catcode.
}%
\XINT_restorecatcodes_endinput%
% \end{macrocode}
-%
% \StoreCodelineNo {xintgcd}
-%
+% \cleardoublepage\StopPackageIndex\let\xintgcdnameUp\undefined
%\gardesactifs
%\let</xintgcd>\relax
%\let<*xintfrac>\gardesinactifs
%</xintgcd>^^A----------------------------------------------------
%<*xintfrac>^^A---------------------------------------------------
-% \clearpage
+%^^A -*- coding: utf-8; mode: doctex; -*-
+% \clearpage\csname xintfracnameUp\endcsname
+% \StartPackageIndex{frac}
+% \let\MakePrivateLetters\xintMakePrivateLetters
% \section{Package \xintfracnameimp implementation}
-% \label{sec:fracimp}
+% \RaisedLabel{sec:fracimp}
%
% \localtableofcontents
%
@@ -26214,7 +26795,6 @@ math shift catcode.
\let\z\endgroup
\expandafter\let\expandafter\x\csname ver@xintfrac.sty\endcsname
\expandafter\let\expandafter\w\csname ver@xint.sty\endcsname
- \expandafter\let\expandafter\ww\csname ver@xintgcd.sty\endcsname
\expandafter
\ifx\csname PackageInfo\endcsname\relax
\def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}%
@@ -26228,18 +26808,14 @@ math shift catcode.
\else
\ifx\x\relax % plain-TeX, first loading of xintfrac.sty
\ifx\w\relax % but xint.sty not yet loaded.
- \def\z{\endgroup\input xint.sty\relax\input xintgcd.sty\relax}%
+ \def\z{\endgroup\input xint.sty\relax}%
\fi
\else
\def\empty {}%
\ifx\x\empty % LaTeX, first loading,
% variable is initialized, but \ProvidesPackage not yet seen
\ifx\w\relax % xint.sty not yet loaded.
- \def\z{\endgroup\RequirePackage{xint}\RequirePackage{xintgcd}}%
- \else
- \ifx\ww\relax
- \def\z{\endgroup\RequirePackage{xintgcd}}%
- \fi
+ \def\z{\endgroup\RequirePackage{xint}}%
\fi
\else
\aftergroup\endinput % xintfrac already loaded.
@@ -26253,7 +26829,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintfrac}%
- [2018/05/18 1.3b Expandable operations on fractions (JFB)]%
+ [2018/06/17 1.3c Expandable operations on fractions (JFB)]%
% \end{macrocode}
% \subsection{\csh{XINT_cntSgnFork}}
% \lverb|1.09i. Used internally, #1 must expand to \m@ne, \z@, or \@ne or
@@ -26267,7 +26843,7 @@ math shift catcode.
\fi
}%
% \end{macrocode}
-% \subsection{\csh{xintLen}}
+% \subsection{\cshnolabel{xintLen}}
% \lverb|The used formula is disputable, the idea is that A/1 and A should have
% same length. Venerable code rewritten for 1.2i, following updates to
% \xintLength in xintkernel.sty. And sadly, I forgot on this
@@ -26330,7 +26906,7 @@ math shift catcode.
\expandafter\XINT_outfrac_P\expandafter {#2}{#1}%
}%
% \end{macrocode}
-% \subsection{\csh{XINT_inFrac}}
+% \subsection{\csh{XINT_inFrac}}\label{src-XINT_infrac}
% \lverb|&
% Parses fraction, scientific notation, etc... and produces {n}{A}{B}
% corresponding to A/B times 10^n. No reduction to smallest terms.
@@ -26613,13 +27189,14 @@ math shift catcode.
% \end{macrocode}
% \subsection{\xintListWithSep{, }
% {\xintApply{ \csh}{{xintEq}{xintNotEq}{xintGt}{xintLt}{xintGtorEq}
-% {xintLtorEq}{xintIsZero}{xintIsNotZero}{xintIsOne}{xintOdd}
+% {xintLtorEq}{xintIsZero}{xintIsNotZero}{xintOdd}
% {xintEven}{xintifSgn}{xintifCmp}{xintifEq}{xintifGt}{xintifLt}
% {xintifZero}{xintifNotZero}{xintifOne}{xintifOdd}}}}
%
% \lverb|Moved here at 1.3. Formerly these macros were already defined in
% xint.sty or even xintcore.sty. They are slim wrappers of macros defined
-% elsewhere in xintfrac.|
+% elsewhere in xintfrac.
+% |
% \begin{macrocode}
\def\xintEq {\romannumeral0\xinteq }%
\def\xinteq #1#2{\xintifeq{#1}{#2}{1}{0}}%
@@ -26635,8 +27212,6 @@ math shift catcode.
\def\xintIsNotZero{\romannumeral0\xintisnotzero }%
\def\xintisnotzero
#1{\if0\xintSgn{#1}\xint_afterfi{ 0}\else\xint_afterfi{ 1}\fi}%
-\def\xintIsOne {\romannumeral0\xintisone }%
-\def\xintisone #1{\expandafter\XINT_isone\romannumeral0\xintnum{#1}XY}%
\def\xintOdd {\romannumeral0\xintodd }%
\def\xintodd #1%
{%
@@ -27413,7 +27988,7 @@ math shift catcode.
\def\xintTTrunc {\romannumeral0\xintttrunc }%
\def\xintttrunc {\xintitrunc\xint_c_}%
% \end{macrocode}
-% \subsection{\csh{xintNum}}
+% \subsection{\cshnolabel{xintNum}}
% \begin{macrocode}
\let\xintnum \xintttrunc
% \end{macrocode}
@@ -30793,7 +31368,7 @@ math shift catcode.
\xint_orthat\xint_firstoftwo_thenstop
}%
% \end{macrocode}
-% \subsection{(WIP) \csh{XINTinRandomFloatS}}
+% \subsection{(WIP) \csh{XINTinRandomFloatS}, \csh{XINTinRandomFloatSdigits}}
% \lverb|1.3b. Support for random() function.
%
% Thus as it is a priori only for xintexpr usage, it expands inside \csname
@@ -30817,24 +31392,8 @@ math shift catcode.
% when there are leading zeros in the random digits the (virtual) mantissa
% ends up with trailing zeros. That did not feel right but I checked random()
% in Python (which of course uses radix 2), and indeed this is what happens
-% there:
-%
-%( from random import random
-%: from struct import pack
-%: def binary(num):
-%: return ''.join('{:0>8b}'.format(c) for c in pack('>d', num))
-%: def test(n):
-%: x=random()
-%: while 2**n*x>=1:
-%: x=random()
-%: return x, binary(x)
-%: # ou simplement
-%: def test(n):
-%: x=random()
-%: while 2**n*x>=1:
-%: x=random()
-%: return x, 2**53*x
-%)
+% there.
+%
% |
% \begin{macrocode}
\def\XINTinRandomFloatS{\romannumeral0\XINTinrandomfloatS}%
@@ -30876,17 +31435,19 @@ math shift catcode.
}%
\XINT_restorecatcodes_endinput%
% \end{macrocode}
-%
% \StoreCodelineNo {xintfrac}
-%
+% \cleardoublepage\StopPackageIndex\let\xintfracnameUp\undefined
%\gardesactifs
%\let</xintfrac>\relax
%\let<*xintseries>\gardesinactifs
%</xintfrac>^^A---------------------------------------------------
%<*xintseries>^^A-------------------------------------------------
-% \clearpage
+%^^A -*- coding: utf-8; mode: doctex; -*-
+% \clearpage\csname xintseriesnameUp\endcsname
+% \StartPackageIndex{series}
+% \let\MakePrivateLetters\xintMakePrivateLetters
% \section{Package \xintseriesnameimp implementation}
-% \label{sec:seriesimp}
+% \RaisedLabel{sec:seriesimp}
%
% \localtableofcontents
%
@@ -30949,7 +31510,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintseries}%
- [2018/05/18 1.3b Expandable partial sums with xint package (JFB)]%
+ [2018/06/17 1.3c Expandable partial sums with xint package (JFB)]%
% \end{macrocode}
% \subsection{\csh{xintSeries}}
% \begin{macrocode}
@@ -31368,17 +31929,19 @@ math shift catcode.
}%
\XINT_restorecatcodes_endinput%
% \end{macrocode}
-%
% \StoreCodelineNo {xintseries}
-%
+% \cleardoublepage\StopPackageIndex\let\xintseriesnameUp\undefined
%\gardesactifs
%\let</xintseries>\relax
%\let<*xintcfrac>\gardesinactifs
%</xintseries>^^A-------------------------------------------------
%<*xintcfrac>^^A--------------------------------------------------
-% \clearpage
+%^^A -*- coding: utf-8; mode: doctex; -*-
+% \clearpage\csname xintcfracnameUp\endcsname
+% \StartPackageIndex{cfrac}
+% \let\MakePrivateLetters\xintMakePrivateLetters
% \section{Package \xintcfracnameimp implementation}
-% \label{sec:cfracimp}
+% \RaisedLabel{sec:cfracimp}
%
% \localtableofcontents
%
@@ -31450,7 +32013,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintcfrac}%
- [2018/05/18 1.3b Expandable continued fractions with xint package (JFB)]%
+ [2018/06/17 1.3c Expandable continued fractions with xint package (JFB)]%
% \end{macrocode}
% \subsection{\csh{xintCFrac}}
% \begin{macrocode}
@@ -32556,26 +33119,26 @@ math shift catcode.
\def\XINT_gctgc_end_b #1#2#3{ #3{#1}}%
\XINT_restorecatcodes_endinput%
% \end{macrocode}
-%
% \StoreCodelineNo {xintcfrac}
-%
+% \cleardoublepage\StopPackageIndex\let\xintcfracnameUp\undefined
%\gardesactifs
%\let</xintcfrac>\relax
%\let<*xintexpr>\gardesinactifs
%</xintcfrac>^^A--------------------------------------------------
%<*xintexpr>^^A---------------------------------------------------
-% \clearpage
+%^^A -*- coding: utf-8; mode: doctex; fill-column: 78; -*-
+% \clearpage\csname xintexprnameUp\endcsname
+% \StartPackageIndex{expr}
+% \let\MakePrivateLetters\xintexprMakePrivateLetters
% \section{Package \xintexprnameimp implementation}
-% \label{sec:exprimp}
-%
-% \etocstandarddisplaystyle
+% \RaisedLabel{sec:exprimp}
+% \etocarticlestylenomarks
% \etocstandardlines
% \etocsetnexttocdepth {subsection}
%
% \localtableofcontents
-% \etocsettocstyle{}{}
%
-% \etocmarkbothnouc {Package \xintexprnameimp implementation}
+% \etocsettocstyle{}{}
%
% This is release \expandafter|\xintbndlversion| of
% \expandafter|\expandafter[\xintbndldate]|.
@@ -32701,7 +33264,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintexpr}%
- [2018/05/18 1.3b Expandable expression parser (JFB)]%
+ [2018/06/17 1.3c Expandable expression parser (JFB)]%
\catcode`! 11
\let\XINT_Cmp \xintiiCmp
% \end{macrocode}
@@ -32897,9 +33460,7 @@ math shift catcode.
\expandafter\xintPFloat::csv
\romannumeral`&&@\expandafter\XINT_expr_unlock_sp\string #1!%
}%
-\catcode`: 12
- \def\XINT_expr_unlock_sp #1.;#2.=#3!{{#2}{#3}}%
-\catcode`: 11
+\def\XINT_expr_unlock_sp #1.;#2.=#3!{{#2}{#3}}%
% \end{macrocode}
% \subsection{\csh{xintboolexpr}, \csh{xinttheboolexpr}, \csh{thexintboolexpr}}
% \begin{macrocode}
@@ -32917,15 +33478,15 @@ math shift catcode.
\def\xintifboolfloatexpr #1{\romannumeral0\xintifnotzero {\xintthefloatexpr #1\relax}}%
\def\xintifbooliiexpr #1{\romannumeral0\xintifnotzero {\xinttheiiexpr #1\relax}}%
% \end{macrocode}
-% \subsection{Hooks for the functioning of \csh{xintNewExpr} and
-% \csh{xintdeffunc}}
+% \subsection{Hooks for the functioning of \cshnolabel{xintNewExpr} and
+% \cshnolabel{xintdeffunc}}
% \lverb|This is new with 1.3. See \XINT_expr_redefinemacros.|
% \begin{macrocode}
\let\XINT:NEhook:two\empty
\let\XINT:NEhook:one\empty
\let\XINT:NEhook:csv\empty
% \end{macrocode}
-% \subsection{Macros handling csv lists on output (for \csh{XINT_expr_print} et
+% \subsection{Macros handling csv lists on output (for \cshnolabel{XINT_expr_print} et
% al. routines)}
% \localtableofcontents
% \lverb|Changed completely for 1.1, which adds the optional arguments to
@@ -33061,7 +33622,7 @@ math shift catcode.
}}%
\def\XINT_expr_scan_macropar #1#2{\expandafter\XINT_expr_getop\csname .=#1#2\endcsname }%
% \end{macrocode}
-% \subsection{The integer or decimal number or hexa-decimal number or
+% \subsection{\csh{XINT_expr_scan_nbr_or_func}: the integer or decimal number or hexa-decimal number or
% function name or variable name or special hacky things big parser}
% \localtableofcontents
% \lverb@1.2 release has replaced chains of \romannumeral-`0 by \csname
@@ -33103,6 +33664,8 @@ math shift catcode.
% \XINT_{expr|iiexpr|flexpr}_func_+ (or *). Documentation of 1.1 said to use
% `+`(...), but `+(...) is also valid. The opening parenthesis must be there,
% it is not allowed to come from expansion.@
+%
+% \odef\MakePrivateLetters{\xintexprMakePrivateLetters \catcode`` 11 }
% \begin{macrocode}
\catcode96 11 % `
\def\XINT_expr_scan_nbr_or_func #1% this #1 has necessarily here catcode 12
@@ -33116,6 +33679,9 @@ math shift catcode.
\def\XINT_expr_gotnil{\expandafter\XINT_expr_getop\csname.= \endcsname}%
\def\XINT_expr_onliteral_` #1#2#3({\xint_c_xviii `{#2}}%
\catcode96 12 % `
+% \end{macrocode}
+% \let\MakePrivateLetters\xintexprMakePrivateLetters
+% \begin{macrocode}
\def\XINT_expr_startint #1%
{%
\if #10\expandafter\XINT_expr_gobz_a\else\XINT_expr_scanint_a\fi #1%
@@ -33384,7 +33950,7 @@ math shift catcode.
\expandafter\XINT_expr_scanhexII_a\romannumeral`&&@#2%
}%
% \end{macrocode}
-% \subsubsection{Parsing names of functions and variables}
+% \subsubsection{\csh{XINT_expr_scanfunc}: parsing names of functions and variables}
% \begin{macrocode}
\def\XINT_expr_scanfunc
{%
@@ -33499,6 +34065,9 @@ math shift catcode.
{%
\expandafter\XINT_expr_getop_a\expandafter #1\romannumeral`&&@#2%
}%
+% \end{macrocode}
+% \odef\MakePrivateLetters{\xintexprMakePrivateLetters \catcode`* 11 }
+% \begin{macrocode}
\catcode`* 11
\def\XINT_expr_getop_a #1#2%
{%
@@ -33515,6 +34084,9 @@ math shift catcode.
{\expandafter\XINT_expr_getop_b \string#2#1}%
}%
\catcode`* 12
+% \end{macrocode}
+% \let\MakePrivateLetters\xintexprMakePrivateLetters
+% \begin{macrocode}
\def\XINT_expr_foundend {\xint_c_ \relax }% \relax is a place holder here.
% \end{macrocode}
% \lverb|? is a very special operator with top precedence which will check if
@@ -33568,6 +34140,8 @@ math shift catcode.
% \lverb|Version 1.1 had a hack inside the until macros for handling the omit
% and abort in iterations over dummy variables. This has been removed by
% 1.2c, see the subsection where omit and abort are discussed.|
+%
+% \odef\MakePrivateLetters{\xintexprMakePrivateLetters \catcode`) 11 }
% \begin{macrocode}
\catcode`) 11
\def\XINT_tmpa #1#2#3#4%
@@ -33614,6 +34188,7 @@ math shift catcode.
}%
\def\XINT_expr_missing_) {\xintError:inserted \xint_c_ \XINT_expr_done }%
% \end{macrocode}
+% \let\MakePrivateLetters\xintexprMakePrivateLetters
% \lverb|We should be using until_( notation to stay synchronous with until_+,
% until_* etc..., but I found that until_) was more telling.|
% \begin{macrocode}
@@ -33673,6 +34248,10 @@ math shift catcode.
% I could have used a catcode12 a possibly, but anyhow jumping straight to
% \XINT_expr_scanop_a skips a few expansion steps (up to the potential price
% of less conceptual programming if I change things in the future.)|
+%^^A mais ne sert à rien je pense à cause des \csname
+%^^A\def\MakePrivateLetters{\catcode`_ 11 \catcode`: 11 \catcode`^ 11
+%^^A \catcode`@ 11 \catcode`! 11
+%^^A \catcode`. 11 \catcode`= 11 \catcode`+ 11 }
% \begin{macrocode}
\catcode`. 11 \catcode`= 11 \catcode`+ 11
\xintFor #1 in {expr,flexpr,iiexpr} \do {%
@@ -34078,6 +34657,9 @@ math shift catcode.
\csname XINT_#1_op_-vi\expandafter\endcsname
\csname XINT_expr_precedence_:\endcsname {#1}%
}%
+% \end{macrocode}
+% \odef\MakePrivateLetters{\xintexprMakePrivateLetters \catcode`[ 11 \catcode`] 11 }
+% \begin{macrocode}
\catcode`[ 11 \catcode`] 11
\let\XINT_expr_precedence_:] \xint_c_iii
\def\XINT_expr_op_:] #1%
@@ -34099,6 +34681,7 @@ math shift catcode.
\let\XINT_iiexpr_op_][: \XINT_expr_op_][:
\catcode`[ 12 \catcode`] 12
% \end{macrocode}
+% \let\MakePrivateLetters\xintexprMakePrivateLetters
% \subsubsection{\csh{xintListSel:x:csv}}
% \lverb|1.2j. Because there is \xintKeep:x:csv which is faster than
% \xintKeep:f:csv.|
@@ -34251,18 +34834,18 @@ math shift catcode.
#1,{,#1\xint_Bye}%
\expandafter\let\csname XINT_keep:x:csv_finish8\endcsname\xint_Bye
% \end{macrocode}
-% \subsubsection{\csh{xintKeep:f:csv}}
-% \lverb|1.2g, code in xinttools.sty. Refactored in 1.2j.|
-% \subsubsection{\csh{xintTrim:f:csv}}
-% \lverb|1.2g, code in xinttools.sty. Refactored in 1.2j.|
-% \subsubsection{\csh{xintNthEltPy:f:csv}}
-% \lverb|1.2g, code in xinttools.sty. Refactored in 1.2j.|
-% \subsubsection{\csh{xintLength:f:csv}}
-% \lverb|1.2g, code in xinttools.sty. Refactored in 1.2j.|
-% \subsubsection{\csh{xintReverse:f:csv}}
-% \lverb|1.2g, code in xinttools.sty.|
-%
-%\subsection{Macros for a..b list generation}
+% \subsubsection{\cshnolabel{xintKeep:f:csv}}
+% \changed{1.2g}{} moved to \xinttoolsnameimp.
+% \subsubsection{\cshnolabel{xintTrim:f:csv}}
+% \changed{1.2g}{} moved to \xinttoolsnameimp.
+% \subsubsection{\cshnolabel{xintNthEltPy:f:csv}}
+% \changed{1.2g}{} moved to \xinttoolsnameimp.
+% \subsubsection{\cshnolabel{xintLength:f:csv}}
+% \changed{1.2g}{} moved to \xinttoolsnameimp.
+% \subsubsection{\cshnolabel{xintReverse:f:csv}}
+% \changed{1.2g}{} moved to \xinttoolsnameimp.
+%
+% \subsection{Macros for a..b list generation}
% \localtableofcontents
%
% \lverb|Ne produit que des listes d'entiers inférieurs à la borne
@@ -34591,9 +35174,10 @@ math shift catcode.
%
% \numexpr will not handle catcode 11 digits, but adding a \detokenize will
% suddenly make illicit for N to rely on macro expansion.|
+%
+% \odef\MakePrivateLetters{\xintexprMakePrivateLetters \catcode`[ 11 }
% \begin{macrocode}
\catcode`[ 11
-\catcode`* 11
\let\XINT_expr_precedence_[ \xint_c_vii
\def\XINT_expr_op_[ #1#2]{\expandafter\XINT_expr_getop
\csname .=\xintE{\XINT_expr_unlock #1}%
@@ -34605,8 +35189,9 @@ math shift catcode.
\csname .=\XINTinFloatE{\XINT_expr_unlock #1}%
{\xint_zapspaces #2 \xint_gobble_i}\endcsname}%
\catcode`[ 12
-\catcode`* 12
% \end{macrocode}
+% \let\MakePrivateLetters\xintexprMakePrivateLetters
+%
% \subsection{\csh{XINT_expr_op_`} for recognizing functions}
% \lverb|The "onliteral" intercepts is for bool, togl, protect, ... but also
% for add, mul, seq, etc... Genuine functions have expr, iiexpr and
@@ -34646,7 +35231,7 @@ math shift catcode.
\def\XINT_expr_func_unknown #1#2#3%
{\expandafter #1\expandafter #2\csname .=0\endcsname }%
% \end{macrocode}
-% \subsection{The bool, togl, protect pseudo ``functions''}
+% \subsection{The \csh{bool()}, \csh{togl()}, \csh{protect()} pseudo ``functions''}
% \lverb|bool, togl and protect use delimited macros. They are not true
% functions, they turn off the parser to gather their "variable".|
% \begin{macrocode}
@@ -34657,7 +35242,7 @@ math shift catcode.
\def\XINT_expr_onliteral_protect #1)%
{\expandafter\XINT_expr_getop\csname .=\detokenize{#1}\endcsname }%
% \end{macrocode}
-% \subsection{The break function}
+% \subsection{The \csh{break()} function}
% \lverb|break is a true function, the parsing via expansion of the succeeding
% material proceeded via _oparen macros as with any other function.|
% \begin{macrocode}
@@ -34666,9 +35251,21 @@ math shift catcode.
\let\XINT_flexpr_func_break \XINT_expr_func_break
\let\XINT_iiexpr_func_break \XINT_expr_func_break
% \end{macrocode}
-% \subsection{The qint, qfrac, qfloat ``functions''}
-% \lverb|New with 1.2. Allows the user to hand over quickly a big number to the
-% parser, spaces not immediately removed but should be harmless in general.|
+% \subsection{The \csh{qraw()}, \csh{qint()}, \csh{qfrac()}, and
+% \csh{qfloat()} ``functions''}
+%
+% \changed{1.2}{} adds |qint()|, |qfrac()|, |qfloat()|.
+%
+% \changed{1.3c}{} adds |qraw()|. Useful to limit impact on \TeX{} memory
+% from abuse of |\csname|'s storage when generating many comma separated
+% values from a loop.
+%
+% \lverb|They allow the user to hand over quickly a big number to the parser,
+% spaces not immediately removed but should be harmless in general. The qraw()
+% does no post-processing at all apart complete expansion, useful for
+% comma-separated values, but must be obedient to (non really documented)
+% expected format. Each uses a delimited macro, the closing parenthesis can
+% not emerge from expansion.|
% \begin{macrocode}
\def\XINT_expr_onliteral_qint #1)%
{\expandafter\XINT_expr_getop\csname .=\xintiNum{#1}\endcsname }%
@@ -34676,8 +35273,10 @@ math shift catcode.
{\expandafter\XINT_expr_getop\csname .=\xintRaw{#1}\endcsname }%
\def\XINT_expr_onliteral_qfloat #1)%
{\expandafter\XINT_expr_getop\csname .=\XINTinFloatdigits{#1}\endcsname }%
+\def\XINT_expr_onliteral_qraw #1)%
+ {\expandafter\XINT_expr_getop\csname .=#1\endcsname }%
% \end{macrocode}
-% \subsection{The random() and qrand() ``functions''}
+% \subsection{The \csh{random()} and \csh{qrand()} ``functions''}
% \lverb|1.3b. Function-like syntax but with no argument currently, so let's
% use fast parsing which requires though the closing parenthesis to be
% explicit.|
@@ -34708,66 +35307,61 @@ math shift catcode.
\let\XINT_flexpr_op__ \XINT_expr_op__
\let\XINT_iiexpr_op__ \XINT_expr_op__
% \end{macrocode}
-% \subsection{User defined variables: \csh{xintdefvar}, \csh{xintdefiivar}, \csh{xintdeffloatvar}}
-% \lverb|1.1 An active : character will be a pain with our delimited macros and
-% I almost decided not to use := but rather = as assignation operator, but this
-% is the same problem inside expressions with the modulo operator /:, or with
-% babel+frenchb with all high punctuation ?, !, :, ;.
+% \subsection{User defined variables: \csh{xintdefvar}, \csh{xintdefiivar},
+% \csh{xintdeffloatvar}}
+% \changed{1.1}{}
%
-% Variable names may contain letters, digits, underscores, and must not start
-% with a digit. Names starting with @ or un underscore are reserved.
+% \changed{1.2p}{2017/12/01} extends |\xintdefvar| et.\@ al.\@ to accept
+% simultaneous assignments to multiple variables.
%
-% Note (2015/11/11): although defined since october 2014 with 1.1, they were
-% only very briefly mentioned in the user documentation, I should have
-% expanded more. I am now adding functions to variables, and will rewrite
-% entirely the documentation of xintexpr.sty.
+% \changed{1.3c}{2018/06/17}
+% Use \csbxint{exprSafeCatcodes} (to palliate issue with
+% active semi-colon from Babel+French if in body of a \LaTeX{} document).
%
-% 1.2c adds the "onliteral" macros as we changed our tricks to disambiguate
-% variables from functions if followed by a parenthesis, in order to allow
-% function names to have precedence on variable names.
-%
-% I don't issue warnings if a an attempt to define a variable name clashes
-% with a pre-existing function name, as I would have to check expr, iiexpr and
-% also floatexpr. And anyhow overloading a function name with a variable name
-% is allowed, the only thing to know is that if an opening parenthesis follows
-% it is the function meaning which prevails.
-%
-% 2015/11/13: I now first do an a priori complete expansion of #1, and
-% then apply \detokenize to the result, and remove spaces.
-%
-% 2015/11/21: finally I do not detokenize the variable name. Because this
-% complicated the \xintunassignvar if it did the same and we wanted to use it
-% to redeclare a letter as dummy variable.
-%
-% Documentation of 1.2d said that the tacit multiplication always was done
-% with increased precedence, but I had not at that time made up my mind for
-% the case of variable(stuff) and pushed to CTAN early because I need to fix
-% the bug I had introduced in 1.2c which itself I had pushed to CTAN early
-% because I had to fix the 1.2 bug with subtraction....
-%
-% Finally I decide to do it indeed. Hence for 1.2e. This only impacts
-% situations such as A/B(stuff), which are thus interpreted as A/(B*(stuff)).
+% And allow usage with both syntaxes |name:=expr;| or |name=expr;|. Also the
+% colon may have catcode 11, 12, or 13 with no issue.
+% \lverb|
+% Variable names may contain letters, digits, underscores, and must not start
+% with a digit. Names starting with @ or an underscore are reserved.
%
-% 1.2p (2017/12/01) extends \xintdefvar for simultaneous assignments to
-% multiple variables.|
+% |
+% \odef\MakePrivateLetters{\xintexprMakePrivateLetters \catcode`* 11 }
% \begin{macrocode}
\catcode`* 11
\def\XINT_expr_defvar_one #1#2%
{%
+ \XINT_global
\expandafter\edef\csname XINT_expr_var_#1\endcsname
{\expandafter\noexpand#2}%
+ \XINT_global
\expandafter\edef\csname XINT_expr_onliteral_#1\endcsname
{\XINT_expr_precedence_*** *\expandafter\noexpand#2(}%
\ifxintverbose\xintMessage{xintexpr}{Info}
- {Variable "#1" defined with value \expandafter\XINT_expr_unlock#2.}%
+ {Variable "#1" \ifxintglobaldefs globally \fi
+ defined with value \expandafter\XINT_expr_unlock#2.}%
\fi
}%
\catcode`* 12
+% \end{macrocode}
+% \let\MakePrivateLetters\xintexprMakePrivateLetters
+% \begin{macrocode}
+\catcode`~\active
+\catcode`: 12
+\def\XINT_expr_defvar_getname #1:#2~{\endgroup
+ \def\XINT_expr_tmpa{#1}\edef\XINT_expr_tmpc{\xintCSVLength{#1}}}%
\def\XINT_expr_defvar #1#2#3;%
{%
+ \xintexprRestoreCatcodes
+% \end{macrocode}
+% \lverb|Maybe SafeCatcodes was without effect because the colon and the rest
+% are from some earlier macro definition. Give a safe definition to active
+% colon (even if in math mode with a math active colon..).|
+% \begin{macrocode}
+ \begingroup\lccode`~`: \lowercase{\let~}\empty
\edef\XINT_expr_tmpa{#2}%
\edef\XINT_expr_tmpa{\xint_zapspaces_o\XINT_expr_tmpa}%
- \edef\XINT_expr_tmpc{\xintCSVLength{\XINT_expr_tmpa}}%
+ \expandafter\XINT_expr_defvar_getname
+ \detokenize\expandafter{\XINT_expr_tmpa}:~%
\ifcase\XINT_expr_tmpc
\xintMessage {xintexpr}{Warning}
{Aborting: impossible to declare variable with empty name.}%
@@ -34800,13 +35394,20 @@ math shift catcode.
\fi
\fi
}%
-\catcode`: 12
-\def\xintdefvar #1:={\XINT_expr_defvar\xintbareeval {#1}}%
-\def\xintdefiivar #1:={\XINT_expr_defvar\xintbareiieval {#1}}%
-\def\xintdeffloatvar #1:={\XINT_expr_defvar\xintbarefloateval {#1}}%
+\catcode`~ 3
\catcode`: 11
% \end{macrocode}
-% \subsection{\csbh{xintunassignvar}}
+% \lverb|This SafeCatcodes is mainly in the hope that semi-colon ending the
+% expression can still be sanitized.|
+% \begin{macrocode}
+\def\xintdefvar {\xintexprSafeCatcodes\xintdefvar_a}%
+\def\xintdefiivar {\xintexprSafeCatcodes\xintdefiivar_a}%
+\def\xintdeffloatvar {\xintexprSafeCatcodes\xintdeffloatvar_a}%
+\def\xintdefvar_a #1={\XINT_expr_defvar\xintbareeval {#1}}%
+\def\xintdefiivar_a #1={\XINT_expr_defvar\xintbareiieval {#1}}%
+\def\xintdeffloatvar_a #1={\XINT_expr_defvar\xintbarefloateval {#1}}%
+% \end{macrocode}
+% \subsection{\csh{xintunassignvar}}
% \lverb|1.2e. Currently not possible to genuinely ``undefine'' a
% variable, all we can do is to let it stand for zero and generate an
% error. The reason is that I chose to use \ifcsname tests in
@@ -34817,17 +35418,17 @@ math shift catcode.
\edef\XINT_expr_tmpa {\xint_zapspaces_o\XINT_expr_tmpa}%
\ifcsname XINT_expr_var_\XINT_expr_tmpa\endcsname
\ifnum\expandafter\xintLength\expandafter{\XINT_expr_tmpa}=\@ne
- \expandafter\XINT_expr_makedummy\XINT_expr_tmpa
- \ifxintverbose\xintMessage {xintexpr}{Info}%
- {Character \XINT_expr_tmpa\space usable as dummy variable (if with catcode letter).}%
- \fi
+ \expandafter\xintnewdummy\XINT_expr_tmpa
\else
+ \XINT_global
\expandafter\edef\csname XINT_expr_var_\XINT_expr_tmpa\endcsname
{\csname .=0\endcsname\noexpand\XINT_expr_undefined {\XINT_expr_tmpa}}%
+ \XINT_global
\expandafter\edef\csname XINT_expr_onliteral_\XINT_expr_tmpa\endcsname
{\csname .=0\endcsname\noexpand\XINT_expr_undefined {\XINT_expr_tmpa}*}%
\ifxintverbose\xintMessage {xintexpr}{Info}
- {Variable \XINT_expr_tmpa\space has been ``unassigned''.}%
+ {Variable \XINT_expr_tmpa\space has been
+ \ifxintglobaldefs globally \fi ``unassigned''.}%
\fi
\fi
\else
@@ -34896,12 +35497,16 @@ math shift catcode.
%
% The tacit multiplication in case of the ``nil'' variable doesn't make much
% sense but we do it anyhow.|
+%
+% \odef\MakePrivateLetters{\xintexprMakePrivateLetters \catcode`* 11 }
% \begin{macrocode}
\catcode`* 11
\def\XINT_expr_makedummy #1%
{%
+ \XINT_global
\expandafter\def\csname XINT_expr_var_#1\endcsname ##1\relax !#1##2%
{##2##1\relax !#1##2}%
+ \XINT_global
\expandafter\def\csname XINT_expr_onliteral_#1\endcsname ##1\relax !#1##2%
{\XINT_expr_precedence_*** *##2(##1\relax !#1##2}%
}%
@@ -34910,7 +35515,8 @@ math shift catcode.
\def\xintnewdummy #1{%
\XINT_expr_makedummy{#1}%
\ifxintverbose\xintMessage {xintexpr}{Info}%
- {Character #1 now usable as dummy variable (if with catcode letter).}%
+ {#1 (with letter catcode) now
+ \ifxintglobaldefs globally \fi usable as dummy variable.}%
\fi
}%
\edef\XINT_expr_var_nil {\expandafter\noexpand\csname .= \endcsname}%
@@ -34918,7 +35524,8 @@ math shift catcode.
{\XINT_expr_precedence_*** *\expandafter\noexpand\csname .= \endcsname (}%
\catcode`* 12
% \end{macrocode}
-% \subsubsection{omit and abort}
+% \let\MakePrivateLetters\xintexprMakePrivateLetters
+% \subsubsection{\csh{omit()} and \csh{abort()}}
% \lverb|& attention à ce & qui est de catcode 14 dans les \lverb
% June 24 and 25, 2014.
%
@@ -34978,6 +35585,8 @@ math shift catcode.
% with higher precedence.
%
% For the record, the ~ has catcode 3 in this code.|
+%
+% \odef\MakePrivateLetters{\xintexprMakePrivateLetters \catcode`* 11 }
% \begin{macrocode}
\catcode`? 3 \catcode`* 11
\def\XINT_expr_var_@ #1~#2{#2#1~#2}%
@@ -34994,6 +35603,9 @@ math shift catcode.
\expandafter\def\csname XINT_expr_onliteral_@4\endcsname #1~#2#3#4#5%
{\XINT_expr_precedence_*** *#5(#1~#2#3#4#5}%
\catcode`* 12
+% \end{macrocode}
+% \let\MakePrivateLetters\xintexprMakePrivateLetters
+% \begin{macrocode}
\def\XINT_expr_func_@@ #1#2#3#4~#5?%
{%
\expandafter#1\expandafter#2\romannumeral0\xintntheltnoexpand
@@ -35060,7 +35672,7 @@ math shift catcode.
}%
\def\XINT_expr_onliteral_seq_e #1#2{\XINT_expr_onliteral_seq_d {#1}{#2)}}%
% \end{macrocode}
-% \subsubsection{\csh{XINT_isbalanced_a} for \csh{XINT_expr_onliteral_seq_a}}
+% \subsubsection{\csh{XINT_isbalanced_a} for \cshnolabel{XINT_expr_onliteral_seq_a}}
% \lverb|Expands to \xint_c_mone in case a closing ) had no opening ( matching
% it, to \@ne if opening ) had no closing ) matching it, to \z@ if expression
% was balanced.|
@@ -35183,7 +35795,7 @@ math shift catcode.
{,#1\expandafter\XINT_expr_seq:_D
\csname.=\the\numexpr \XINT_expr_unlock#3+\xint_c_i\endcsname}%
% \end{macrocode}
-% \subsection{add, mul}
+% \subsection{\csh{add()}, \csh{mul()}}
% \lverb|1.2c uses more directly the \xintiiAdd etc... macros and has
% opxadd/opxmul rather than a single opx. This is less conceptual as I use
% explicitely the associated macro names for +, * but this makes other things
@@ -35240,7 +35852,7 @@ math shift catcode.
\def\XINT_expr_op:_noop\csname.=,#1\endcsname #2#3#4{\XINT_expr_op:_b #3{#4}{#2}#1,}%
\def\XINT_expr_op:_end \csname.=^\endcsname #1#2#3{#3}%
% \end{macrocode}
-% \subsection{subs}
+% \subsection{\csh{subs()}}
% \lverb|Got simpler with 1.2c as now the dummy variable fetches an
% already encapsulated value, which is anyhow the form in which we get
% it.|
@@ -35258,7 +35870,7 @@ math shift catcode.
}%
\def\XINT_expr_subx:_end #1!#2#3{#1}%
% \end{macrocode}
-% \subsection{rseq}
+% \subsection{\csh{rseq()}}
% \localtableofcontents
%
% \lverb|When func_rseq has its turn, initial segment has been scanned by
@@ -35346,7 +35958,7 @@ math shift catcode.
\def\XINT_expr_rseq:_Abort #1!#2#3~#4#5{}%
\def\XINT_expr_rseq:_Break #1!#2#3~#4#5{,#1}%
% \end{macrocode}
-% \subsection{iter}
+% \subsection{\csh{iter()}}
% \localtableofcontents
%
% \lverb|Prior to 1.2g, the iter keyword was what is now called iterr,
@@ -35433,7 +36045,7 @@ math shift catcode.
\def\XINT_expr_iter:_Abort #1!#2#3~#4#5{\XINT_expr:_unlock #4}%
\def\XINT_expr_iter:_Break #1!#2#3~#4#5{#1}%
% \end{macrocode}
-% \subsection{rrseq}
+% \subsection{\csh{rrseq()}}
% \localtableofcontents
%
% \lverb|When func_rrseq has its turn, initial segment has been scanned
@@ -35524,7 +36136,7 @@ math shift catcode.
\if #1!\xint_dothis\XINT_expr_rrseq:_Omit\fi
\xint_orthat{\XINT_expr_rrseq:_Goon #1}}%
% \end{macrocode}
-% \subsection{iterr}
+% \subsection{\csh{iterr()}}
% \localtableofcontents
% \begin{macrocode}
\def\XINT_expr_func_iterr {\XINT_allexpr_iterr \xintbareeval \xintthebareeval }%
@@ -35668,7 +36280,7 @@ math shift catcode.
}%
\def\XINT_xorof:_e ,#1#2^{#1}% allows empty list (then returns 0)
% \end{macrocode}
-% \subsubsection{Generic csv routine}
+% \subsubsection{Generic csv routine (\csh{XINT_oncsv:_a})}
% \lverb|1.1. generic routine. up to the loss of some efficiency, especially
% for Sum:csv and Prod:csv, where \XINTinFloat will be done twice for each
% argument.|
@@ -35797,12 +36409,16 @@ math shift catcode.
}%
\let\XINT:flexpr:two:to:two\XINT:flexpr:two:to:one
% \end{macrocode}
-% \subsection{The num, reduce, preduce, abs, sgn, frac, floor, ceil, sqr, sqrt, sqrtr, float,
-% round, trunc, mod, quo, rem, divmod, gcd, lcm, max, min, \textasciigrave
-% +\textasciigrave, \textasciigrave
-% \texorpdfstring{\protect\lowast}{*}\textasciigrave, ?, !, not, all, any,
-% xor, if, ifsgn, even, odd, first, last, len, reversed, factorial, binomial,
-% and randrange functions}
+% \def\auxiliarymacro#1{ \noexpand\cshn{#1()}}
+% \edef\zzz{The \xintListWithSep{, }{\xintApply\auxiliarymacro
+% {{num}{reduce}{preduce}{abs}{sgn}{frac}{floor}{ceil}{sqr}{sqrt}{sqrtr}{float}
+% {round}{trunc}{mod}{quo}{rem}{divmod}{gcd}{lcm}{max}{min}
+% {`+`}
+% {`*`}
+% {?}{!}{not}{all}{any}{xor}{if}{ifsgn}{ifint}{ifone}{even}{odd}
+% {first}{last}{len}{reversed}{factorial}{binomial}}}
+% and \noexpand\cshn{randrange()} functions}
+% \expandafter\subsection\expandafter{\zzz}
% \begin{macrocode}
\def\XINT_expr_func_num #1#2#3%
{%
@@ -36368,8 +36984,8 @@ math shift catcode.
\let\XINT_flexpr_func_ifsgn\XINT_expr_func_ifsgn
\let\XINT_iiexpr_func_ifsgn\XINT_expr_func_ifsgn
% \end{macrocode}
-% \subsection{f-expandable versions of the \csh{xintSeqB::csv} and alike
-% routines, for \csh{xintNewExpr}}
+% \subsection{f-expandable versions of the \cshnolabel{xintSeqB::csv} and alike
+% routines, for \cshnolabel{xintNewExpr}}
% \localtableofcontents
% \subsubsection{\csh{xintSeqB:f:csv}}
% \lverb|Produces in f-expandable way. If the step is zero, gives empty result
@@ -36478,29 +37094,19 @@ math shift catcode.
% \subsection{User defined functions: \csh{xintdeffunc}, \csh{xintdefiifunc},
% \csh{xintdeffloatfunc}}
%
-% \lverb|1.2c (November 11-12, 2015). It is possible to
-% overload a variable name with a function name (and conversely). The function
-% interpretation with be used only if followed by an opening parenthesis,
-% disabling the tacit multiplication usually applied to variables. Crazy
-% things such as add(f(f), f=1..10) are possible if there is a function "f".
-% Or we can use "e" both for an exponential function and the Euler constant.
-%
-% 2015/11/13: function candidates names first completely expanded, then
-% detokenized and cleaned of spaces.
+% \changed{1.2c}{2015/11/12}
+% \lverb|Note: it is possible to have same name assigned both to a variable
+% and a function: things such as add(f(f), f=1..10) are possible.|
%
-% 2015/11/21: no more \detokenize on the function names. Also I use
-% #1(#2)#3:=#4 rather than #1(#2):=#3. Ah, rather #1(#2)#3=#4, then I don't
-% have to worry about active :.
+% \changed{1.2f}{2016/03/08}
+% \lverb|Comma separated expressions allowed (formerly this required using
+% parenthesis \xintdeffunc foo(x,..):=(.., .., ..);|
%
-% 2016/02/22: 1.2f la macro associée à la fonction ne débute plus par un
-% \romannumeral, de toute façon est pour emploi dans \csname..\endcsname.
+% \changed{1.3c}{2018/06/17}
+% \lverb|Usage of \xintexprSafeCatcodes to be compatible with an active
+% semi-colon at time of use; the colon was not a problem (see ##3) already.|
%
-% 2016/03/08: 1.2f allows comma separated expressions; until then the user had
-% to use explicit parentheses \xintdeffunc foo(x,..):=(.., .., ..)\relax.
-% |
% \begin{macrocode}
-\catcode`: 12
-\catcode`~ 12
\def\XINT_tmpa #1#2#3#4%
{%
\def #1##1(##2)##3=##4;{%
@@ -36521,17 +37127,21 @@ math shift catcode.
\ifxintverbose\xintMessage {xintexpr}{Info}
{Function \XINT_expr_tmpa\space for \string\xint #4 parser
associated to \string\XINT_#2_userfunc_\XINT_expr_tmpa\space
- with meaning \expandafter\meaning
+ with \ifxintglobaldefs global \fi meaning \expandafter\meaning
\csname XINT_#2_userfunc_\XINT_expr_tmpa\endcsname}%
\fi
+ \xintexprRestoreCatcodes
}%
}%
-\catcode`: 11
-\XINT_tmpa\xintdeffunc {expr} \XINT_NewFunc {expr}%
-\XINT_tmpa\xintdefiifunc {iiexpr}\XINT_NewIIFunc {iiexpr}%
-\XINT_tmpa\xintdeffloatfunc{flexpr}\XINT_NewFloatFunc{floatexpr}%
+\def\xintdeffunc {\xintexprSafeCatcodes\xintdeffunc_a}%
+\def\xintdefiifunc {\xintexprSafeCatcodes\xintdefiifunc_a}%
+\def\xintdeffloatfunc {\xintexprSafeCatcodes\xintdeffloatfunc_a}%
+\XINT_tmpa\xintdeffunc_a {expr} \XINT_NewFunc {expr}%
+\XINT_tmpa\xintdefiifunc_a {iiexpr}\XINT_NewIIFunc {iiexpr}%
+\XINT_tmpa\xintdeffloatfunc_a{flexpr}\XINT_NewFloatFunc{floatexpr}%
\def\XINT_expr_defuserfunc #1#2#3%
{%
+ \XINT_global
\def #1##1##2##3{\expandafter ##1\expandafter ##2%
\csname .=\XINT:expr:userfunc{#3}{#2}{\XINT_expr_unlock ##3}\endcsname
}%
@@ -36539,8 +37149,10 @@ math shift catcode.
\def\XINT:expr:userfunc #1#2#3%
{\csname XINT_#1_userfunc_#2\expandafter\endcsname
\romannumeral0\xintcsvtolistnonstripped{#3}}%
+\catcode`~ 12
\def\XINT:newexpr:userfunc #1#2#3%
{~xintExpandArgs{XINT_#1_userfunc_#2}{\xintCSVtoListNonStripped{#3}}}%
+\catcode`~ 3
% \end{macrocode}
% \subsection{\csh{xintNewFunction}}
% \lverb|1.2h (2016/11/20). Syntax is \xintNewFunction{<name>}[nb of
@@ -36548,6 +37160,7 @@ math shift catcode.
% a function for all three parsers but the expression parsing is delayed until
% function execution. Hence the expression admits all constructs, contrarily
% to \xintNewExpr or \xintdeffunc.
+%
% |
% \begin{macrocode}
\def\XINT_expr_wrapit #1{\expandafter\XINT_expr_wrap\csname.=#1\endcsname}%
@@ -36570,8 +37183,8 @@ math shift catcode.
\else \toks0{##1##2##3##4##5##6##7##8##9}%
\fi
\expandafter
- \endgroup
- \expandafter
+ \endgroup\expandafter
+ \XINT_global\expandafter
\def\csname XINT_expr_macrofunc_\XINT_expr_tmpa\expandafter\endcsname
\the\toks0\expandafter{\XINT_expr_tmpb
{\XINT_expr_wrapit{##1}}{\XINT_expr_wrapit{##2}}{\XINT_expr_wrapit{##3}}%
@@ -36590,12 +37203,13 @@ math shift catcode.
\xintMessage {xintexpr}{Info}
{Function \XINT_expr_tmpa\space for the expression parsers is
associated to \string\XINT_expr_macrofunc_\XINT_expr_tmpa\space
- with meaning \expandafter\meaning
+ with \ifxintglobaldefs global \fi meaning \expandafter\meaning
\csname XINT_expr_macrofunc_\XINT_expr_tmpa\endcsname}%
\fi
}%
\def\XINT_expr_newfunction #1#2#3#4%
{%
+ \XINT_global
\def#1##1##2##3{\expandafter ##1\expandafter ##2\romannumeral0%
\XINT:expr:macrofunc{#4}{#3}{#2}{\XINT_expr_unlock##3}}%
}%
@@ -36604,6 +37218,7 @@ math shift catcode.
#1\csname XINT_expr_macrofunc_#3\expandafter\endcsname
\romannumeral0\xintcsvtolistnonstripped{#4}\relax
}%
+\catcode`~ 12
\def\XINT:newexpr:macrofunc #1{%
\def\XINT:newexpr:macrofunc ##1##2##3##4%
{%
@@ -36611,6 +37226,7 @@ math shift catcode.
{\xintCSVtoListNonStripped{##4}}\endcsname
}%
}\XINT:newexpr:macrofunc { }%
+\catcode`~ 3
\def\XINT:newexpr:macrofunc:a #1#2#3%
{%
\expandafter\XINT_expr_unlock\romannumeral0\csname xintbare#1\endcsname
@@ -36947,7 +37563,7 @@ math shift catcode.
\def\xintRound::csv {~xintRound::csv }%
}%
% \end{macrocode}
-% \subsubsection{\csh{xintNewExpr}, ..., at last.}
+% \subsubsection{\cshnolabel{xintNewExpr}, ..., at last.}
% \lverb|&
% 1.2c modifications to accomodate \XINT_expr_deffunc_newexpr etc..
%
@@ -36983,24 +37599,32 @@ math shift catcode.
%
% Up to and including 1.2c the definition was global. Starting with 1.2d it is
% done locally.
+%
+% Modified at 1.3c so that \XINT_NewFunc et. al. do not execute the
+% \xintexprSafeCatcodes, as it is now already done earlier by \xintdeffunc:
+% and as already #2 was either \xint_firstofone (for \xintNewExpr et. al.) or
+% \xint_gobble_i (for \XINT_NewFunc et. al.) we can use that #2. This is only
+% to avoid doing twice the catcodes, as anyhow there is an \endgroup coming
+% later, so external \xintexprRestoreCatcodes would not have been compromised.
+%
% |
% \begin{macrocode}
\def\XINT_NewExpr #1#2#3#4#5#6[#7]%
{%
\begingroup
\ifcase #7\relax
- \toks0 {\endgroup\def#5}%
- \or \toks0 {\endgroup\def#5##1}%
- \or \toks0 {\endgroup\def#5##1##2}%
- \or \toks0 {\endgroup\def#5##1##2##3}%
- \or \toks0 {\endgroup\def#5##1##2##3##4}%
- \or \toks0 {\endgroup\def#5##1##2##3##4##5}%
- \or \toks0 {\endgroup\def#5##1##2##3##4##5##6}%
- \or \toks0 {\endgroup\def#5##1##2##3##4##5##6##7}%
- \or \toks0 {\endgroup\def#5##1##2##3##4##5##6##7##8}%
- \or \toks0 {\endgroup\def#5##1##2##3##4##5##6##7##8##9}%
+ \toks0 {\endgroup\XINT_global\def#5}%
+ \or \toks0 {\endgroup\XINT_global\def#5##1}%
+ \or \toks0 {\endgroup\XINT_global\def#5##1##2}%
+ \or \toks0 {\endgroup\XINT_global\def#5##1##2##3}%
+ \or \toks0 {\endgroup\XINT_global\def#5##1##2##3##4}%
+ \or \toks0 {\endgroup\XINT_global\def#5##1##2##3##4##5}%
+ \or \toks0 {\endgroup\XINT_global\def#5##1##2##3##4##5##6}%
+ \or \toks0 {\endgroup\XINT_global\def#5##1##2##3##4##5##6##7}%
+ \or \toks0 {\endgroup\XINT_global\def#5##1##2##3##4##5##6##7##8}%
+ \or \toks0 {\endgroup\XINT_global\def#5##1##2##3##4##5##6##7##8##9}%
\fi
- \xintexprSafeCatcodes
+ #2\xintexprSafeCatcodes
\XINT_expr_redefinemacros
#1%
\XINT_NewExpr_a #2#3#4#5%
@@ -37009,7 +37633,14 @@ math shift catcode.
% \lverb|& attention que & est de catcode 14
%
% 1.2d's \xintNewExpr makes a local definition. In earlier releases, the
-% definition was global.|
+% definition was global.
+%
+% \the\toks0 inserts the \endgroup, but this will happen
+% after \XINT_tmpa has already been expanded...
+%
+% The %1 is \xint_firstofone for \xintNewExpr, \xint_gobble_i
+% for \xintdeffunc.
+% |
% \begin{macrocode}
\catcode`~ 13 \catcode`@ 14 \catcode`\% 6 \catcode`# 12 \catcode`$ 11 @ $
\def\XINT_NewExpr_a %1%2%3%4%5@
@@ -37030,13 +37661,21 @@ math shift catcode.
{\XINT_tmpa{%%1}{%%2}{%%3}{%%4}{%%5}{%%6}{%%7}{%%8}{%%9}}@
%1{\ifxintverbose
\xintMessage{xintexpr}{Info}@
- {\string%4\space now with meaning \meaning%4}@
+ {\string%4\space now with @
+ \ifxintglobaldefs global \fi meaning \meaning%4}@
\fi}@
}@
\catcode`% 14
+% \end{macrocode}
+% \subsubsection{\csh{ifxintsafecatcodes}, \csh{xintexprSafeCatcodes}, \csh{xintexprRestoreCatcodes}}
+% \changed{1.3c}{2018/06/17}
+% \lverb|Added \ifxintsafecatcodes to allow nesting|
+% \begin{macrocode}
+\newif\ifxintexprsafecatcodes
\let\xintexprRestoreCatcodes\empty
\def\xintexprSafeCatcodes
{%
+ \unless\ifxintexprsafecatcodes
\edef\xintexprRestoreCatcodes {%
\catcode59=\the\catcode59 % ;
\catcode34=\the\catcode34 % "
@@ -37062,7 +37701,10 @@ math shift catcode.
\catcode61=\the\catcode61 % =
\catcode96=\the\catcode96 % `
\catcode32=\the\catcode32\relax % space
+ \noexpand\xintexprsafecatcodesfalse
}%
+ \fi
+ \xintexprsafecatcodestrue
\catcode59=12 % ;
\catcode34=12 % "
\catcode63=12 % ?
@@ -37091,9 +37733,8 @@ math shift catcode.
\let\XINT_tmpa\relax \let\XINT_tmpb\relax \let\XINT_tmpc\relax
\XINT_restorecatcodes_endinput%
% \end{macrocode}
-%
% \StoreCodelineNo {xintexpr}
-%
+% \cleardoublepage\StopPackageIndex\let\xintexprnameUp\undefined
% \MakePercentComment
%</xintexpr>------------------------------------------------------
%<*dtx>-----------------------------------------------------------
@@ -37127,7 +37768,85 @@ xinttools.sty:139
\fi
% grep -o "^}%" xint*sty | wc -l
\def\totalb{ 1674}
+\cleardoublepage
+\makeatletter
+\setlength{\columnsep}{20pt}
+\setlength{\columnseprule}{0.4pt}
+\def\IndexParms{%
+ \parindent \z@
+ \columnsep 15pt % no effect whatsoever
+ \parskip 0pt plus 1pt
+ \rightskip 0pt % 15pt
+ \mathsurround \z@
+ \parfillskip=0pt % -15pt
+ \small
+ \def\@idxitem{\par\hangindent 30pt}%
+ \def\subitem{\@idxitem\hspace*{15pt}}%
+ \def\subsubitem{\@idxitem\hspace*{25pt}}%
+ \def\indexspace{\par\vspace{10pt plus 2pt minus 3pt}}%
+ }
+\makeatother
+\def\zzz{\DOCxintfrontpage,
+ \xintkernelnameind,
+ \xinttoolsnameind,
+ \xintcorenameind,
+ \xintnameind,
+ \xintbinhexnameind,
+ \xintgcdnameind,
+ \xintfracnameind,
+ \xintseriesnameind,
+ \xintcfracnameind, \xintexprnameind, \indexcumulatif}
+\csname xintkernelnameUp\endcsname
+\markboth{\zzz}{\zzz}
+\section{Per package indices of control sequences}
+\RaisedLabel{sec:indices}
+
\DeleteShortVerb{\|}
+
+\xintForpair #1#2 in
+{(xintkernel,kernel),
+ (xinttools,tools),
+ (xintcore,core),(xint,xint),(xintbinhex,binhex),(xintgcd,gcd),%
+ (xintfrac,frac),(xintseries,series),(xintcfrac,cfrac), (xintexpr,expr)}
+\do
+{\csname #1nameUp\endcsname
+\subsection{Index of \csname #1nameimp\endcsname}
+\xintifForFirst{\RaisedLabel[8]}{\RaisedLabel}{sec:#2ind}
+
+\xintifForLast{%
+Particularly for this package, there are quite a few macros which are defined
+via constructs such as \verb|\expandafter\def\csname ...\endcsname|, and their
+indexing needs some extra mark-up which is yet to be added to the commented
+source code.}{}\par
+
+\PrintPackageIndex{#2}
+\cleardoublepage
+\expandafter\let\csname #1nameUp\endcsname\undefined
+}
+
+\csname allnameUp\endcsname
+\section{Cumulative index}
+\RaisedLabel{sec:indexcumulatif}
+
+
+Currently there are some macros which did not make it to the indices because
+they are defined via constructs such as \verb|\expandafter\def\csname
+...\endcsname|, thus their indexing needs some extra mark-up which is yet to
+be added. This is particularly true for some definitions done by
+\xintexprnameimp.
+
+The first indicated page number is the one where the macro is first
+encountered, hence this is most likely also the page where it gets defined (if
+it is not one of those which are only used as delimiters).
+
+\PrintMainIndex
+
+\cleardoublepage
+\let\allnameUp\undefined
+
+\markboth{\xintImpRunningHeader}{\xintImpRunningHeader}
+\section{Cumulative line count}
+
\def\mymacro #1{\mymacroaux #1}
\def\mymacroaux #1#2{\strut \csname #1nameimp\endcsname:& \dtt{ #2.}\tabularnewline }
\indent
@@ -37148,25 +37867,11 @@ xinttools.sty:139
\TeX\strut. Version {\xintbndlversion} of {\xintbndldate}.\par
}
-\CharacterTable
- {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
- Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
- Digits \0\1\2\3\4\5\6\7\8\9
- Exclamation \! Double quote \" Hash (number) \#
- Dollar \$ Percent \% Ampersand \&
- Acute accent \' Left paren \( Right paren \)
- Asterisk \* Plus \+ Comma \,
- Minus \- Point \. Solidus \/
- Colon \: Semicolon \; Less than \<
- Equals \= Greater than \> Question mark \?
- Commercial at \@ Left bracket \[ Backslash \\
- Right bracket \] Circumflex \^ Underscore \_
- Grave accent \` Left brace \{ Vertical bar \|
- Right brace \} Tilde \~}
-\CheckSum {31069}% 30482 pour 1.3a, 30621 pour 1.3, 30988 pour 1.2q,
-% 30982 pour 1.2p
-% 30524 pour 1.2o, 30303 pour 1.2h, 30403 pour 1.2i, 30750 pour 1.2j,
-% 30677 pour 1.2k, 30931 pour 1.2l, 30439 pour 1.2m, 30253 pour 1.2n
-\makeatletter\check@checksum\makeatother
+\CheckSum {31122}% 1.3c
+% 31069 pour 1.3b, 30482 pour 1.3a, 30621 pour 1.3, 30988 pour 1.2q,
+% 30982 pour 1.2p, 30524 pour 1.2o, 30303 pour 1.2h, 30403 pour 1.2i,
+% 30750 pour 1.2j, 30677 pour 1.2k, 30931 pour 1.2l, 30439 pour 1.2m,
+% 30253 pour 1.2n
+\makeatletter\check@checksum
\Finale
%% End of file xint.dtx
diff --git a/Master/texmf-dist/source/generic/xint/xint.ins b/Master/texmf-dist/source/generic/xint/xint.ins
index 9e1667d21da..54ce6d869b6 100644
--- a/Master/texmf-dist/source/generic/xint/xint.ins
+++ b/Master/texmf-dist/source/generic/xint/xint.ins
@@ -21,14 +21,16 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% ---------------------------------------------------------------
-%% The xint bundle 1.3b 2018/05/18
+%% The xint bundle 1.3c 2018/06/17
%% Copyright (C) 2013-2018 by Jean-Francois Burnol
%% ---------------------------------------------------------------
%%
-%% tex xint.ins extracts all package files from xint.dtx, as well as
-%% xint.tex, README.md, CHANGES.md, doPDFs.sh, doHTMLs.sh.
+%% `tex xint.ins' extracts all package files from xint.dtx, as well as
+%% xint.tex, README.md, CHANGES.md, doPDFs.sh, doHTMLs.sh, .latexmkrc
+%% and xint-gind.ist
%%
-%% etex xint.ins does the same plus extracts Makefile.mk.
+%% `etex xint.ins' additionally extracts Makefile.mk, which is needed
+%% for building documentation using `make'.
%%
\input docstrip.tex
\askforoverwritefalse
@@ -39,8 +41,10 @@
\file{doPDFs.sh}{\from{xint.dtx}{dopdfsh}}
\ifx\numexpr\undefined\else\catcode9 11
\file{Makefile.mk}{\from{xint.dtx}{makefile}}\fi
+\file{.latexmkrc}{\from{xint.dtx}{latexmkrc}}
\usepreamble\defaultpreamble
\usepostamble\defaultpostamble
+\file{xint-gind.ist}{\from{xint.dtx}{gind}}
\file{pandoctpl.latex}{\from{xint.dtx}{pandoctpl}}
\file{xint.tex}{\from{xint.dtx}{drv}}
\file{xintkernel.sty}{\from{xint.dtx}{xintkernel}}
@@ -55,7 +59,7 @@
\file{xintexpr.sty}{\from{xint.dtx}{xintexpr}}}
\catcode32=13\relax% active space
\let =\space%
-\Msg{************************************************************************}
+\Msg{********************************************************************}
\Msg{*}
\Msg{* To finish the installation you have to move the following}
\Msg{* files into a directory searched by TeX:}
@@ -71,15 +75,17 @@
\Msg{* xintexpr.sty}
\Msg{* xinttools.sty}
\Msg{*}
-\Msg{* To produce the documentation run latex thrice on xint.tex}
-\Msg{* then dvipdfmx on xint.dvi. Edit xint.tex to get the code}
-\Msg{* source included.}
-\Msg{* dvipdfmx warnings may be ignored, but if the produced pdf}
-\Msg{* has font problems, run rather pdflatex on xint.tex}
+\Msg{* To produce the user manual run latex thrice on xint.tex}
+\Msg{* then dvipdfmx on xint.dvi, or if your system allows,}
+\Msg{* execute `make xint.pdf' (this requires Latexmk).}
+\Msg{*}
+\Msg{* The commented source code is generated from executing}
+\Msg{* `make sourcexint.pdf' (this requires Latexmk; if not}
+\Msg{* available check the details in Makefile.mk and .latexmkrc)}
\Msg{*}
\Msg{* Happy TeXing!}
\Msg{*}
-\Msg{************************************************************************}
+\Msg{********************************************************************}
\endbatchfile
\endinput
%%