summaryrefslogtreecommitdiff
path: root/macros/generic
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-12 03:00:40 +0000
committerNorbert Preining <norbert@preining.info>2019-09-12 03:00:40 +0000
commitd88288e917a384a8061582a46f0b20090819bb82 (patch)
tree5df3fea66aee1e2787f2e6910b803ebe0aa310c0 /macros/generic
parentef86cc7c003cc95a612e75aea0f78e21db9699fb (diff)
CTAN sync 201909120300
Diffstat (limited to 'macros/generic')
-rw-r--r--macros/generic/poormanlog/README153
-rw-r--r--macros/generic/poormanlog/poormanlog.sty4
-rw-r--r--macros/generic/poormanlog/poormanlog.tex142
-rw-r--r--macros/generic/xint/CHANGES.html202
-rw-r--r--macros/generic/xint/CHANGES.pdfbin104210 -> 105478 bytes
-rw-r--r--macros/generic/xint/README4
-rw-r--r--macros/generic/xint/README.html10
-rw-r--r--macros/generic/xint/README.pdfbin32957 -> 32975 bytes
-rw-r--r--macros/generic/xint/sourcexint.pdfbin919178 -> 929151 bytes
-rw-r--r--macros/generic/xint/xint.dtx1099
-rw-r--r--macros/generic/xint/xint.pdfbin987296 -> 993327 bytes
11 files changed, 898 insertions, 716 deletions
diff --git a/macros/generic/poormanlog/README b/macros/generic/poormanlog/README
index fc5f096fdc..cb250c4adf 100644
--- a/macros/generic/poormanlog/README
+++ b/macros/generic/poormanlog/README
@@ -1,126 +1,77 @@
-DOCUMENTATION OF POORMANLOG (v0.04, 2019/02/17)
-===========================
+POORMANLOG (v0.05, 2019/04/22)
+==============================
-(see License at bottom of this file)
+poormanlog.tex provides (expandable) macros \PMLogZ and \PMPowTen
+for computing base 10 logarithms and powers of 10 with a bit less
+than 9 digits of precision.
-The poormanlog.tex file has no dependencies. It provides (expandable)
-macros for base 10 logarithms and powers of 10 with a bit less than 9
-digits of precision (\PMLogZ and \PMPowTen), but its main use will be
-in conjunction with xintexpr.sty, as it provides to the latter
-functions log10() and pow10() and does on-demand modification of the
-power operators ** or ^ to compute according to pow10(y*log10(x)).
+It can be used with TeX (\input poormanlog) and has a LaTeX interface
+(\usepackage{poormanlog}).
-This usage will become obsolete when xintexpr will natively implement
-in arbitrary precision the log10() and pow10() functions.
+Regarding TeX, it requires the e-TeX \numexpr primitive, thus etex
+or pdftex or other binaries with the e-TeX extensions are required.
-The file can be used with Plain TeX (\input poormanlog) or as a
-regular LaTeX package.
+Changes
+-------
-Example (with Plain TeX)
-------------------------
-
- \input xintexpr.sty
- \input poormanlog.tex
-
- \xinteval{log10(3.14159265), pow10(2.71828183)}
-
- \poormanloghack{**}
-
- \xinteval{3.14159265**2.71828183}
-
- \poormanloghack{^}
-
- \xinteval{3.14159265^2.71828183}
-
- \bye
-
-
-User interface
---------------
-
-\PMLogZ{#1} expands in two steps.
-
-input: #1 is a mantissa ddddddddd (it may be an f-expandable macro)
- with exactly 9 digits (the first one must not be zero)
-output: 9 digits xxxxxxxxx such that log10(d.dddddddd) is about 0.xxxxxxxxx
-
-It seems from testing that absolute error is not much more than 1 unit in
-the last place, and result differs from rounded mathematical value by at
-most 1 unit in the 9th digit. (attention not rigorously proven).
-
-\PMPowTen{#1} expands in two steps.
-
-input: #1 is (or expands to) exactly 9 digits ddddddddd representing
- 0.ddddddddd
-output: 9 digits xxxxxxxxx, first one not zero,
- such that 10^0.ddddddddd is about x.xxxxxxxx
-
-It seems from testing that absolute error is less than 2 units in
-the last place, and result differs from rounded mathematical value by at
-most 2 units in the 9th digit. (attention not rigorously proven).
-
-\PoorManLogBaseTen{#1}
-
- in presence of xintfrac this will accept input as recognized by xintfrac
- and produce the logarithm in base 10 with an error (believed to be at
- most) about 1 unit in the 9th (i.e. last) fractional digit.
-
- xintfrac may be loaded before or after.
-
-\PoorManPowerOfTen{#1}
-
- in presence of package xintfrac this will accept input as recognized by
- xintfrac and produce the 10^#1 with 9 digits of float precision, with an
- error (believed to be) at most 2 units in the last place. Of course for
- this the input must be precise enough to have 9 fractional digits of
- **fixed point** precision.
+- v0.04 (2019/02/17): initial release. The package has no
+ dependencies and alongside two macros \PMLogZ and \PMPowTen
+ also provides some specific additions to xint.
- xintfrac may be loaded before or after.
+- v0.05 (2019/04/22): the additions/patches to xint originally
+ provided by poormanlog.tex got moved into xint 1.3f itself.
-\PoorManPower{#1}{#2}
+ Thus, poormanlog now reduces to the sole two macros
+ \PMLogZ and \PMPowTen. It can be imported by other macro
+ files with no danger of conflicting with future releases of
+ xint in case of concurrent usage.
- in presence of package xintfrac computes #1 to the power #2
- xintfrac may be loaded before or after.
+Files
+-----
-log10()
+poormanlog.tex
+poormanlog.sty
+README
- the log10() function is made available, if xintexpr.sty is loaded, for
- usage within \xinteval and \xintfloateval. If a log10() function is
- already defined in xintexpr it will not be overwritten
- xintexpr may be loaded before or after.
+\PMLogZ{#1} computes base-10 logarithms:
+----------------------------------------
-pow10()
+expansion: the argument is submitted to f-expansion and the macro
+ itself expands fully in two steps.
- pow10() function is made available, if xintexpr.sty is loaded, for usage
- within \xinteval and \xintfloateval. If a pow10() function is already
- defined in xintexpr it will not be overwritten
+input: #1 must be (or f-expands to) a mantissa ddddddddd with exactly
+ 9 digits, standing for D = d.dddddddd, 1 <= D < 10
- xintexpr may be loaded before or after.
+output: 9 digits xxxxxxxxx standing for X = 0.xxxxxxxxx such that
+ log10(D) is about X
-modification of ** or ^ operators in \xintexpr and \xintfloatexpr
+precision: It seems from testing that absolute error is not much
+ more than 1 unit in the last place, and result X differs
+ from rounded mathematical value of log10(D) by at most
+ 1 unit in the last place.
+ (*attention estimate not rigorously proven*).
- \poormanloghack{**}
- \poormanloghack{^}
- They will now use pow10(y*log10(x)) formula to compute x to the power y
+\PMPowTen{#1} computes fractional powers of 10:
+-----------------------------------------------
- Of course this means drop of precision, but allows non-integer exponents.
- (half-integer exponents are already accepted in \xintfloatexpr natively).
+expansion: the argument is submitted to f-expansion and the macro
+ itself expands fully in two steps.
- ** xintexpr must have been loaded before **
+input: #1 must be (f-expands to) exactly 9 digits xxxxxxxxx, standing
+ for X = 0.xxxxxxxxx
-Example with LaTeX :
+output: 9 digits ddddddddd, such that D = d.dddddddd is about 10^X
+ The first digit of output is never zero (i.e. 1 <= D < 10)
- \documentclass{article}
- \usepackage{xintexpr}
- \usepackage{poormanlog}% makes log10() and pow10() available
- \poormanloghack{**} % modifies ** operator
- \begin{document}
- \xinteval{3.14159265**2.71828183, log10(3.14159265), pow10(2.71828)}
- \end{document}
+precision: It seems from testing that absolute error is less than
+ 2 units in the last place, and result D differs from
+ rounded mathematical value of 10^X by at most 2 units in
+ the last place.
+ (*attention estimate not rigorously proven*).
LICENSE
@@ -141,5 +92,5 @@ This Work has the LPPL maintenance status `author-maintained'.
The Author of this Work is Jean-Francois Burnol.
-This Work consists of files poormanlog.tex, poormanlog.sty and the
+This Work consists of files poormanlog.tex, poormanlog.sty and this
README.
diff --git a/macros/generic/poormanlog/poormanlog.sty b/macros/generic/poormanlog/poormanlog.sty
index c740360e98..e164999faa 100644
--- a/macros/generic/poormanlog/poormanlog.sty
+++ b/macros/generic/poormanlog/poormanlog.sty
@@ -1,4 +1,4 @@
-%% poormanlog.sty v0.04, 2019/02/17
+%% poormanlog.sty v0.05, 2019/04/22
%%
%% Copyright (C) 2019, Jean-Francois Burnol
%%
@@ -12,6 +12,6 @@
%% This Work consists of files poormanlog.tex, poormanlog.sty and
%% the accompanying README
%%
-\ProvidesPackage{poormanlog}[2019/02/17 v0.04 log and powers with 9 digits (JFB)]
+\ProvidesPackage{poormanlog}[2019/04/22 v0.05 base 10 log and pow with 9 digits (JFB)]
\input{poormanlog.tex}% see README file for user documentation
\endinput
diff --git a/macros/generic/poormanlog/poormanlog.tex b/macros/generic/poormanlog/poormanlog.tex
index e29c208901..f1faa66547 100644
--- a/macros/generic/poormanlog/poormanlog.tex
+++ b/macros/generic/poormanlog/poormanlog.tex
@@ -1,4 +1,4 @@
-%% poormanlog.tex v0.04, 2019/02/17
+%% poormanlog.tex v0.05, 2019/04/22
%%
%% Copyright (C) 2019, Jean-Francois Burnol
%%
@@ -12,11 +12,6 @@
%% This Work consists of files poormanlog.tex, poormanlog.sty and the
%% README
%%
-%% ************ BARELY TESTED ****************
-%% >>>>>>> WARNING FOR LACK OF TIME I HAVE NOT YET VALIDATED FULLY <<<<<
-%% >>>>>>> NOR HAVE I MADE PRECISE ESTIMATES. USE AT YOUR OWN RISK <<<<<
-%% (bug reports welcome)
-%% ************ BARELY TESTED ****************
%
% Package macro private prefix: \PML@
%
@@ -35,7 +30,7 @@
\catcode`\noexpand\^ \the\catcode`\^ %
\catcode`\noexpand\: \the\catcode`\: %
\catcode`\noexpand\* \the\catcode`\* %
- \catcode`\noexpand\@ \the\catcode`\@ %
+ \catcode`\noexpand\@ \the\catcode`\@\relax
}%
\catcode`\@ 11 %
\if1\ifx\@namedef\JFBUundefined1\else\ifx\@namedef\relax1\else0\fi\fi
@@ -284,138 +279,5 @@
\the\numexpr1000000000+\expandafter\PML@\romannumeral-`0#1.\relax
}%
\def\PMPowTen#1{\the\numexpr\expandafter\PML@Pa\romannumeral-`0#1.\relax}%
-%%
-%%
-%% ADD-ONS TO XINTFRAC : \PoorManLogBaseTen{#1}, \PoorManPowerOfTen{#1}
-%% and \PoorManPower{#1}{#2}
-%% Does not matter if xintfrac loaded before or after.
-%%
-\def\PoorManLogBaseTen{\romannumeral0\poormanlogbaseten}%
-\def\poormanlogbaseten #1%
- {\expandafter\PML@logbaseten\romannumeral0\XINTinfloat[9]{#1}}%
-\def\PML@logbaseten#1[#2]%
-{%
- \xintiiadd{\xintDSx{-9}{\the\numexpr#2+8\relax}}{\the\numexpr\PML@#1.}%
- [-9]%
-}%
-%
-\def\PoorManPowerOfTen{\the\numexpr\poormanpoweroften}%
-\def\poormanpoweroften #1%
- {\expandafter\PML@powoften\romannumeral0\xintraw{#1}}%
-\catcode`\_ 11 %
-\def\PML@powoften#1{%
- \xint_UDzerominusfork
- #1-\PML@powoften@zero
- 0#1\PML@powoften@neg
- 0-\PML@powoften@pos
- \krof #1%
-}%
-\catcode`\_ 8 %
-\def\PML@powoften@zero 0{1\relax}%/1[0]
-\def\PML@powoften@pos#1[#2]{%
- \expandafter\PML@powoften@pos@a\romannumeral0\xintround{9}{#1[#2]}.%
-}%
-\def\PML@powoften@pos@a#1.#2.{\PML@Pa#2.\expandafter[\the\numexpr-8+#1]}%
-\def\PML@powoften@neg#1[#2]{%
- \expandafter\PML@powoften@neg@a\romannumeral0\xintround{9}{#1[#2]}.%
-}%
-\def\PML@powoften@neg@a#1.#2.{\ifnum#2=0 \xint_afterfi{1\relax/1[#1]}\else
- \expandafter\expandafter\expandafter
- \PML@Pa\expandafter\@gobble\the\numexpr2000000000-#2.%
- \expandafter[\the\numexpr-9+#1\expandafter]\fi
-}%
-%
-\def\PoorManPower#1#2% #1**#2
-{%
- \PoorManPowerOfTen{\xintMul{#2}{\PoorManLogBaseTen{#1}}}%
-}%
-%%
-%% ADD-ONS TO XINTEXPR :
-%%
-%% log10(), pow10()
-%%
-%% Does not matter if xintexpr loaded before or after.
-%%
-\catcode`\_ 11 \catcode`\: 11 %
-\unless\ifcsname XINT_expr_func_log10\endcsname
-\@namedef{XINT_expr_func_log10}#1#2#3%
-{%
- \expandafter #1\expandafter #2\csname.=%
- \XINT:NEhook:one\PoorManLogBaseTen{\XINT_expr_unlock #3}\endcsname
-}%
-\fi
-\unless\ifcsname XINT_flexpr_func_log10\endcsname
-\expandafter\let\csname XINT_flexpr_func_log10\expandafter\endcsname
- \csname XINT_expr_func_log10\endcsname
-\fi
-%
-\unless\ifcsname XINT_expr_func_pow10\endcsname
-\@namedef{XINT_expr_func_pow10}#1#2#3%
-{%
- \expandafter #1\expandafter #2\csname.=%
- \XINT:NEhook:one\PoorManPowerOfTen{\XINT_expr_unlock #3}\endcsname
-}%
-\fi
-\unless\ifcsname XINT_flexpr_func_pow10\endcsname
-\expandafter\let\csname XINT_flexpr_func_pow10\expandafter\endcsname
- \csname XINT_expr_func_pow10\endcsname
-\fi
-%%
-%% On-demand modification of ** or ^ operators in \xintexpr and \xintfloatexpr
-%%
-\catcode`\* 11 \catcode0 12 %
-%
-\def\poormanloghack**{%
-\def\XINT_expr_op_** ##1%
-{%
- \expandafter \XINT_expr_until_**_a
- \expandafter ##1\romannumeral`^^@\expandafter\XINT_expr_getnext
-}%
-\def\XINT_expr_until_**_a ##1{%
-\def\XINT_expr_until_**_a ####1####2%
-{%
- \xint_UDsignfork
- ####2{\expandafter \XINT_expr_until_**_a \expandafter ##1%
- \romannumeral`^^@##1}%
- -{\XINT_expr_until_**_b ####1####2}%
- \krof
-}}\expandafter\XINT_expr_until_**_a\csname XINT_expr_op_-ix\endcsname
-\def\XINT_expr_until_**_b ##1##2##3##4%
-{%
- \ifnum ##2>\XINT_expr_precedence_**
- \xint_afterfi
- {\expandafter \XINT_expr_until_**_a \expandafter ##1%
- \romannumeral`^^@\csname XINT_expr_op_##3\endcsname {##4}}%
- \else
- \xint_afterfi
- {\expandafter ##2\expandafter ##3%
- \csname .=\XINT:NEhook:two
- \PoorManPower{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname
- }%
- \fi
-}%
-\let\XINT_flexpr_op_** \XINT_expr_op_**
-\let\XINT_flexpr_until_**_a\XINT_expr_until_**_a
-\let\XINT_flexpr_until_**_b\XINT_expr_until_**_b
-}%
-\catcode`\^ 11 \catcode`\* 7 %
-\def\poormanloghack^{%
-\def\XINT_expr_until_^_b ##1##2##3##4%
-{%
- \ifnum ##2>\XINT_expr_precedence_^
- \xint_afterfi
- {\expandafter \XINT_expr_until_^_a \expandafter ##1%
- \romannumeral`**@\csname XINT_expr_op_##3\endcsname {##4}}%
- \else
- \xint_afterfi
- {\expandafter ##2\expandafter ##3%
- \csname .=\XINT:NEhook:two
- \PoorManPower{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname
- }%
- \fi
-}%
-\let\XINT_flexpr_until_^_b\XINT_expr_until_^_b
-}%
\@tempa
-\def\poormanloghack#1{\csname poormanloghack#1\endcsname}%
\endinput
diff --git a/macros/generic/xint/CHANGES.html b/macros/generic/xint/CHANGES.html
index 5eddbff512..cf755b8ddb 100644
--- a/macros/generic/xint/CHANGES.html
+++ b/macros/generic/xint/CHANGES.html
@@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
- <meta name="author" content="xint 1.3e" />
+ <meta name="author" content="xint 1.3f" />
<title>CHANGE LOG</title>
<style type="text/css">
code{white-space: pre-wrap;}
@@ -25,45 +25,49 @@
<body>
<header>
<h1 class="title">CHANGE LOG</h1>
-<p class="author">xint 1.3e</p>
-<p class="date">2019/04/05</p>
+<p class="author">xint 1.3f</p>
+<p class="date">2019/09/10</p>
</header>
<nav id="TOC">
<ul>
-<li><a href="#e-20190405"><code>1.3e (2019/04/05)</code></a><ul>
-<li><a href="#incompatible-changes">Incompatible changes</a></li>
+<li><a href="#f-20190910"><code>1.3f (2019/09/10)</code></a><ul>
<li><a href="#improvements-and-new-features">Improvements and new features</a></li>
<li><a href="#bug-fixes">Bug fixes</a></li>
</ul></li>
-<li><a href="#d-20190106"><code>1.3d (2019/01/06)</code></a><ul>
-<li><a href="#incompatible-changes-1">Incompatible changes</a></li>
+<li><a href="#e-20190405"><code>1.3e (2019/04/05)</code></a><ul>
+<li><a href="#incompatible-changes">Incompatible changes</a></li>
<li><a href="#improvements-and-new-features-1">Improvements and new features</a></li>
<li><a href="#bug-fixes-1">Bug fixes</a></li>
</ul></li>
-<li><a href="#c-20180617"><code>1.3c (2018/06/17)</code></a><ul>
+<li><a href="#d-20190106"><code>1.3d (2019/01/06)</code></a><ul>
+<li><a href="#incompatible-changes-1">Incompatible changes</a></li>
<li><a href="#improvements-and-new-features-2">Improvements and new features</a></li>
<li><a href="#bug-fixes-2">Bug fixes</a></li>
</ul></li>
-<li><a href="#b-20180518"><code>1.3b (2018/05/18)</code></a><ul>
+<li><a href="#c-20180617"><code>1.3c (2018/06/17)</code></a><ul>
<li><a href="#improvements-and-new-features-3">Improvements and new features</a></li>
+<li><a href="#bug-fixes-3">Bug fixes</a></li>
+</ul></li>
+<li><a href="#b-20180518"><code>1.3b (2018/05/18)</code></a><ul>
+<li><a href="#improvements-and-new-features-4">Improvements and new features</a></li>
</ul></li>
<li><a href="#a-20180307"><code>1.3a (2018/03/07)</code></a><ul>
<li><a href="#removed">Removed</a></li>
-<li><a href="#improvements-and-new-features-4">Improvements and new features</a></li>
-<li><a href="#bug-fixes-3">Bug fixes</a></li>
+<li><a href="#improvements-and-new-features-5">Improvements and new features</a></li>
+<li><a href="#bug-fixes-4">Bug fixes</a></li>
</ul></li>
<li><a href="#section"><code>1.3 (2018/03/01)</code></a><ul>
<li><a href="#incompatible-changes-2">Incompatible changes</a></li>
-<li><a href="#improvements-and-new-features-5">Improvements and new features</a></li>
+<li><a href="#improvements-and-new-features-6">Improvements and new features</a></li>
</ul></li>
<li><a href="#q-20180206"><code>1.2q (2018/02/06)</code></a><ul>
-<li><a href="#improvements-and-new-features-6">Improvements and new features</a></li>
-<li><a href="#bug-fixes-4">Bug fixes</a></li>
+<li><a href="#improvements-and-new-features-7">Improvements and new features</a></li>
+<li><a href="#bug-fixes-5">Bug fixes</a></li>
</ul></li>
<li><a href="#p-20171205"><code>1.2p (2017/12/05)</code></a><ul>
<li><a href="#incompatible-changes-3">Incompatible changes</a></li>
-<li><a href="#improvements-and-new-features-7">Improvements and new features</a></li>
-<li><a href="#bug-fixes-5">Bug fixes</a></li>
+<li><a href="#improvements-and-new-features-8">Improvements and new features</a></li>
+<li><a href="#bug-fixes-6">Bug fixes</a></li>
</ul></li>
<li><a href="#o-20170829"><code>1.2o (2017/08/29)</code></a><ul>
<li><a href="#incompatible-changes-4">Incompatible changes</a></li>
@@ -71,68 +75,68 @@
</ul></li>
<li><a href="#n-20170806"><code>1.2n (2017/08/06)</code></a><ul>
<li><a href="#incompatible-changes-5">Incompatible changes</a></li>
-<li><a href="#improvements-and-new-features-8">Improvements and new features</a></li>
+<li><a href="#improvements-and-new-features-9">Improvements and new features</a></li>
</ul></li>
<li><a href="#m-20170731"><code>1.2m (2017/07/31)</code></a><ul>
<li><a href="#incompatible-changes-6">Incompatible changes</a></li>
-<li><a href="#improvements-and-new-features-9">Improvements and new features</a></li>
-<li><a href="#bug-fixes-6">Bug fixes</a></li>
-</ul></li>
-<li><a href="#l-20170726"><code>1.2l (2017/07/26)</code></a><ul>
-<li><a href="#removed-1">Removed</a></li>
<li><a href="#improvements-and-new-features-10">Improvements and new features</a></li>
<li><a href="#bug-fixes-7">Bug fixes</a></li>
</ul></li>
-<li><a href="#k-20170106"><code>1.2k (2017/01/06)</code></a><ul>
-<li><a href="#incompatible-changes-7">Incompatible changes</a></li>
+<li><a href="#l-20170726"><code>1.2l (2017/07/26)</code></a><ul>
+<li><a href="#removed-1">Removed</a></li>
<li><a href="#improvements-and-new-features-11">Improvements and new features</a></li>
<li><a href="#bug-fixes-8">Bug fixes</a></li>
</ul></li>
-<li><a href="#j-20161222"><code>1.2j (2016/12/22)</code></a><ul>
+<li><a href="#k-20170106"><code>1.2k (2017/01/06)</code></a><ul>
+<li><a href="#incompatible-changes-7">Incompatible changes</a></li>
<li><a href="#improvements-and-new-features-12">Improvements and new features</a></li>
<li><a href="#bug-fixes-9">Bug fixes</a></li>
</ul></li>
-<li><a href="#i-20161213"><code>1.2i (2016/12/13)</code></a><ul>
-<li><a href="#incompatible-changes-8">Incompatible changes</a></li>
-<li><a href="#removed-2">Removed</a></li>
+<li><a href="#j-20161222"><code>1.2j (2016/12/22)</code></a><ul>
<li><a href="#improvements-and-new-features-13">Improvements and new features</a></li>
<li><a href="#bug-fixes-10">Bug fixes</a></li>
</ul></li>
-<li><a href="#h-20161120"><code>1.2h (2016/11/20)</code></a><ul>
+<li><a href="#i-20161213"><code>1.2i (2016/12/13)</code></a><ul>
+<li><a href="#incompatible-changes-8">Incompatible changes</a></li>
+<li><a href="#removed-2">Removed</a></li>
<li><a href="#improvements-and-new-features-14">Improvements and new features</a></li>
<li><a href="#bug-fixes-11">Bug fixes</a></li>
</ul></li>
+<li><a href="#h-20161120"><code>1.2h (2016/11/20)</code></a><ul>
+<li><a href="#improvements-and-new-features-15">Improvements and new features</a></li>
+<li><a href="#bug-fixes-12">Bug fixes</a></li>
+</ul></li>
<li><a href="#g-20160319"><code>1.2g (2016/03/19)</code></a><ul>
<li><a href="#incompatible-changes-9">Incompatible changes</a></li>
-<li><a href="#improvements-and-new-features-15">Improvements and new features</a></li>
+<li><a href="#improvements-and-new-features-16">Improvements and new features</a></li>
</ul></li>
<li><a href="#f-20160312"><code>1.2f (2016/03/12)</code></a><ul>
<li><a href="#incompatible-changes-10">Incompatible changes</a></li>
-<li><a href="#improvements-and-new-features-16">Improvements and new features</a></li>
-<li><a href="#bug-fixes-12">Bug fixes</a></li>
-</ul></li>
-<li><a href="#e-20151122"><code>1.2e (2015/11/22)</code></a><ul>
<li><a href="#improvements-and-new-features-17">Improvements and new features</a></li>
<li><a href="#bug-fixes-13">Bug fixes</a></li>
</ul></li>
-<li><a href="#d-20151118"><code>1.2d (2015/11/18)</code></a><ul>
+<li><a href="#e-20151122"><code>1.2e (2015/11/22)</code></a><ul>
<li><a href="#improvements-and-new-features-18">Improvements and new features</a></li>
<li><a href="#bug-fixes-14">Bug fixes</a></li>
</ul></li>
-<li><a href="#c-20151116"><code>1.2c (2015/11/16)</code></a><ul>
+<li><a href="#d-20151118"><code>1.2d (2015/11/18)</code></a><ul>
<li><a href="#improvements-and-new-features-19">Improvements and new features</a></li>
<li><a href="#bug-fixes-15">Bug fixes</a></li>
</ul></li>
-<li><a href="#b-20151029"><code>1.2b (2015/10/29)</code></a><ul>
+<li><a href="#c-20151116"><code>1.2c (2015/11/16)</code></a><ul>
+<li><a href="#improvements-and-new-features-20">Improvements and new features</a></li>
<li><a href="#bug-fixes-16">Bug fixes</a></li>
</ul></li>
-<li><a href="#a-20151019"><code>1.2a (2015/10/19)</code></a><ul>
-<li><a href="#improvements-and-new-features-20">Improvements and new features</a></li>
+<li><a href="#b-20151029"><code>1.2b (2015/10/29)</code></a><ul>
<li><a href="#bug-fixes-17">Bug fixes</a></li>
</ul></li>
+<li><a href="#a-20151019"><code>1.2a (2015/10/19)</code></a><ul>
+<li><a href="#improvements-and-new-features-21">Improvements and new features</a></li>
+<li><a href="#bug-fixes-18">Bug fixes</a></li>
+</ul></li>
<li><a href="#section-1"><code>1.2 (2015/10/10)</code></a><ul>
<li><a href="#removed-3">Removed</a></li>
-<li><a href="#improvements-and-new-features-21">Improvements and new features</a></li>
+<li><a href="#improvements-and-new-features-22">Improvements and new features</a></li>
</ul></li>
<li><a href="#c-20150912"><code>1.1c (2015/09/12)</code></a></li>
<li><a href="#b-20150831"><code>1.1b (2015/08/31)</code></a></li>
@@ -141,8 +145,8 @@
<li><a href="#incompatible-changes-11">Incompatible changes</a></li>
<li><a href="#removed-4">Removed</a></li>
<li><a href="#deprecated-1">Deprecated</a></li>
-<li><a href="#improvements-and-new-features-22">Improvements and new features</a></li>
-<li><a href="#bug-fixes-18">Bug fixes</a></li>
+<li><a href="#improvements-and-new-features-23">Improvements and new features</a></li>
+<li><a href="#bug-fixes-19">Bug fixes</a></li>
</ul></li>
<li><a href="#n-20140401"><code>1.09n (2014/04/01)</code></a></li>
<li><a href="#m-20140226"><code>1.09m (2014/02/26)</code></a></li>
@@ -170,26 +174,40 @@
<li><a href="#section-9"><code>1.0 (2013/03/28)</code></a></li>
</ul>
</nav>
-<pre><code>Source: xint.dtx 1.3e 2019/04/05 (doc 2019/04/05)
+<pre><code>Source: xint.dtx 1.3f 2019/09/10 (doc 2019/09/10)
Author: Jean-Francois Burnol
Info: Expandable operations on big integers, decimals, fractions
-License: LPPL 1.3e</code></pre>
+License: LPPL 1.3f</code></pre>
+<h2 id="f-20190910"><code>1.3f (2019/09/10)</code></h2>
+<h3 id="improvements-and-new-features">Improvements and new features</h3>
+<ul>
+<li><p><strong>xintfrac</strong>: <code>\xintDigits = P;</code> syntax (i.e. without a colon) is now accepted in addition to <code>\xintDigits := P;</code>.</p>
+<p>Document that the ending semi-colon can not be an active character and that it has always been allowed to use in its place a non-expanding token e.g. <code>\xintDigits := 32\relax</code>.</p>
+<p>Add <code>\xintSetDigits</code>.</p></li>
+<li><p><strong>xintexpr</strong>: add starred variants <code>\xintDigits*</code> and <code>\xintSetDigits*</code> which execute <code>\xintreloadxinttrig</code>.</p>
+<p>Revert 1.3e ban on usage of <code>\xinteval</code> et al. inside expressions by <code>\xintdeffunc</code>. And make them usable also inside macro definitions via <code>\xintNewExpr</code>.</p></li>
+</ul>
+<h3 id="bug-fixes">Bug fixes</h3>
+<ul>
+<li><p><strong>xintexpr</strong>: fix bug preventing usage of <code>\xintdefefunc</code> to define a function without variables.</p>
+<p>Fix some issue with <code>\xintfloatexpr[D]..\relax</code> if used inside an expression parsed by <code>\xintdeffunc</code> et al.</p></li>
+</ul>
<h2 id="e-20190405"><code>1.3e (2019/04/05)</code></h2>
<h3 id="incompatible-changes">Incompatible changes</h3>
<ul>
-<li>When defining functions, sub-expressions can only use the <code>\xint(float)expr...\relax</code> syntax. One can <em>not</em> use there the <code>\xint(float)eval</code> wrappers (anyhow they add overhead and can be replaced with the lower level syntax).</li>
+<li>(<em>reverted at 1.3f</em>) When defining functions, sub-expressions can only use the <code>\xint(float)expr...\relax</code> syntax. One can not use there the <code>\xint(float)eval</code> wrappers.</li>
</ul>
-<h3 id="improvements-and-new-features">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-1">Improvements and new features</h3>
<ul>
-<li>The <strong>xinttrig</strong> library is automatically loaded by <strong>xintexpr</strong>. It provides direct and inverse trigonometrical functions using either degrees or radians with a precision of up to (a bit less than) 60 digits. It is for the most part implemented using high level user interface, but will probably get some optimizations in future (and perhaps extension to more digits).</li>
-<li>The <strong>xintlog</strong> library is automatically loaded by <strong>xintexpr</strong>. It uses <a href="http://ctan.org/pkg/poormanlog">poormanlog</a> to provide logarithms and exponentials with almost 9 digits of precision. Extended precision is for a future release.</li>
+<li><p>The <strong>xinttrig</strong> library is automatically loaded by <strong>xintexpr</strong>. It provides direct and inverse trigonometrical functions using either degrees or radians with a precision of up to (a bit less than) 60 digits. It is for the most part implemented using high level user interface, but will probably get some optimizations in future (and perhaps extension to more digits).</p></li>
+<li><p>The <strong>xintlog</strong> library is automatically loaded by <strong>xintexpr</strong>. It uses <a href="http://ctan.org/pkg/poormanlog">poormanlog</a> to provide logarithms and exponentials with almost 9 digits of precision. Extended precision is for a future release.</p></li>
<li><p><strong>xintexpr</strong>: <code>\xintdefefunc</code>, <code>\xintdeffloatefunc</code>, <code>\xintdefiiefunc</code> define functions which are not protected against expansion in the definition of other functions; refer to <code>xint.pdf</code> for the related explanations.</p>
-Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code>, <code>\xintNewFunction</code> is complex and to be considered still as work in progress as it has a number of shortcomings.</li>
-<li><strong>xintexpr</strong>: <code>inv()</code>, <code>ilog10()</code>, <code>sfloat()</code>, behaviour of <code>qfloat()</code> slightly modified.</li>
-<li><strong>xintexpr</strong>: <code>\xintensuredummy</code>, <code>\xintrestorelettervar</code>.</li>
+<p>Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code>, <code>\xintNewFunction</code> is complex and to be considered still as work in progress as it has a number of shortcomings.</p></li>
+<li><p><strong>xintexpr</strong>: <code>inv()</code>, <code>ilog10()</code>, <code>sfloat()</code>, behaviour of <code>qfloat()</code> slightly modified.</p></li>
+<li><p><strong>xintexpr</strong>: <code>\xintensuredummy</code>, <code>\xintrestorelettervar</code>.</p></li>
<li><p>The optional argument of <code>\xintfloatexpr</code> or <code>\xintfloateval</code> (it must be at start of braced argument) can be negative; it then means to trim (and round) from the output at float precision that many least significant digits.</p></li>
</ul>
-<h3 id="bug-fixes">Bug fixes</h3>
+<h3 id="bug-fixes-1">Bug fixes</h3>
<ul>
<li>Some bugfixes related to user functions with no variables at all; they were dysfunctional.</li>
</ul>
@@ -199,7 +217,7 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<li><p><strong>xintexpr</strong>: the <code>gcd()</code> and <code>lcm()</code> functions formerly converted their arguments to integers via <code>\xintNum</code>. They now handle general input with no such modification.</p></li>
<li><p><strong>xintexpr</strong>: former <code>\xinteval</code>, <code>\xintieval</code>, <code>\xintiieval</code>, and <code>\xintfloateval</code> renamed to <code>\xintexpro</code>, <code>\xintiexpro</code>, <code>\xintiiexpro</code>, and <code>\xintfloatexpro</code>.</p></li>
</ul>
-<h3 id="improvements-and-new-features-1">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-2">Improvements and new features</h3>
<ul>
<li><p><strong>xintexpr</strong>: the <code>gcd()</code> and <code>lcm()</code> multi-arguments functions have been refactored to handle general fractions. The dependency on <strong>xintgcd</strong> is removed.</p></li>
<li><p><strong>xintexpr</strong>: three-way branching <code>\xintifsgnexpr</code>, <code>\xintifsgnfloatexpr</code>, <code>\xintifsgniiexpr</code> conditional macros.</p></li>
@@ -208,12 +226,12 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<li><p><strong>xintexpr</strong>: functions <code>isone()</code> and <code>isint()</code>.</p></li>
<li><p><strong>xintexpr</strong>: <code>\xinteval</code>, <code>\xintieval</code>, <code>\xintiieval</code>, and <code>\xintfloateval</code> as synonyms to <code>\xinttheexpr...\relax</code> etc…, but with the (comma-separated) expression as a usual braced macro argument.</p></li>
</ul>
-<h3 id="bug-fixes-1">Bug fixes</h3>
+<h3 id="bug-fixes-2">Bug fixes</h3>
<ul>
<li><strong>xintcore</strong>, <strong>xintexpr</strong> : division in <code>\xintiiexpr</code> was broken for a zero dividend and a one-digit divisor (e.g. <code>0//7</code>) since <code>1.2p</code> due to a bug in <code>\xintiiDivMod</code> for such arguments. The bug was signaled (thanks to Kpym for report) and fixed shortly after <code>1.3c</code> release but I then completely forgot to upload a bugfix release to CTAN at that time, apologies for that.</li>
</ul>
<h2 id="c-20180617"><code>1.3c (2018/06/17)</code></h2>
-<h3 id="improvements-and-new-features-2">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-3">Improvements and new features</h3>
<ul>
<li><p><strong>xintexpr</strong>: with <code>\xintglobaldefstrue</code>, <code>\xintdefvar</code>, <code>\xintdeffunc</code>, <code>\xintNewExpr</code> et al. make definitions with global scope.</p></li>
<li><p><strong>xintexpr</strong>: <code>qraw()</code> for fast input of (very many) comma separated numbers (in suitable raw format).</p></li>
@@ -221,12 +239,12 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<li><p><strong>xintexpr</strong>: <code>\xintdefvar</code>, <code>\xintdeffunc</code> 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.</p></li>
<li><p><code>\xintUniformDeviate</code> is better documented and <code>sourcexint.pdf</code> is better hyperlinked and includes indices for the macros defined by each package.</p></li>
</ul>
-<h3 id="bug-fixes-2">Bug fixes</h3>
+<h3 id="bug-fixes-3">Bug fixes</h3>
<ul>
<li><strong>xintfrac</strong>: since <code>1.3</code> release, it loaded <strong>xintgcd</strong> in contradiction to what the documentation says (hence also <strong>xintexpr</strong> loaded <strong>xintgcd</strong> automatically). There is no actual dependency so the loading is removed for now.</li>
</ul>
<h2 id="b-20180518"><code>1.3b (2018/05/18)</code></h2>
-<h3 id="improvements-and-new-features-3">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-4">Improvements and new features</h3>
<p>All additions related to randomness are marked as work-in-progress. They require an engine providing the <code>\(pdf)uniformdeviate</code> primitive.</p>
<ul>
<li><p><strong>xintkernel</strong>: <code>\xintUniformDeviate</code>.</p></li>
@@ -241,13 +259,13 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<ul>
<li><strong>xintcore</strong>, <strong>xint</strong>, <strong>xintfrac</strong>: removal of the internal macros which were used at <code>1.2o</code> to add a deprecation mechanism; all deprecated macros have been removed at <code>1.3</code> so there was no reason to keep the code used for deprecating them.</li>
</ul>
-<h3 id="improvements-and-new-features-4">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-5">Improvements and new features</h3>
<ul>
<li><p><strong>xintexpr</strong>: new conditionals <code>ifone()</code> and <code>ifint()</code>.</p></li>
<li><p><strong>xintfrac</strong>: <code>\xintREZ</code> is faster on inputs having one hundred digits or more.</p></li>
<li><p>Added to the user manual mention of macros such as <code>\xintDivFloor</code>, <code>\xintMod</code>, <code>\xintModTrunc</code>, which had been left out so far.</p></li>
</ul>
-<h3 id="bug-fixes-3">Bug fixes</h3>
+<h3 id="bug-fixes-4">Bug fixes</h3>
<ul>
<li><strong>xintexpr</strong>: the mechanism for adjunction to the expression parsers of user defined functions was refactored and improved at previous release <code>1.3</code>: in particular recursive definitions became possible. But an oversight made these recursive functions quite inefficient (to remain polite.) This release fixes the problem.</li>
</ul>
@@ -259,18 +277,18 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<li><p><strong>xintexpr</strong>: the addition, subtraction, modulo <code>/:</code>, and the <code>mod()</code> and <code>divmod()</code> functions produce generally smaller denominators (see previous item).</p></li>
<li><p><strong>xintexpr</strong>: formerly, the internal macros which are internally associated to user-declared functions were using comma separated parameter texts. They now do not use such commas (their meanings, which may again change in future, are written for information to the log under <code>\xintverbosetrue</code>).</p></li>
</ul>
-<h3 id="improvements-and-new-features-5">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-6">Improvements and new features</h3>
<ul>
<li><p><strong>xintexpr</strong>: user-defined functions may now be of a recursive nature. This was made possible by a refactoring of the <code>\xintNewExpr</code> mechanism. It became both leaner and more extensive than formerly.</p></li>
<li><p><strong>xintfrac</strong>: new macros <code>\xintPIrr</code> and <code>\xintDecToString</code>. The latter is a backport of a <code>polexpr 0.4</code> utility, and it is to be considered unstable.</p></li>
<li><p><strong>xintexpr</strong>: new function <code>preduce()</code> associated with <code>\xintPIrr</code>.</p></li>
</ul>
<h2 id="q-20180206"><code>1.2q (2018/02/06)</code></h2>
-<h3 id="improvements-and-new-features-6">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-7">Improvements and new features</h3>
<ul>
<li><strong>xintexpr</strong>: tacit multiplication extended to cases such as <code>3!4!5!</code> or <code>(1+2)3</code>.</li>
</ul>
-<h3 id="bug-fixes-4">Bug fixes</h3>
+<h3 id="bug-fixes-5">Bug fixes</h3>
<ul>
<li><strong>xintcore</strong>: sadly, refactoring at <code>1.2l</code> of subtraction left an extra character in an inner macro causing breakage in some rare circumstances. This should not have escaped our test suite!</li>
</ul>
@@ -283,13 +301,13 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<li><p><strong>xintfrac</strong>: <code>\xintMod</code> is now associated with floored division. The former meaning is available as <code>\xintModTrunc</code>.</p></li>
<li><p><strong>xintexpr</strong>: the <code>//</code> operator and its associated modulo <code>'mod'</code> (or <code>/:</code>) now correspond to floored division, like the Python language <code>//</code>, <code>%</code>, and <code>divmod(x, y)</code>. Formerly they had been associated to truncated division. This is breaking change for operands of opposite signs.</p></li>
</ul>
-<h3 id="improvements-and-new-features-7">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-8">Improvements and new features</h3>
<ul>
<li><p><strong>xinttools</strong>: <code>\xintListWithSep</code>, which had remained unchanged since its introduction at <code>1.04 (2013/04/25)</code>, was rewritten for increased speed.</p></li>
<li><p><strong>xintexpr</strong>: <code>\xintdefvar</code>’s syntax is extended to allow simultaneous assignments. Examples: <code>\xintdefvar x1, x2, x3 := 1, 3**10, 3**20;</code> or <code>\xintdefiivar A, B := B, A 'mod' B;</code> for already defined variables <code>A</code> and <code>B</code>.</p></li>
<li><p><strong>xintexpr</strong>: added <code>divmod()</code> to the built-in functions. It is associated with floored division, like the Python language <code>divmod()</code>. Related support macros added to <strong>xintcore</strong>, and <strong>xintfrac</strong>.</p></li>
</ul>
-<h3 id="bug-fixes-5">Bug fixes</h3>
+<h3 id="bug-fixes-6">Bug fixes</h3>
<ul>
<li><p><strong>xintgcd</strong>: <code>\xintBezout{6}{3}</code> (for example) expanded to <code>{6}{3}{-0}{-1}{3}</code>, but the <code>-0</code> should have been <code>0</code>.</p></li>
<li><p><strong>xintgcd</strong>: it still used macro <code>\xintiAbs</code> although the latter had been deprecated from <strong>xintcore</strong>.</p></li>
@@ -317,7 +335,7 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<ul>
<li><strong>xintbinhex</strong> does not load package <strong>xintcore</strong> anymore, but only <strong>xintkernel</strong>.</li>
</ul>
-<h3 id="improvements-and-new-features-8">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-9">Improvements and new features</h3>
<ul>
<li><p><strong>xintbinhex</strong> has only <strong>xintkernel</strong> as dependency.</p></li>
<li><p>Macros of <strong>xintbinhex</strong> have been improved for speed and increased maximal sizes of allowable inputs.</p></li>
@@ -328,11 +346,11 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<li><p><strong>xintbinhex</strong>: the length of the input is now limited. The maximum size depends on the macro and ranges from about <code>4000</code> to about <code>19900</code> digits.</p></li>
<li><p><strong>xintbinhex</strong>: <code>\xintCHexToBin</code> is now the variant of <code>\xintHexToBin</code> which does not remove leading binary zeroes: <code>N</code> hex-digits give on output exactly <code>4N</code> binary digits.</p></li>
</ul>
-<h3 id="improvements-and-new-features-9">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-10">Improvements and new features</h3>
<ul>
<li><strong>xintbinhex</strong>: all macros have been rewritten using techniques from the 1.2 release (they had remained unmodified since <code>1.08</code> of <code>2013/06/07</code>.) The new macros are faster but limited to a few thousand digits. The <code>1.08</code> routines could handle tens of thousands of digits, but not in a reasonable time.</li>
</ul>
-<h3 id="bug-fixes-6">Bug fixes</h3>
+<h3 id="bug-fixes-7">Bug fixes</h3>
<ul>
<li><p>user manual: the <code>Changes</code> section wrongly stated at <code>1.2l</code> that the macros of <strong>xintbinhex</strong> had been made robust against non terminated input such as <code>\number\mathcode`\-</code>. Unfortunately the author fell into the trap of believing his own documentation and he forgot to actually implement the change. Now done.</p></li>
<li><p>user manual: the PDF bookmarks were messed up.</p></li>
@@ -344,7 +362,7 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<li><p><code>\xintiiSumExpr</code>, <code>\xintiiPrdExpr</code> (<strong>xint</strong>) and <code>\xintSumExpr</code>, <code>\xintPrdExpr</code> (<strong>xintfrac</strong>). They had not been formally deprecated, but had been left un-documented since <code>1.09d (2013/10/22)</code>.</p></li>
<li><p>internal macro <code>\xint_gob_til_xint_relax</code> removed.</p></li>
</ul>
-<h3 id="improvements-and-new-features-10">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-11">Improvements and new features</h3>
<ul>
<li><p>the underscore character <code>_</code> is accepted by the <strong>xintexpr</strong> parsers as a digit separator (the space character already could be used for improved readability of big numbers). It is not allowed as <em>first</em> character of a number, as it would then be mis-interpreted as the start of a possible variable name.</p></li>
<li><p>some refactoring in <strong>xintcore</strong> auxiliary routines and in <code>\xintiiSub</code> and <code>\xintiiCmp</code> for some small efficiency gains.</p></li>
@@ -353,7 +371,7 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<p>The situation with expressions is unchanged: syntax such as <code>\xintexpr \numexpr1+2\relax</code> is illegal as the ending <code>\relax</code> token will get swallowed by the <code>\numexpr</code>; but it is needed by the <code>xintexpr</code>-ession parser, hence the parser will expand forward and presumably end with in an “illegal token” error, or provoke some low-level TeX error (N.B.: a closing brace <code>}</code> for example can not terminate an <code>xintexpr</code>-ession, the parser must find a <code>\relax</code> token at some point). Thus there must be in this example a second <code>\relax</code>.</p></li>
<li><p>experimental code for error conditions; there is no complete user interface yet, it is done in preparation for next major release and is completely unstable and undocumented.</p></li>
</ul>
-<h3 id="bug-fixes-7">Bug fixes</h3>
+<h3 id="bug-fixes-8">Bug fixes</h3>
<ul>
<li><p><strong>xintbinhex</strong>: since <code>1.2 (2015/10/10)</code>, <code>\xintHexToDec</code> was broken due to an undefined macro (it was in <code>xint.sty</code>, but the module by itself is supposedly dependent only upon <code>xintcore.sty</code>).</p></li>
<li><p><strong>xintgcd</strong>: macro <code>\xintBezout</code> produced partially wrong output if one of its two arguments was zero.</p></li>
@@ -365,21 +383,21 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<li><p>macro <code>\xintFloat</code> which rounds its input to a floating point number does <em>not</em> print anymore <code>10.0...0eN</code> to signal an upwards rounding to the next power of ten. The mantissa has in all cases except the zero input exactly one digit before the decimal mark.</p></li>
<li><p>some floating point computations may differ in the least significant digits, due to a change in the rounding algorithm applied to macro arguments expressed as fractions and to an improvement in precision regarding half-integer powers in expressions. See next.</p></li>
</ul>
-<h3 id="improvements-and-new-features-11">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-12">Improvements and new features</h3>
<ul>
<li><p>the initial rounding to the target precision <code>P</code> which is applied by the floating point macros from <strong>xintfrac</strong> to their arguments achieves the <em>exact (aka correct) rounding</em> even for inputs which are fractions with more than <code>P+2</code> digits in their numerators and denominators (<code>&gt;1</code>.) Hence the computed values depend only on the arguments as rational numbers and not upon their representatives. This is not relevant to <em>expressions</em> (<strong>xintexpr</strong>), because the <code>\xintfloatexpr</code> parser sees there <code>/</code> as an operator and does not (apart from special constructs) get to manipulate fractions as such.</p></li>
<li><p><code>\xintnewdummy</code> is public interface to a <code>1.2e</code> macro which serves to declare any given catcode 11 character as a dummy variable for expressions (<strong>xintexpr</strong>). This is useful for Unicode engines (the Latin letters being already all pre-declared as dummy variables.)</p></li>
<li><p>added <code>\xintiSqrtR</code>, there was only <code>\xintiiSqrtR</code> alongside <code>\xintiSqrt</code> and <code>\xintiiSqrt</code> (<strong>xint</strong>).</p></li>
<li><p>added non public <code>\xintLastItem:f:csv</code> to <strong>xinttools</strong> for faster <code>last()</code> function, and improved <code>\xintNewExpr</code> compatibility. Also <code>\xintFirstItem:f:csv</code>.</p></li>
</ul>
-<h3 id="bug-fixes-8">Bug fixes</h3>
+<h3 id="bug-fixes-9">Bug fixes</h3>
<ul>
<li><p>the <code>1.2f</code> half-integer powers computed within <code>\xintfloatexpr</code> had a silly rounding to the target precision just <em>before</em> the final square-root extraction, thus possibly losing some precision. The <code>1.2k</code> implementation keeps guard digits for this final square root extraction. As for integer exponents, it is guaranteed that the computed value differs from the exact one by less than <code>0.52 ulp</code> (for inputs having at most <code>\xinttheDigits</code> digits.)</p></li>
<li><p>more regressions from <code>1.2i</code> were fixed: <code>\xintLen</code> (<strong>xint</strong>, <strong>xintfrac</strong>) and <code>\xintDouble</code> (<strong>xintcore</strong>) had forgotten that their argument was allowed to be negative. A regression test suite is now in place and is being slowly expanded to cover more macros.</p></li>
<li><p><code>\xintiiSquareRoot{0}</code> now produces <code>{1}{1}</code>, which fits better the general documented behaviour of this macro than <code>11</code>.</p></li>
</ul>
<h2 id="j-20161222"><code>1.2j (2016/12/22)</code></h2>
-<h3 id="improvements-and-new-features-12">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-13">Improvements and new features</h3>
<ul>
<li><p><strong>xinttools</strong> and <strong>xintexpr</strong>:</p>
<ol type="1">
@@ -388,7 +406,7 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
</ol></li>
<li><p>significant documentations tweaks (inclusive of suppressing things!), and among them two beautiful hyperlinked tables with both horizontal and vertical rules which bring the documentation of the <strong>xintexpr</strong> syntax to a kind of awe-inspiring perfection… except that implementation of some math functions is still lacking.</p></li>
</ul>
-<h3 id="bug-fixes-9">Bug fixes</h3>
+<h3 id="bug-fixes-10">Bug fixes</h3>
<ul>
<li>fix two <code>1.2i</code> regressions caused by undefined macros (<code>\xintNthElt</code> in certain branches and <code>[list][N]</code> item extraction in certain cases.) The test files existed but were not executed prior to release. Automation in progress.</li>
</ul>
@@ -401,7 +419,7 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<ul>
<li>deprecated macros <code>\xintifTrue</code>, <code>\xintifTrueFalse</code>, <code>\xintQuo</code>, <code>\xintRem</code>, <code>\xintquo</code>, <code>\xintrem</code>.</li>
</ul>
-<h3 id="improvements-and-new-features-13">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-14">Improvements and new features</h3>
<ul>
<li><p><strong>xintkernel</strong>: <code>\xintLength</code> is faster. New macros:</p>
<ul>
@@ -420,17 +438,17 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<li><p>the documentation has again been (slightly) re-organized; it has a new sub-section on the Miller-Rabin primality test, to illustrate some use of <code>\xintNewFunction</code> for recursive definitions.</p></li>
<li><p>the documentation has dropped the LaTeX “command” terminology (which had been used initially in 2013 for some forgotten reasons and should have been removed long ago) and uses only the more apt “macro”, as after all, all of <strong>xint</strong> is about expansion of macros (plus the use of <code>\numexpr</code>).</p></li>
</ul>
-<h3 id="bug-fixes-10">Bug fixes</h3>
+<h3 id="bug-fixes-11">Bug fixes</h3>
<ul>
<li><code>\xintDecSplitL</code> and <code>\xintDecSplitR</code> from <strong>xint</strong> produced their output in a spurious brace pair (bug introduced in <code>1.2f</code>).</li>
</ul>
<h2 id="h-20161120"><code>1.2h (2016/11/20)</code></h2>
-<h3 id="improvements-and-new-features-14">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-15">Improvements and new features</h3>
<ul>
<li><p>new macro <code>\xintNewFunction</code> in <strong>xintexpr</strong> which allows to extend the parser syntax with functions in situations where <code>\xintdeffunc</code> is not usable (typically, because dummy variables are used over a not yet determined range of values because it depends on the variables).</p></li>
<li><p>after three years of strict obedience to <code>xint</code> prefix, now <code>\thexintexpr</code>, <code>\thexintiexpr</code>, <code>\thexintfloatexpr</code>, and <code>\thexintiiexpr</code> are provided as synonyms to <code>\xinttheexpr</code>, etc…</p></li>
</ul>
-<h3 id="bug-fixes-11">Bug fixes</h3>
+<h3 id="bug-fixes-12">Bug fixes</h3>
<ul>
<li><p>the <code>(cond)?{foo}{bar}</code> operator from <strong>xintexpr</strong> mis-behaved in certain circumstances (such as an empty <code>foo</code>).</p></li>
<li><p>the <strong>xintexpr</strong> <code>1.2f</code> <code>binomial</code> function (which uses <code>\xintiiBinomial</code> from <strong>xint.sty</strong> or <code>\xintFloatBinomial</code> from <strong>xintfrac.sty</strong>) deliberately raised an error for <code>binomial(x,y)</code> with <code>y&lt;0</code> or <code>x&lt;y</code>. This was unfortunate, and it now simply evaluates to zero in such cases.</p></li>
@@ -443,7 +461,7 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<li><p>inside expressions, list item selector <code>[L][n]</code> counts starting at zero, not at one. This is more coherent with <code>[L][a:b]</code> which was already exactly like in Python since its introduction. A function len(L) replaces earlier <code>[L][0]</code>.</p></li>
<li><p>former <code>iter</code> keyword now called <code>iterr</code>. Indeed it matched with <code>rrseq</code>, the new <code>iter</code> (which was somehow missing from <code>1.1</code>) is the one matching <code>rseq</code>. Allows to iterate more easily with a “list” variable.</p></li>
</ul>
-<h3 id="improvements-and-new-features-15">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-16">Improvements and new features</h3>
<ul>
<li><p>in <strong>xintexpr.sty</strong>: list selectors <code>[L][n]</code> and <code>[L][a:b]</code> are more efficient: the earlier <code>1.1</code> routines did back and forth conversions from comma separated values to braced tokens, the <code>1.2g</code> routines use macros from <strong>xinttools.sty</strong> handling directly the encountered lists of comma separated values.</p></li>
<li><p>in <strong>xinttools.sty</strong>: slight improvements in the efficiency of the <code>\xintNthElt</code>, <code>\xintKeep</code>, <code>\xintTrim</code> routines and new routines handling directly comma separated values. The latter are not included in the user manual (they are not <code>\long</code>, they don’t make efforts to preserve some braces, do not worry about spaces, all those worries being irrelevant to the use in expressions for list selectors).</p></li>
@@ -456,7 +474,7 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<ul>
<li>no more <code>\xintFac</code> macro but <code>\xintiFac/\xintiiFac/\xintFloatFac</code>.</li>
</ul>
-<h3 id="improvements-and-new-features-16">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-17">Improvements and new features</h3>
<ul>
<li><p>functions <code>binomial</code>, <code>pfactorial</code> and <code>factorial</code> in both integer and float versions.</p></li>
<li><p>macros <code>\xintiiBinomial</code>, <code>\xintiiPFactorial</code> (<strong>xint.sty</strong>) and <code>\xintFloatBinomial</code>, <code>\xintFloatPFactorial</code> (<strong>xintfrac.sty</strong>). Improvements to <code>\xintFloatFac</code>.</p></li>
@@ -470,60 +488,60 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<li><p>(TeXperts only) the macros defined (internally) from <code>\xintdeffunc</code> et al. constructs do not incorporate an initial <code>\romannumeral</code> anymore.</p></li>
<li><p>renewed desperate efforts at improving the documentation by random shuffling of sections and well thought additions; cuts were considered and even performed.</p></li>
</ul>
-<h3 id="bug-fixes-12">Bug fixes</h3>
+<h3 id="bug-fixes-13">Bug fixes</h3>
<ul>
<li><p>squaring macro <code>\xintSqr</code> from <strong>xintfrac.sty</strong> was broken due to a misspelled sub-macro name. Dates back to <code>1.1</code> release of <code>2014/10/28</code> <code>:-((</code>.</p></li>
<li><p><code>1.2c</code>’s fix to the subtraction bug from <code>1.2</code> introduced another bug, which in some cases could create leading zeroes in the output, or even worse. This could invalidate other routines using subtractions, like <code>\xintiiSquareRoot</code>.</p></li>
<li><p>the comparison operators were not recognized by <code>\xintNewIIExpr</code> and <code>\xintdefiifunc</code> constructs.</p></li>
</ul>
<h2 id="e-20151122"><code>1.2e (2015/11/22)</code></h2>
-<h3 id="improvements-and-new-features-17">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-18">Improvements and new features</h3>
<ul>
<li><p>macro <code>\xintunassignvar</code>.</p></li>
<li><p>slight modifications of the logged messages in case of <code>\xintverbosetrue</code>.</p></li>
<li><p>a space in <code>\xintdeffunc f(x)&lt;space&gt;:= expression ;</code> is now accepted.</p></li>
<li><p>documentation enhancements: the <em>Quick Sort</em> section with its included code samples has been entirely re-written; the <em>Commands of the xintexpr package</em> section has been extended and reviewed entirely.</p></li>
</ul>
-<h3 id="bug-fixes-13">Bug fixes</h3>
+<h3 id="bug-fixes-14">Bug fixes</h3>
<ul>
<li><p>in <strong>xintfrac</strong>: the <code>\xintFloatFac</code> from release <code>1.2</code> parsed its argument only through <code>\numexpr</code> but it should have used <code>\xintNum</code>.</p></li>
<li><p>in <strong>xintexpr</strong>: release <code>1.2d</code> had broken the recognition of sub-expressions immediately after variable names (with tacit multiplication).</p></li>
<li><p>in <strong>xintexpr</strong>: contrarily to what <code>1.2d</code> documentation said, tacit multiplication was not yet always done with enhanced precedence. Now yes.</p></li>
</ul>
<h2 id="d-20151118"><code>1.2d (2015/11/18)</code></h2>
-<h3 id="improvements-and-new-features-18">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-19">Improvements and new features</h3>
<ul>
<li><p>the function definitions done by <code>\xintdeffunc</code> et al., as well as the macro declarations by <code>\xintNewExpr</code> et al. now have only local scope.</p></li>
<li><p>tacit multiplication applies to more cases, for example (x+y)z, and always ties more than standard * infix operator, e.g. x/2y is like x/(2*y).</p></li>
<li><p>some documentation enhancements, particularly in the chapter on xintexpr.sty, and also in the code source comments.</p></li>
</ul>
-<h3 id="bug-fixes-14">Bug fixes</h3>
+<h3 id="bug-fixes-15">Bug fixes</h3>
<ul>
<li>in <strong>xintcore</strong>: release <code>1.2c</code> had inadvertently broken the <code>\xintiiDivRound</code> macro.</li>
</ul>
<h2 id="c-20151116"><code>1.2c (2015/11/16)</code></h2>
-<h3 id="improvements-and-new-features-19">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-20">Improvements and new features</h3>
<ul>
<li><p>macros <code>\xintdeffunc</code>, <code>\xintdefiifunc</code>, <code>\xintdeffloatfunc</code> and boolean <code>\ifxintverbose</code>.</p></li>
<li><p>on-going code improvements and documentation enhancements, but stopped in order to issue this bugfix release.</p></li>
</ul>
-<h3 id="bug-fixes-15">Bug fixes</h3>
+<h3 id="bug-fixes-16">Bug fixes</h3>
<ul>
<li>in <strong>xintcore</strong>: recent release <code>1.2</code> introduced a bug in the subtraction (happened when 00000001 was found under certain circumstances at certain mod 8 locations).</li>
</ul>
<h2 id="b-20151029"><code>1.2b (2015/10/29)</code></h2>
-<h3 id="bug-fixes-16">Bug fixes</h3>
+<h3 id="bug-fixes-17">Bug fixes</h3>
<ul>
<li>in <strong>xintcore</strong>: recent release <code>1.2</code> introduced a bug in the division macros, causing a crash when the divisor started with 99999999 (it was attempted to use with 1+99999999 a subroutine expecting only 8-digits numbers).</li>
</ul>
<h2 id="a-20151019"><code>1.2a (2015/10/19)</code></h2>
-<h3 id="improvements-and-new-features-20">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-21">Improvements and new features</h3>
<ul>
<li><p>added <code>\xintKeepUnbraced</code>, <code>\xintTrimUnbraced</code> (<strong>xinttools</strong>) and fixed documentation of <code>\xintKeep</code> and <code>\xintTrim</code> regarding brace stripping.</p></li>
<li><p>added <code>\xintiiMaxof/\xintiiMinof</code> (<strong>xint</strong>).</p></li>
<li><p>TeX hackers only: replaced all code uses of <code>\romannumeral-`0</code> by the quicker <code>\romannumeral`&amp;&amp;@</code> (<code>^</code> being used as letter, had to find another character usable with catcode 7).</p></li>
</ul>
-<h3 id="bug-fixes-17">Bug fixes</h3>
+<h3 id="bug-fixes-18">Bug fixes</h3>
<ul>
<li>in <strong>xintexpr</strong>: recent release <code>1.2</code> introduced a bad bug in the parsing of decimal numbers and as a result <code>\xinttheexpr 0.01\relax</code> expanded to <code>0</code> ! (sigh…)</li>
</ul>
@@ -532,7 +550,7 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<ul>
<li>the macros <code>\xintAdd</code>, <code>\xintSub</code>, <code>\xintMul</code>, <code>\xintMax</code>, <code>\xintMin</code>, <code>\xintMaxof</code>, <code>\xintMinof</code> are removed from package <strong>xint</strong>, and only exist in the versions from <strong>xintfrac</strong>. With only <strong>xintcore</strong> or <strong>xint</strong> loaded, one <em>must</em> use <code>\xintiiAdd</code>, <code>\xintiiSub</code>, …, or <code>\xintiAdd</code>, <code>\xintiSub</code>, etc…</li>
</ul>
-<h3 id="improvements-and-new-features-21">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-22">Improvements and new features</h3>
<ul>
<li><p>the basic arithmetic implemented in <strong>xintcore</strong> has been entirely rewritten. The mathematics remains the elementary school one, but the <code>TeX</code> implementation achieves higher speed (except, regarding addition/subtraction, for numbers up to about thirty digits), the gains becoming quite significant for numbers with hundreds of digits.</p></li>
<li><p>the inputs must have less than 19959 digits. But computations with thousands of digits take time.</p></li>
@@ -586,7 +604,7 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<li><p><code>\xintMax</code>, <code>\xintMin</code>, <code>\xintAdd</code>, <code>\xintSub</code>, <code>\xintMul</code> (<strong>xint</strong>): their usage without <strong>xintfrac</strong> is deprecated; use <code>\xintiMax</code>, <code>\xintiMin</code>, <code>\xintiAdd</code>, <code>\xintiSub</code>, <code>\xintiMul</code>.</p></li>
<li><p>the <code>&amp;</code> and <code>|</code> as Boolean operators in <code>xintexpr</code>-essions are deprecated in favour of <code>&amp;&amp;</code> and <code>||</code>. The single letter operators might be assigned some other meaning in some later release (bitwise operations, perhaps). Do not use them.</p></li>
</ul>
-<h3 id="improvements-and-new-features-22">Improvements and new features</h3>
+<h3 id="improvements-and-new-features-23">Improvements and new features</h3>
<ul>
<li><p>new package <strong>xintcore</strong> has been split off <strong>xint</strong>. It contains the core arithmetic macros (it is loaded by LaTeX package <strong>bnumexpr</strong>),</p></li>
<li><p>neither <strong>xint</strong> nor <strong>xintfrac</strong> load <strong>xinttools</strong>. Only <strong>xintexpr</strong> does,</p></li>
@@ -624,7 +642,7 @@ Notice that whole area of <code>\xintdef(e)func</code>, <code>\xintNewExpr</code
<li><p><code>\xintthecoords</code> converts a comma separated list of an even number of items to the format expected by the <code>TikZ</code> <code>coordinates</code> syntax,</p></li>
<li><p>completely new version <code>\xintNewExpr</code>, <code>protect</code> function to handle external macros. The dollar sign <code>$</code> for place holders is not accepted anymore, only the standard macro parameter <code>#</code>. Not all constructs are compatible with <code>\xintNewExpr</code>.</p></li>
</ul>
-<h3 id="bug-fixes-18">Bug fixes</h3>
+<h3 id="bug-fixes-19">Bug fixes</h3>
<ul>
<li><p><code>\xintZapFirstSpaces</code> hence also <code>\xintZapSpaces</code> from package <strong>xinttools</strong> were buggy when used with an argument either empty or containing only space tokens.</p></li>
<li><p><code>\xintiiexpr</code> did not strip leading zeroes, hence <code>\xinttheiiexpr 001+1\relax</code> did not obtain the expected result …</p></li>
diff --git a/macros/generic/xint/CHANGES.pdf b/macros/generic/xint/CHANGES.pdf
index 5ae2956477..d449cb63c8 100644
--- a/macros/generic/xint/CHANGES.pdf
+++ b/macros/generic/xint/CHANGES.pdf
Binary files differ
diff --git a/macros/generic/xint/README b/macros/generic/xint/README
index 9bd0a96470..580b1e8965 100644
--- a/macros/generic/xint/README
+++ b/macros/generic/xint/README
@@ -1,7 +1,7 @@
- Source: xint.dtx 1.3e 2019/04/05 (doc 2019/04/05)
+ Source: xint.dtx 1.3f 2019/09/10 (doc 2019/09/10)
Author: Jean-Francois Burnol
Info: Expandable operations on big integers, decimals, fractions
- License: LPPL 1.3e
+ License: LPPL 1.3f
This README is also available as README.pdf and README.html.
diff --git a/macros/generic/xint/README.html b/macros/generic/xint/README.html
index cc66a4ab5d..cee77f4af2 100644
--- a/macros/generic/xint/README.html
+++ b/macros/generic/xint/README.html
@@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
- <meta name="author" content="xint 1.3e" />
+ <meta name="author" content="xint 1.3f" />
<title>README</title>
<style type="text/css">
code{white-space: pre-wrap;}
@@ -25,8 +25,8 @@
<body>
<header>
<h1 class="title">README</h1>
-<p class="author">xint 1.3e</p>
-<p class="date">2019/04/05</p>
+<p class="author">xint 1.3f</p>
+<p class="date">2019/09/10</p>
</header>
<nav id="TOC">
<ul>
@@ -44,10 +44,10 @@
<li><a href="#license">License</a></li>
</ul>
</nav>
-<pre><code>Source: xint.dtx 1.3e 2019/04/05 (doc 2019/04/05)
+<pre><code>Source: xint.dtx 1.3f 2019/09/10 (doc 2019/09/10)
Author: Jean-Francois Burnol
Info: Expandable operations on big integers, decimals, fractions
-License: LPPL 1.3e</code></pre>
+License: LPPL 1.3f</code></pre>
<p>This <code>README</code> is also available as <code>README.pdf</code> and <code>README.html</code>.</p>
<p>Change log is to be found in <code>CHANGES.pdf</code> or <code>CHANGES.html</code>.</p>
<p>The user manual is <code>xint.pdf</code>, and the commented source code is available as <code>sourcexint.pdf</code>.</p>
diff --git a/macros/generic/xint/README.pdf b/macros/generic/xint/README.pdf
index dd4181d4cc..9fa9fe6008 100644
--- a/macros/generic/xint/README.pdf
+++ b/macros/generic/xint/README.pdf
Binary files differ
diff --git a/macros/generic/xint/sourcexint.pdf b/macros/generic/xint/sourcexint.pdf
index 4503773c79..7a2465e316 100644
--- a/macros/generic/xint/sourcexint.pdf
+++ b/macros/generic/xint/sourcexint.pdf
Binary files differ
diff --git a/macros/generic/xint/xint.dtx b/macros/generic/xint/xint.dtx
index f5312323f1..a0620b17be 100644
--- a/macros/generic/xint/xint.dtx
+++ b/macros/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: <06-04-2019 at 18:55:58 CEST>}
+\def\xintdtxtimestamp {Time-stamp: <10-09-2019 at 22:59:27 CEST>}
%</dtx>
%<*drv>
%% ---------------------------------------------------------------
-\def\xintdocdate {2019/04/05}
-\def\xintbndldate{2019/04/05}
-\def\xintbndlversion {1.3e}
+\def\xintdocdate {2019/09/10}
+\def\xintbndldate{2019/09/10}
+\def\xintbndlversion {1.3f}
%</drv>
%<readme>% README
%<changes>% CHANGE LOG
-%<readme|changes>% xint 1.3e
-%<readme|changes>% 2019/04/05
+%<readme|changes>% xint 1.3f
+%<readme|changes>% 2019/09/10
%<readme|changes>
-%<readme|changes> Source: xint.dtx 1.3e 2019/04/05 (doc 2019/04/05)
+%<readme|changes> Source: xint.dtx 1.3f 2019/09/10 (doc 2019/09/10)
%<readme|changes> Author: Jean-Francois Burnol
%<readme|changes> Info: Expandable operations on big integers, decimals, fractions
-%<readme|changes> License: LPPL 1.3e
+%<readme|changes> License: LPPL 1.3f
%<readme|changes>
%<*!readme&!changes&!dohtmlsh&!dopdfsh&!makefile>
%% ---------------------------------------------------------------
-%% The xint bundle 1.3e 2019/04/05
+%% The xint bundle 1.3f 2019/09/10
%% Copyright (C) 2013-2019 by Jean-Francois Burnol
%<xintkernel>%% xintkernel: Paraphernalia for the xint packages
%<xinttools>%% xinttools: Expandable and non-expandable utilities
@@ -240,15 +240,44 @@ and Makefile.mk.</div>
%</readme>--------------------------------------------------------
%<*changes>-------------------------------------------------------
+`1.3f (2019/09/10)`
+----
+
+### Improvements and new features
+
+ - **xintfrac**: `\xintDigits = P;` syntax (i.e. without a colon) is now
+ accepted in addition to `\xintDigits := P;`.
+
+ Document that the ending semi-colon can not be an active character
+ and that it has always been allowed to use in its place a
+ non-expanding token e.g. `\xintDigits := 32\relax`.
+
+ Add `\xintSetDigits`.
+
+ - **xintexpr**: add starred variants `\xintDigits*` and `\xintSetDigits*`
+ which execute `\xintreloadxinttrig`.
+
+ Revert 1.3e ban on usage of `\xinteval` et al. inside expressions by
+ `\xintdeffunc`. And make them usable also inside macro definitions via
+ `\xintNewExpr`.
+
+### Bug fixes
+
+ - **xintexpr**: fix bug preventing usage of `\xintdefefunc` to define a
+ function without variables.
+
+ Fix some issue with `\xintfloatexpr[D]..\relax` if used inside an
+ expression parsed by `\xintdeffunc` et al.
+
+
`1.3e (2019/04/05)`
----
### Incompatible changes
- - When defining functions, sub-expressions can only use the
- `\xint(float)expr...\relax` syntax. One can *not* use there the
- `\xint(float)eval` wrappers (anyhow they add overhead and can be
- replaced with the lower level syntax).
+ - (_reverted at 1.3f_) When defining functions, sub-expressions can only
+ use the `\xint(float)expr...\relax` syntax. One can not use there the
+ `\xint(float)eval` wrappers.
### Improvements and new features
@@ -258,10 +287,12 @@ and Makefile.mk.</div>
digits. It is for the most part implemented using high level user
interface, but will probably get some optimizations in future (and
perhaps extension to more digits).
+
- The **xintlog** library is automatically loaded by **xintexpr**. It
uses [poormanlog](http://ctan.org/pkg/poormanlog) to provide
logarithms and exponentials with almost 9 digits of precision.
Extended precision is for a future release.
+
- **xintexpr**: `\xintdefefunc`, `\xintdeffloatefunc`, `\xintdefiiefunc`
define functions which are not protected against expansion in the
definition of other functions; refer to `xint.pdf` for the related
@@ -270,9 +301,12 @@ and Makefile.mk.</div>
Notice that whole area of `\xintdef(e)func`, `\xintNewExpr`,
`\xintNewFunction` is complex and to be considered still as work in
progress as it has a number of shortcomings.
+
- **xintexpr**: `inv()`, `ilog10()`, `sfloat()`, behaviour of
`qfloat()` slightly modified.
+
- **xintexpr**: `\xintensuredummy`, `\xintrestorelettervar`.
+
- The optional argument of `\xintfloatexpr` or `\xintfloateval` (it
must be at start of braced argument) can be negative; it then means
to trim (and round) from the output at float precision that many
@@ -2515,6 +2549,10 @@ dvipdfmx CHANGES.dvi
\ifpdf \chardef\Withdvipdfmx 0 \fi
\ifxetex\chardef\Withdvipdfmx 0 \fi
+% Get rid of HARASSMENT by KOMA-Script
+\makeatletter
+\def\class@shoulddisablepackagewarning@list{tocloft.}
+\makeatother
\ifnum\Withdvipdfmx=1
\def\pgfsysdriver{pgfsys-dvipdfm.def}
\documentclass [dvipdfm, dvipdfmx, dvipdfmx-outline-open]{scrdoc}
@@ -2581,7 +2619,6 @@ dvipdfmx CHANGES.dvi
\fi
\usepackage{xinttools}
-\xintverbosetrue
\usepackage{enumitem}
\usepackage{varioref}
@@ -3672,15 +3709,16 @@ pdfpagemode=UseOutlines}
\node [right of=kernel] (B) {};
\node [block, below right of=B] (core) {\xintcorename};
\node [block, below left of=A] (tools) {\xinttoolsname};
- \node [block, right of=core, xshift=1cm] (bnumexpr) {\href{http://www.ctan.org/pkg/bnumexpr}{bnumexpr}};
+ \node [block, right of=core, xshift=1cm] (bnumexpr) {\href{https://ctan.org/pkg/bnumexpr}{bnumexpr}};
\node [block, below of=core] (xint) {\xintname};
\node [block, left of=xint, xshift=-.5cm] (gcd) {\xintgcdname};
\node [block, left of=gcd] (binhex) {\xintbinhexname};
\node [block, below of=xint] (frac) {\xintfracname};
\node [block, below of=frac, yshift=-.5cm] (expr) {\xintexprname};
- \node [block, below right of=expr, yshift=-.5cm, xshift=2.25cm] (polexpr) {\href{http://www.ctan.org/pkg/polexpr}{polexpr}};
+ \node [block, below right of=expr, yshift=-.5cm, xshift=2.25cm] (polexpr) {\href{https://ctan.org/pkg/polexpr}{polexpr}};
\node [block, below of=expr, yshift=-.5cm] (trig) {\xinttrigname};
\node [block, left of=trig] (log) {\xintlogname};
+ \node [block, left of=log, xshift=-1cm] (poormanlog) {\href{https://ctan.org/pkg/poormanlog}{poormanlog}};
\node [block, below right of=frac, xshift=1cm] (series) {\xintseriesname};
\node [block, right of=series] (cfrac) {\xintcfracname};
% Draw edges
@@ -3695,6 +3733,7 @@ pdfpagemode=UseOutlines}
\path [line,-{Stealth[length=5mm]}] (expr) -- (polexpr);
\path [line,{Stealth[length=5mm]}-{Stealth[length=5mm]}] (expr) -- (trig);
\path [line,{Stealth[length=5mm]}-{Stealth[length=5mm]}] (expr) -- (log);
+ \path [line,-{Stealth[length=5mm]}] (poormanlog) -- (log);
\path [line,-{Stealth[length=5mm]}] (expr) -- (polexpr);
\path [line,-{Stealth[length=5mm]}] (frac) to [out=0,in=90] (series.north);
\path [line,-{Stealth[length=5mm]}] (frac) to [out=0,in=90] (cfrac.north);
@@ -3720,15 +3759,18 @@ pdfpagemode=UseOutlines}
functionalities of the lower module it is thus necessary to use
a suitable |\usepackage| (\LaTeX) or |\input| (Plain \TeX.)\par
- \href{http://ctan.org/pkg/bnumexpr}{bnumexpr} is a
+ \href{https://ctan.org/pkg/bnumexpr}{bnumexpr} is a
separate (\LaTeX{} only) package by the author which uses (by default)
\xintcorename as its mathematical engine.
- \href{http://ctan.org/pkg/polexpr}{polexpr} is a
+ \href{https://ctan.org/pkg/polexpr}{polexpr} is a
separate (\LaTeX{} only) package by the author which requires \xintexprname.
\xinttrigname and \xintlogname are loaded automatically by \xintexprname; they
will refuse to be loaded directly (but see \csbxint{reloadxinttrig}).
+
+ \href{https://ctan.org/pkg/poormanlog}{poormanlog} is a \TeX{} and
+ \LaTeX{} package by the author which is loaded automatically by \xintlogname.
\par
\end{addmargin}
@@ -3899,7 +3941,7 @@ Float computations are done by default with \dtt{16} digits of precision.
This can be changed via an assignment to |\xintDigits|:
\begin{everbatim*}
% use braces (or a LaTeX environment) to limit the scope of the \xintDigits assignment
-{\xintDigits := 88;\xintfloateval{3.25^100-3.2^100}}\par
+{\xintDigits := 88\relax \xintfloateval{3.25^100-3.2^100}}\par
\end{everbatim*}
Trigonometrical function need a reload after modifying the float precision,
this is done by \csbxint{reloadxinttrig}.
@@ -3907,7 +3949,7 @@ this is done by \csbxint{reloadxinttrig}.
We can even try daring things:\footnote{The \cs{printnumber} is not part of
the package, see \autoref{ssec:printnumber}.}
\begin{everbatim*}
-{\xintDigits:=500;\printnumber{\xintfloateval{sqrt(2)}}}
+{\xintDigits:=500\relax \printnumber{\xintfloateval{sqrt(2)}}}
\end{everbatim*}
All operations executed by the parsers are based on underlying macros from
@@ -4061,7 +4103,7 @@ opt for the floating point version:
A bigger example (the scope of
the assignment to |\xintDigits| is limited by the braces):
\begin{everbatim*}
-{\xintDigits:=24; \xintthefloatexpr 1.23456789123456789^123456789\relax }
+{\xintDigits:=24\relax \xintthefloatexpr 1.23456789123456789^123456789\relax }
\end{everbatim*}
(<- notice the size of the power of ten: this surely largely exceeds your pocket
calculator abilities).
@@ -4132,7 +4174,7 @@ which are among the extra packages included in the \xintname distribution.
The printing of the outputs will either use a custom |\printnumber| macro as
described in the previous section, or sometimes the |\np| macro from the
-\href{http://www.ctan.org/pkg/numprint}{numprint} package (see
+\href{https://ctan.org/pkg/numprint}{numprint} package (see
\autoref{fn:np}).
\begin{itemize}
@@ -4160,12 +4202,12 @@ described in the previous section, or sometimes the |\np| macro from the
exact evaluation before truncation would be costly, and it is more efficient
to use floating point numbers:
%
-\leftedline{|\xintDigits:=20;
+\leftedline{|\xintDigits:=20\relax
\np{\xintthefloatexpr .7123045678952^-243\relax}|}%
%
-\leftedline{\xintDigits:=20;\dtt{\np{\xintthefloatexpr .7123045678952^-243\relax }}}
+\leftedline{\xintDigits:=20\relax \dtt{\np{\xintthefloatexpr .7123045678952^-243\relax }}}
%
-\xintDigits:=16;%
+\xintDigits:=16\relax %
%
Side note: the exponent |-243| didn't have to be put inside parentheses,
contrarily to what happens with some professional computational
@@ -4182,8 +4224,8 @@ software. |;-)|
\item {$2000!$ as a float. As \xintexprname does not handle |exp/log| so far,
the computation is done internally without the Stirling formula,
by repeated multiplications truncated suitably:}\\
- |\xintDigits:=50;|\newline |\xintthefloatexpr 2000!\relax|:
- {\xintDigits:=50;\dtt{\printnumber{\xintthefloatexpr 2000!\relax}}}
+ |\xintDigits:=50\relax |\newline |\xintthefloatexpr 2000!\relax|:
+ {\xintDigits:=50\relax \dtt{\printnumber{\xintthefloatexpr 2000!\relax}}}
\item Just to show off (again), let's print 300 digits (after the decimal
point) of the decimal expansion of $0.7^{-25}$:%
@@ -4245,7 +4287,7 @@ $\frac{\pi^2}{144}-\frac1{162}={}$%
\dtt{\np{0.06236607994583659534684445}\dots}\,%
%
\footnote{\label{fn:np}This number is typeset using the
- \href{http://www.ctan.org/pkg/numprint}{numprint} package, with
+ \href{https://ctan.org/pkg/numprint}{numprint} package, with
|\npthousandsep{,\hskip 1pt plus .5pt minus .5pt}|. But the breaking
across lines works only in text mode. The number itself was (of
course...) computed initially with \xintname, with 30 digits of $\pi$
@@ -4274,7 +4316,7 @@ was:
\leftedline{|\numprint{\xintFloatPow [24]{2}{999999999}}|}
\leftedline{\dtt{\numprint{\Temp}}}
%
-where the \href{http://www.ctan.org/pkg/numprint}{numprint} package was used
+where the \href{https://ctan.org/pkg/numprint}{numprint} package was used
(\autoref{fn:np}), directly in text mode (it can also naturally be used from
inside math mode). \xintname provides a simple-minded \csbxint{Frac}
typesetting macro,%
@@ -4295,7 +4337,7 @@ number formatting macros than |\xintFrac|.
%
We have already mentioned
|\numprint| which is used above, there is also |\num| from package
-\href{http://www.ctan.org/pkg/siunitx}{siunitx}. The raw output from
+\href{https://ctan.org/pkg/siunitx}{siunitx}. The raw output from
%
\leftedline{\detokenize{\xintFloatPow[24]{2}{999999999}}}
%
@@ -4382,7 +4424,7 @@ run.%
is probably no need for a custom install: just use the package manager to
update if necessary \xintname to the latest version available.
-The |README| files on \href{http://www.ctan.org/pkg/xint}{CTAN} explain how to
+The |README| files on \href{https://ctan.org/pkg/xint}{CTAN} explain how to
proceed with a custom installation.
On \TeX\ distributions with a |"texdoc"| or similar utility,
@@ -4396,14 +4438,14 @@ will offer to display one of those files:
\end{itemize}
% For manual installation, follow the instructions from the |README| file which
-% is to be found on \href{http://www.ctan.org/pkg/xint}{CTAN}; it is also
+% is to be found on \href{https://ctan.org/pkg/xint}{CTAN}; it is also
% available there in PDF and HTML formats. The simplest method proposed is to
-% use the archive file \href{http://www.ctan.org/pkg/xint}{xint.tds.zip},
+% use the archive file \href{https://ctan.org/pkg/xint}{xint.tds.zip},
% downloadable from the same location.
% The next simplest one is to make use of the |Makefile|, which is also
% downloadable from
-% \href{http://mirror.ctan.org/macros/generic/xint}{CTAN}. This is
+% \href{http://mirrors.ctan.org/macros/generic/xint}{CTAN}. This is
% for GNU/Linux systems and Mac OS X, and necessitates use of the command
% line. If for some reason you have |xint.dtx| but no internet access,
% you can recreate |Makefile| as a file with this name and the following
@@ -4434,6 +4476,25 @@ For more information see
The formatted source code is available in file |sourcexint.pdf|:
\centeredline{|texdoc sourcexint|}
+\noindent\expandafter|\xintbndlversion| (\expandafter|\xintbndldate|):
+\begin{itemize}[nosep]
+\item Fix bug preventing usage of \csbxint{defefunc}
+ to define a function with no variables.
+\item Fix bug with usage of |\xintfloatexpr[D]..\relax| inside the parsed
+ expression for \csbxint{deffunc} and variants.
+\item Revert |1.3e| ban on usage of \csbxint{eval} et al. inside a function
+ definition via \csbxint{deffunc} and variants.
+\item Macro definitions via \csbxint{NewExpr} now also allow \csbxint{eval} et
+ al. within them.
+\item Add \csbxint{Digits}|=P;| syntax with no colon.
+\item Document that the ending semi-colon in \csbxint{Digits}|:=P;| must not
+ be active, and that it has always been allowed to use any non-expanding
+ token such as a dot or a |\relax| in its place.
+\item Add \csbxint{SetDigits} user interface.
+\item Add \csbxint{Digits*}|:=P;| and \csbxint{SetDigits*}|{P}| variants
+ which execute \csbxint{reloadxinttrig}.
+\end{itemize}
+
\noindent|1.3e| (|2019/04/05|):
\begin{itemize}[nosep]
\item An \xinttrigname library is automatically loaded by \xintexprname and
@@ -4455,13 +4516,13 @@ The formatted source code is available in file |sourcexint.pdf|:
\csbxint{defiiefunc} and documented the ``protected'' nature of the
functions defined by the original variants \csbxint{deffunc} et al. This
whole area is complex and to be still considered work in progress.
-\item Breaking change: only the \csbxint{expr}|...\relax| syntax is accepted
- for sub-expressions when doing function definitions via \csbxint{deffunc}
- and \csbxint{defefunc} et al. One can \textbf{not} use \csbxint{eval},
- \csbxint{ieval}, \csbxint{floateval} for sub-evaluations inside such
- definitions (anyway there are not efficient there because the parser will
- have to recollect the digits of the value whereas \csbxint{expr} keeps some
- private internal format).
+\item Breaking change (\emph{which got reverted at
+ \texttt{1.3f}}):\CHANGED{1.3f}
+ only the
+ \csbxint{expr}|...\relax| syntax is accepted for sub-expressions when doing
+ function definitions via \csbxint{deffunc} and \csbxint{defefunc} et al. One
+ can not use \csbxint{eval}, \csbxint{ieval}, \csbxint{floateval} inside such
+ definitions.
\item \func{inv}, \func{ilog10}.
\item \func{sfloat}, slight modification of behaviour of \func{qfloat}.
\item \csbxint{ensuredummy}, \csbxint{restorelettervar}.
@@ -4470,24 +4531,25 @@ The formatted source code is available in file |sourcexint.pdf|:
\csbxint{theDigits} diminished by this argument.
\end{itemize}
-\noindent|1.3d| (|2019/01/06|):
-\begin{itemize}[nosep]
-\item \func{gcd} and \func{lcm} in \csbxint{expr}|...\relax| now handle
- general arguments, without converting them to integers,
-\item It is not needed anymore to load package \xintgcdname to benefit from
- \func{gcd} and \func{lcm} in the parsers.
-\item \csbxint{ifsgnexpr}, \csbxint{ifsgnfloatexpr}, \csbxint{ifsgniiexpr}.
-\item \csbxint{unassignexprfunc} and variants for the other parsers.
-\item \func{isone} and \func{isint}.
-\item \csbxint{eval}, \csbxint{ieval}, \csbxint{iieval}, and
- \csbxint{floateval}. Attention: these names were formerly used with some other
- (barely documented) meanings, for which |\xintexpro|, |\xintiexpro|,
- etc... are now used.
-\item Sadly, in \csbxint{iiexpr}|...\relax| division with a zero dividend and
- a one-digit divisor got broken at |1.2p|. Fixed. Thanks to \textsc{Kpym} for
- report. Sorry for long delay in releasing the bugfix, which was done shortly
- after |1.3c| release.
-\end{itemize}
+% \noindent|1.3d| (|2019/01/06|):
+% \begin{itemize}[nosep]
+% \item \func{gcd} and \func{lcm} in \csbxint{expr}|...\relax| now handle
+% general arguments, without converting them to integers,
+% \item It is not needed anymore to load package \xintgcdname to benefit from
+% \func{gcd} and \func{lcm} in the parsers.
+% \item \csbxint{ifsgnexpr}, \csbxint{ifsgnfloatexpr}, \csbxint{ifsgniiexpr}.
+% \item \csbxint{unassignexprfunc} and variants for the other parsers.
+% \item \func{isone} and \func{isint}.
+% \item \csbxint{eval}, \csbxint{ieval}, \csbxint{iieval}, and
+% \csbxint{floateval}. Attention: these names were formerly used with some other
+% (barely documented) meanings, for which |\xintexpro|, |\xintiexpro|,
+% etc... are now used.
+% \item Sadly, in \csbxint{iiexpr}|...\relax| division with a zero dividend and
+% a one-digit divisor got broken at |1.2p|. Fixed. Thanks to \textsc{Kpym} for
+% report. Sorry for long delay in releasing the bugfix, which was done shortly
+% after |1.3c| release.
+% \end{itemize}
+
\section{The syntax of \xintexprname expressions}
\label{sec:xintexprsyntax}
@@ -4510,7 +4572,7 @@ separated list of results.
|num(6.02e23)| which will convert to an integer notation
\dtt{\printnumber{\xinttheiiexpr num(6.02e23)\relax}}.
\item \csbxint{thefloatexpr}| ... \relax| does computations with a given
- precision \dtt{P}, as specified via a prior assignment |\xintDigits:=P;|.
+ precision \dtt{P}, as specified via a prior assignment |\xintDigits:=P\relax |.
The default is \dtt{P=16} digits. An optional argument controls the
precision for \emph{formatting the output} (this is not the precision of the
computations themselves). The four basic operations and the square root
@@ -4906,7 +4968,7 @@ Miscellaneous notes:
|2|.%
\begin{everbatim*}
\pdfsetrandomseed 12345
- \xintDigits:=37;%
+ \xintDigits:=37\relax
\xintthefloatexpr random()\relax\newline
\xintthefloatexpr random()\relax\par
\end{everbatim*}
@@ -4927,7 +4989,7 @@ Miscellaneous notes:
\begin{everbatim*}
% still with 37 digits as prevailing float precision
\xintthefloatexpr qrand(), random()\relax\newline
- \xintDigits:=16;%
+ \xintDigits:=16\relax
\xintthefloatexpr qrand(), random()\relax\par
\end{everbatim*}
@@ -5149,16 +5211,16 @@ $\xintthefloatexpr subs(((x-1)/x, x/x, (x+1)/x), x=2**30)\relax
allow arbitrarily complicated combinations of various |bool(name)|.
\funcdesc[name]{togl}
returns $1$
- if the \LaTeX{} package \href{http://www.ctan.org/pkg/etoolbox}{etoolbox}%
+ if the \LaTeX{} package \href{https://ctan.org/pkg/etoolbox}{etoolbox}%
%
%
%
-\footnote{\url{http://www.ctan.org/pkg/etoolbox}}
+\footnote{\url{https://ctan.org/pkg/etoolbox}}
%
has been used to define a toggle named |name|, and this toggle is
currently set to |true|. Using |togl| in an |\xintexpr..\relax|
without having loaded
- \href{http://www.ctan.org/pkg/etoolbox}{etoolbox} will result in an
+ \href{https://ctan.org/pkg/etoolbox}{etoolbox} will result in an
error from |\iftoggle| being a non-defined macro. If |etoolbox| is
loaded but |togl| is used on a name not recognized by |etoolbox|
the error message will be of the type ``ERROR: Missing |\endcsname|
@@ -5277,7 +5339,7 @@ $\xintthefloatexpr subs(((x-1)/x, x/x, (x+1)/x), x=2**30)\relax
use of inside \csa{xintexpr}|...\relax|, this switches to the use of the
float version, rather than the exact one.
\begin{everbatim*}
-\xinttheexpr factorial (100,32)\relax, {\xintDigits:=32;\xintthefloatexpr
+\xinttheexpr factorial (100,32)\relax, {\xintDigits:=32\relax \xintthefloatexpr
factorial (100)\relax}\newline
\xinttheexpr factorial (50)\relax\newline
\xinttheexpr factorial (50, 32)\relax
@@ -5292,6 +5354,9 @@ $\xintthefloatexpr subs(((x-1)/x, x/x, (x+1)/x), x=2**30)\relax
in first case if |A| is zero or negative and in second case if |B <= A|.
\NewWith{1.3b}
+ Attention that the arguments are first converted to integers using
+ \csbxint{Num} (i.e. truncated towards zero).
+
The function can be used in all three parsers. Of course the size is not
limited (but in the float parser, the integer will be rounded if involved
in any operation).
@@ -5392,10 +5457,10 @@ mod(11/7,1/13)- (11/7)/:(1/13), (11/7)//(1/13)\relax\newline
the |q| is produced unrounded. Either as in the above example or this one
with comparison operators:
\begin{everbatim*}
-\xintDigits := 4;%
+\xintDigits := 4\relax
\xintthefloatexpr if(12345678//23=537000, 1, 0), 12345678//23\relax\newline
\xintthefloatexpr if(float(12345678//23)=537000, 1, 0)\relax\par
-\xintDigits := 16;%
+\xintDigits := 16\relax
\end{everbatim*}
In the first line, the comparison is done with
|floor(12350000/23)|\dtt{=\xinttheiiexpr12350000/23\relax} (notice in
@@ -5668,32 +5733,30 @@ this ``nuple''. For example:
We can illustrate its use with an expandable (!)
implementation of the Brent-Salamin algorithm for the computation of $\pi$:
\begin{everbatim*}
-\xintDigits:= 91;
-\xintdeffloatfunc BS(a, b, t, p):= (a+b)/2, sqrt(a*b), t-p(a-b)^2, \xintiiexpr 2p\relax;
-\xintthefloatexpr [88] % use 3 guard digits (output value is *rounded*)
- iter(1, 1/sqrt(2), 1, 1; % initial values
- ([@][0]-[@][1]<2[-45])? % if a-b is small enough stop iterating and ...
- {break(([@][0]+[@][1])^2/[@][2])} % ... do final computation,
- {BS(@)}, % else do iteration via pre-defined (for convenience) function BS.
+\xintDigits:= 87\relax
+% Below 83 is 87-3-1 (3 guard digits, target 84=1+83 digits) and 43 is 84/2+1.
+\xintdeffloatefunc BS(a, b, t, p):= 0.5*(a+b), sqrt(a*b), t-p*sqr(a-b), \xintiiexpr 2p\relax;
+\xinteval
+{trunc(% I feel truncation is better than rounding to display decimals of π
+ \xintfloatexpr
+ iter(1, sqrt(0.5), 1, 1; % initial values
+ ([@][0]-[@][1]<2e-43)?% stopping criteria; takes into account that the
+ % exit computation (break() argument) doubles
+ % number of exact digits (roughly)
+ {break(sqr([@][0]+[@][1])/[@][2])} % ... do final computation,
+ {BS(@)}, % else do iteration
i=1++) % This generates infinite iteration. The i is not used.
-\relax
-\xintDigits:=16;%
+ \relax
+ , 83)% closing parenthesis of trunc()
+}...% some dots following end of \xinteval argument
+\xintDigits:=16\relax
\end{everbatim*}\newline
- You can try with |\xintDigits:=1001;| and |2[-501]| in place of
- |\xintDigits:=91;| and |2[-45]|, but don't make a final rounding to only
- |88| digits of course ... and better wrap the whole thing in |\message| or
- |\immediate\write128| because it will run in the right margin (about
- \dtt{7}s on my laptop last time I tried). By the way here is how the |BS|
- function is defined internally:
-\begin{everbatim}
- Function BS for \xintfloatexpr parser associated to \XINT_flexpr_userfunc_B
-S with meaning macro:#1#2#3#4->\XINTinFloatDiv {\XINTinFloatAdd {#1}{#2}}{2},\X
-INTinFloatSqrtdigits {\XINTinFloatMul {#1}{#2}},\XINTinFloatSub {#3}{\XINTinFlo
-atMul {#4}{\XINTinFloatPowerH {\XINTinFloatSub {#1}{#2}}{2}}},\xintiiMul {2}{#4
-}
-\end{everbatim}
-
-
+ You can try with |\xintDigits:=1004\relax| and |2e-501| in place of
+ |\xintDigits:=87\relax| and |2e-43|, but be patient for some seconds
+ for the result. Of course don't truncate the final
+ result to only \dtt{83} fractional decimal digits but \dtt{1000}...
+ and better to wrap the whole thing in |\message| or
+ |\immediate\write128| or |\edef| because it will then run in the right margin.
\funcdesc[initial values; expr, letter=values]{rrseq} recursive sequence with multiple initial terms. Say, there are
|K| of them. Then |@1|, ..., |@4| and then |@@(n)| up to |n=K| refer to the
@@ -5864,19 +5927,16 @@ Prime numbers are always cool
\end{everbatim*}
The syntax in this last example may look a bit involved (... and it is so I
-admit). First |x/:m| computes
-|x modulo m| (this is the modulo with respect to truncated division, which
-here for positive arguments is like Euclidean division; in
-|\xintexpr...\relax|, |a/:b| is such that |a = b*(a//b)+a/:b|, with |a//b| the
-algebraic quotient |a/b| truncated to an integer.). The |(x)?{yes}{no}|
-construct checks if |x| (which \emph{must} be within parentheses) is true or
-false, i.e. non zero or zero. It then executes either the |yes| or the |no|
-branch, the non chosen branch is \emph{not} evaluated. Thus if |m| divides |x|
-we are in the second (``false'') branch. This gives a |-1|. This |-1| is the
-argument to a |??| branch which is of the type |(y)??{y<0}{y=0}{y>0}|, thus here
-the |y<0|, i.e., |break(0)| is chosen. This |0| is thus given to another |?|
-which consequently chooses |omit|, hence the number is not kept in the list.
-The numbers which survive are the prime numbers.
+admit). First |x/:m| computes |x modulo m| (this is the modulo with respect to
+floored division). The |(x)?{yes}{no}| construct checks if |x| (which
+\emph{must} be within parentheses) is true or false, i.e. non zero or zero. It
+then executes either the |yes| or the |no| branch, the non chosen branch is
+\emph{not} evaluated. Thus if |m| divides |x| we are in the second (``false'')
+branch. This gives a |-1|. This |-1| is the argument to a |??| branch which is
+of the type |(y)??{y<0}{y=0}{y>0}|, thus here the |y<0|, i.e., |break(0)| is
+chosen. This |0| is thus given to another |?| which consequently chooses
+|omit|, hence the number is not kept in the list. The numbers which survive
+are the prime numbers.
\begin{everbatim*}
The first Fibonacci number beyond |2^64| bound is
@@ -6030,10 +6090,9 @@ A variable name must start with a letter:
\end{itemize}
|x_1x| is a licit variable name, as well as |x_1x_| and |x_1x_2| and |x_1x_2y|
-etc... hence tacit multiplication fails in cases like |x_1x_2| with |x_1| and
-|x_2| defined as variables; the parser goes not go to the effort of tracing
-back its steps, and it is too late when it realizes |x_1x_2| isn't a valid
-variable name. An explicit infix |*| operator is needed.
+etc... As the parser does not trace back its steps, it will raise an ``unknown
+variable'' error in cases such as |x_1x_2| with defined variables |x_1| and
+|x_2| but not |x_1x_2|. Input syntax must be |x_1*x_2| in such cases.
Single letter names |a..z| and |A..Z| are pre-declared by the package for use
as special type of variables called ``dummy variables''. It is allowed to
@@ -6074,9 +6133,9 @@ rounding errors:
\xintdeffloatvar e_4:=e_2+add(1/i!, i=11..20);% float sum
\xintthefloatexpr e_3, e_4\relax\newline
\xintdeffloatvar e:=2.7182818284590452353602874713526624977572470936999595749669676;%
-\xintDigits:=24;
+\xintDigits:=24\relax
\xintthefloatexpr[16] e, e^1000, e^1000000\relax (e rounded to 24 digits first)\newline
-\xintDigits:=16;
+\xintDigits:=16\relax
\xintthefloatexpr e, e^1000, e^1000000\relax (e rounded to 16 digits first)\par
\end{everbatim*}
@@ -6179,6 +6238,16 @@ Since release |1.2c| it is possible to declare functions:
\end{everbatim*}(notice the numerous tacit multiplications in this expression;
and that |x/2y| is interpreted as |x/(2y)|.)
+\begin{framed}
+ The ending semi-colon is allowed to be of active catcode, as |\xintdeffunc|
+ temporarily resets (since |1.3c|) its catcode before parsing the expression.
+ But this will fail if the whole thing is inside a macro definition. Then the
+ used semi-colon must be the standard one.
+
+ The colon is optional (since |1.2e|) and its (reasonable) catcode does not
+ matter.
+\end{framed}
+
Here are a few important items (bookmark this for reading again later once you
@@ -6195,15 +6264,7 @@ have gained experience in using this interface...):
\item A function can have at most nine variables.
\item The mechanism for functions shares a common code base with the one
implementing \csbxint{NewExpr}. This means it shares its features and also
- its \hyperref[sssec:limitations]{limitations}. %
-
- Most notably,\IMPORTANT{} the |1.3d| \csbxint{eval}, \csbxint{ieval},
- \csbxint{floateval} can not be used inside the parsed
- expression: only the lower level syntax
- \csbxint{expr}|...\relax| et al. is accepted (and not
- \csbxint{theexpr} et al.\CHANGED{1.3e} which are about the same as \csbxint{eval} et al.).
- Prior to |1.3e| \csbxint{NewExpr} and \csbxint{deffunc} diverged on that
- point, but their behaviour is now identical.
+ its \hyperref[sssec:limitations]{limitations}.
\item In order to allow recursive constructs, a core mechanism is implemented
which inhibits immediate expansion in a new definition; think of
\csbxint{deffunc} as being
@@ -6259,11 +6320,6 @@ have gained experience in using this interface...):
\item If the expression uses an \func{iterr}, \func{rseq}, or \func{rrseq}) it
must hide its |;| inside braces to let it not be confused with the ending
|;|.
-\item \csbxint{deffunc} tries to set the catcode of |;| before fetching the
- expression as a delimited parameter, but this is too late if the whole thing
- was already fetched as argument to some macro. On the other hand the
- (reasonable) catcode of the |:| does not matter at all, actually this colon
- before the equality sign is optional.
\end{itemize}
@@ -6416,8 +6472,9 @@ some example here...
Think of former described variant \csbxint{deffunc} as doing the same as this
\csbxint{defefunc}\NewWith{1.3e} but with an extra protection added to the
defined function. If you don't need recursivity, \csbxint{defefunc} is the
-better tool, as numerical evaluation involving it and arising in further
-definitions will be converted on the spot to actual values, rather than being
+better tool, as numerical evaluations which will use the defined function
+inside further
+definitions will get converted on the spot to actual values, rather than being
delayed for expansion to actual use of the defined function in \csbxint{eval}
or \csbxint{ieval}.
@@ -6631,7 +6688,7 @@ precision for the evaluation.
\def\CR{\cr}
\halign
{\tabskip1ex
-\hfil\bfseries#&\xintDigits:=\xintiloopindex;\xintthefloatexpr Rump(77617,33096)#\cr
+\hfil\bfseries#&\xintDigits:=\xintiloopindex\relax \xintthefloatexpr Rump(77617,33096)#\cr
\xintiloop [8+1]
\xintiloopindex &\relax\CR
\ifnum\xintiloopindex<40 \repeat
@@ -7146,7 +7203,7 @@ Integers with only $10$ digits and starting with a $3$ already exceed the
\TeX{} bound; and \TeX{} does not have a native processing of floating point
numbers (multiplication by a decimal number of a dimension register is allowed
--- this is used for example by the
-\href{http://mirror.ctan.org/graphics/pgf/base}{pgf} basic math engine.)
+\href{http://mirrors.ctan.org/graphics/pgf/base}{pgf} basic math engine.)
\TeX{} elementary operations on numbers are done via the non-expandable
\emph{\char92advance, \char92multiply, \emph{and} \char92divide} assignments.
@@ -7155,7 +7212,7 @@ using standard infix notations with \TeX{} integers. But \eTeX{} did not
modify the \TeX{} bound on acceptable integers, and did not add floating point
support.
-The \href{http://www.ctan.org/pkg/bigintcalc}{bigintcalc} package by
+The \href{https://ctan.org/pkg/bigintcalc}{bigintcalc} package by
\textsc{Heiko Oberdiek} provided expandable macros (using some of |\numexpr|
possibilities, when available) on arbitrarily big integers, beyond the \TeX{}
bound. It does not provide an expression parser.%
@@ -7184,9 +7241,9 @@ notation with a given number of significant figures'.%
The \LaTeX3 project has implemented expandably floating-point computations with
\dtt{16} significant figures
-(\href{http://www.ctan.org/pkg/l3kernel}{l3fp}), including
+(\href{https://ctan.org/pkg/l3kernel}{l3fp}), including
functions such as exp, log, sine and cosine.\footnote{at the time of writing (2014/10/28) the
- \href{http://www.ctan.org/pkg/l3kernel}{l3fp} (exactly represented) floating
+ \href{https://ctan.org/pkg/l3kernel}{l3fp} (exactly represented) floating
point numbers have their exponents limited to $\pm$\dtt{9999}.}
%
@@ -7220,14 +7277,14 @@ Even with the superior \liiibigint{} Karatsuba multiplication it takes about
computations in a document. I have long been thinking that without the
expandability constraint much higher speeds could be achieved, but perhaps I
have not given enough thought to sustain that optimistic stance.\footnote{The
- \href{http://www.ctan.org/pkg/apnum}{apnum} package implements
+ \href{https://ctan.org/pkg/apnum}{apnum} package implements
(non-expandably) arbitrary precision fixed point algebra and (v1.6)
functions exp, log, sqrt, the trigonometrical direct and inverse functions.}
I remain of the opinion that if one really wants to do computations with
\emph{thousands} of digits, one should drop the expandability requirement.
Indeed, as clearly demonstrated long ago by the
-\href{http://www.ctan.org/pkg/pi}{pi computing file} by \textsc{D. Roegel} one
+\href{https://ctan.org/pkg/pi}{pi computing file} by \textsc{D. Roegel} one
can program \TeX{} to compute with many digits at a much higher speed than
what \xintname achieves: but, direct access to memory storage in one form or
another seems a necessity for this kind of speed and one has to renounce at
@@ -7246,7 +7303,7 @@ given arbitrary precision |P|. The default value is $P=16$ meaning that the
significands of the produced (non-zero) numbers have \dtt{16} decimal digits.
The syntax to set the precision to |P| is
%
-\centeredline{|\xintDigits:=P;|}
+\centeredline{|\xintDigits:=P\relax|}
%
The value is local to the group or environment (if using \LaTeX). To query the
current value use \csbxint{theDigits}.
@@ -7446,9 +7503,9 @@ margin annotation next to the description of the arguments.
package provided conditionals such as \csbxint{ifEq}, \csbxint{ifGt},
\csbxint{ifSgn},\dots\ or, for \LaTeX{} users and when dealing
with short integers the
- \href{http://www.ctan.org/pkg/etoolbox}{etoolbox}%
+ \href{https://ctan.org/pkg/etoolbox}{etoolbox}%
%
-\footnote{\url{http://www.ctan.org/pkg/etoolbox}}
+\footnote{\url{https://ctan.org/pkg/etoolbox}}
expandable conditionals (for small integers only) such as \texttt{\char92
ifnumequal}, \texttt{\char92 ifnumgreater}, \dots . Use of
\emph{non-expandable} things such as \csa{ifthenelse} is impossible inside the
@@ -7993,9 +8050,9 @@ unused branches should not be forgotten.
If these tests are to be applied to standard \TeX{} short integers, it is more
efficient to use (under \LaTeX{}) the equivalent conditional tests from the
-\href{http://www.ctan.org/pkg/etoolbox}{etoolbox}%
+\href{https://ctan.org/pkg/etoolbox}{etoolbox}%
%
-\footnote{\url{http://www.ctan.org/pkg/etoolbox}}
+\footnote{\url{https://ctan.org/pkg/etoolbox}}
package.
\subsection{No variable declarations are needed}
@@ -9623,6 +9680,12 @@ reversed. Unprotected spaces (of any character code) are gobbled.
\leftedline{gives:
\ttfamily{\string\Stuff\string\to1002\string\xintiiPow\string\xintDigitsOf}}
+\xinttoolsname provides a variant \csbxint{RevWithBraces} which keeps brace
+pairs in the output, and \fexpan ds its input first.
+
+For inputs consisting only digit tokens, see \csbxint{ReverseDigits} from
+\xintname.
+
\subsection{\csh{xintLength}}
\label{xintLength}
@@ -11860,10 +11923,64 @@ $\xintIsOne {21921379213/21921379213}\neq\xintIsOne {1.0000000000000000000000000
\label{xintDigits}
\label{xinttheDigits}
-The syntax |\xintDigits := D;| (where spaces do not matter) assigns the
-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.
+The syntax |\xintDigits := D;| assigns the value of |D| to the number of
+digits to be used by floating point operations (this uses internally a
+|\mathchardef| assignement, and |D| stands for (or expands to) a legal \TeX\
+number). The default is |16|. The maximal value is |32767|.
+
+The expandable macro |\xinttheDigits|\etype{} serves to retrieve (internally
+it uses |\number|) the current value.
+
+Spaces do not matter (but they must not occur in-between digit tokens, as such a space
+ would terminate the \TeX{} number):
+\begin{everbatim*}
+\xintDigits := 24;\xinttheDigits, %
+\xintDigits:=36 ;\xinttheDigits, %
+\xintDigits:= 16 ;and \xinttheDigits.
+\end{everbatim*}
+
+It has always been the case that an active colon |:| was allowed.
+It\NewWith{1.3f} is now even possible to drop it and to use |\xintDigits = D;|
+syntax.
+
+An ending active semi-colon |;| is \emph{not} compatible: it can and most
+probably will cause low-level \TeX{} errors at such locations (this is the
+case if it is made active by |\usepackage[french]{babel}| in \LaTeX). This
+restriction always applied, but never got properly documented prior to
+|1.3f| release... It is possible to use |\string;| but then there can not be
+any space separating it from the digits.
+
+But this problem with an active semi-colon |;| has trivial workaround: it
+always applied (but was not formerly documented) that any non-expanding token
+could be used in place of the ending semi-colon |;|. One has always been
+allowed to use e.g. a dot character or a |\relax| token. This non-expanding
+ending token will get removed from the token stream.
+
+The safer syntax is thus |\xintDigits := D\relax| (with or without the colon).
+This is the syntax now in use in most examples from the documentation.
+\begin{everbatim*}
+\xintDigits = 24\def\xinttheDigits, % only for showing it works! don't do that!
+\xintDigits := 36.\xinttheDigits, % one can use a dot in place of semi-colon
+\xintDigits = 16\relax and \xinttheDigits.\par % with \relax, even better
+\end{everbatim*}
+
+\begin{framed}
+ \xintexprname adds the variant \csbxint{Digits*} which executes \csbxint{reloadxinttrig}.
+\end{framed}
+
+\subsection{\csh{xintSetDigits}}
+\label{xintSetDigits}
+
+To be used as |\xintSetDigits|\marg{expression}\ntype{\numx} where the
+expression will be fed to |\numexpr|. It is a shortcut for doing
+|\xintDigits := \numexpr|\meta{expression}|\relax \relax|\NewWith{1.3f}.
+\begin{everbatim*}
+\xintSetDigits{1+2+3+4+5}The value is now \xinttheDigits.
+\xintSetDigits{2*8}The value is now \xinttheDigits.\par
+\end{everbatim*}
+\begin{framed}
+ See also the \xintexprname-added variant \csbxint{SetDigits*}.
+\end{framed}
\subsection{\csh{xintFloat}}\label{xintFloat}
@@ -12100,7 +12217,7 @@ $2^{31}$ is not quite there yet.
With expressions:
\begin{everbatim*}
-{\xintDigits:=48;\np{\xintthefloatexpr 1.1547^(2^35)\relax}}
+{\xintDigits:=48\relax \np{\xintthefloatexpr 1.1547^(2^35)\relax}}
\end{everbatim*}
There is a subtlety here that the |2^35| will be evaluated as a floating point
@@ -12114,10 +12231,10 @@ efficient to code the above rather as:
Here is an example with
|12^16| as exponent, which has $18$ digits (\dtt{={\xintiiPow{12}{16}}}).
\begin{everbatim*}
-{\xintDigits:=12;\np{\xintthefloatexpr (1+1e-8)^\xintiiexpr 12^16\relax\relax}}\newline
+{\xintDigits:=12\relax \np{\xintthefloatexpr (1+1e-8)^\xintiiexpr 12^16\relax\relax}}\newline
\np{\xintthefloatexpr (1+1e-8)^\xintiiexpr 12^16\relax\relax}\newline
-{\xintDigits:=27;\np{\xintthefloatexpr (1+1e-8)^(12^16)\relax}}\newline
-{\xintDigits:=48;\np{\xintthefloatexpr (1+1e-8)^(12^16)\relax}}
+{\xintDigits:=27\relax \np{\xintthefloatexpr (1+1e-8)^(12^16)\relax}}\newline
+{\xintDigits:=48\relax \np{\xintthefloatexpr (1+1e-8)^(12^16)\relax}}
\end{everbatim*}
There is an important difference between |\xintFloatPower[Q]{X}{Y}| and
@@ -12281,7 +12398,7 @@ The associated function in \csbxint{floatexpr} is \func{pfactorial}:
\xintthefloatexpr pfactorial(2500,5000)\relax
\end{everbatim*}
-\xintDigits:=16;
+\xintDigits:=16\relax
\subsection{\csh{xintFrac}}\label{xintFrac}
@@ -12531,7 +12648,7 @@ operators and functions. This section now adds some complementary information.
\item There is \csbxint{floatexpr}| ... \relax| where the algebra is done
in floating point approximation (also for each intermediate result). Use the
- syntax |\xintDigits:=N;| to set the precision. Default: $16$ digits.
+ syntax |\xintDigits:=N\relax| to set the precision. Default: $16$ digits.
%
\leftedline{|\xintthefloatexpr 2^100000\relax:| \dtt{\xintthefloatexpr
2^100000\relax }}
@@ -12550,7 +12667,7 @@ Here the [60] is to avoid truncation to |\xinttheDigits| of precision on output.
results will easily have hundreds, if not thousands, of digits.
%
\begin{everbatim*}
-\xintDigits:=48;\xintthefloatexpr 2^100000\relax
+\xintDigits:=48\relax \xintthefloatexpr 2^100000\relax
\end{everbatim*}
Only integer and (in |\xintfloatexpr...\relax|) half-integer exponents are
@@ -12789,6 +12906,13 @@ 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{\csh{xintDigits*}, \csh{xintSetDigits*}}
+\label{xintDigits*}
+\label{xintSetDigits*}
+
+These starred variants of \csbxint{Digits} and \csbxint{SetDigits} execute
+\csbxint{reloadxinttrig}.\NewWith{1.3f}
+
\subsection{\csh{xintiexpr}, \csh{xinttheiexpr}}
\label{xintiexpr}\label{xinttheiexpr}\label{thexintiexpr}
@@ -12960,7 +13084,7 @@ is not rounded prior to its use as operand to such a float operation.
|\thexintfloatexpr| is synonym to |\xintthefloatexpr|.
-|\xintDigits:=36;|\xintDigits:=36;
+|\xintDigits:=36\relax|\xintDigits:=36\relax
%
\leftedline{|\xintthefloatexpr
(1/13+1/121)*(1/179-1/173)/(1/19-1/18)\relax|}
@@ -13088,7 +13212,7 @@ hundred expansion steps for the list to be entirely produced.}%
%
\begin{everbatim*}
\begin{figure}[htbp]
-\centering\begin{tikzpicture}[scale=10]\xintDigits:=8;
+\centering\begin{tikzpicture}[scale=10]\xintDigits:=8\relax
\clip (-1.1,-.25) rectangle (.3,.25);
\draw [blue] (-1.1,0)--(1,0);
\draw [blue] (0,-1)--(0,+1);
@@ -13485,46 +13609,47 @@ All the preceeding applies identically for \csbxint{deffunc}, \csbxint{defiifunc
\csa{xintNewIIExpr}, ..., replacing the |#1|, |#2|, ... in the discussion by
the letters used as function arguments.
-Here is a final syntax restriction: it is possible to use sub-expressions only if they use
-\csa{xintexpr}, those with \csa{xinttheexpr}, or \csbxint{eval} are illegal.
+Here is a final syntax restriction: it is possible to use sub-expressions only
+if they use \csbxint{expr} (or \csbxint{eval} since |1.3f|) but using
+\csbxint{theexpr} (or \csbxint{the}) is illegal.
\begin{everbatim*}
\xintNewExpr \FC [4] {#1+\xintexpr #2*#3\relax + #4}
\printnumber{\fixmeaning\FC}
\end{everbatim*}\newline
-works, but
+works, and
+\begin{everbatim*}
+\xintNewExpr \FD [1] {#1+\xinteval{1}}
+\printnumber{\fixmeaning\FD}
+\end{everbatim*}\newline
+also,\CHANGED{1.3f} but
\begin{everbatim}
\xintNewExpr \FD [1] {#1+\xinttheexpr 1\relax}
\end{everbatim}
-or
-\begin{everbatim}
-\xintNewExpr \FD [1] {#1+\xinteval{1}}
-\end{everbatim}
-do not.
+is illegal.
Prior to |1.3e| it would have been possible to do\CHANGED{1.3e}
\begin{everbatim}
-\xintdeffunc FD(t) := t + \xinttheexpr 1\relax ;
+\xintdeffunc FE(t) := t + \xinttheexpr 1\relax ;
\end{everbatim}
and even
\begin{everbatim}
-\xintdeffunc FE(t,u) := t + \xinttheexpr u\relax ;
+\xintdeffunc FF(t,u) := t + \xinttheexpr u\relax ;
\end{everbatim}
-They are now illegal, but fortunately
+They are now illegal, but fortunately things such as
\begin{everbatim*}
-\xintdeffunc FD(t) := t + \xintexpr 1\relax ;
-\end{everbatim*}
+\xintdeffunc FG(t, u, v) := t + \xintexpr u + v\relax ;
+\expandafter\meaning\csname XINT_expr_userfunc_FG\endcsname
+\end{everbatim*}\newline
and even for example
\begin{everbatim*}
-\xintdeffunc FE(t,u) := \xintfloatexpr t + u\relax ;
-\end{everbatim*}
-do work. The latter would not have worked formerly. It now does, see
-\xinttrigname for use case.
+\xintdeffunc FH(t,u, v) := t + \xintfloateval{u + v} ;
+\expandafter\meaning\csname XINT_expr_userfunc_FH\endcsname
+\end{everbatim*}\newline
+do work.\CHANGED{1.3f}
Anyway, one should never use |\xinttheexpr| for sub-expressions but only
|\xintexpr|, so these restrictions on the \csbxint{NewExpr} and
-\csbxint{deffunc} syntax have no importance. However since the package
-provides the high level \csbxint{eval} et al., it may trap some users. But if
-they read the documentation they will have been warned.
+\csbxint{deffunc} syntax are of no real significance.
\subsection{\csh{xintNewFloatExpr}}\label{xintNewFloatExpr}
@@ -13546,17 +13671,17 @@ formula will be evaluated using the precision valid at the time of use.
\xintNewFloatExpr \f [1] {sqrt(#1)}
\f {2} (with \xinttheDigits{} digits of precision).
-{\xintDigits := 32;\f {2} (with \xinttheDigits{} digits of precision).}
+{\xintDigits := 32\relax\f {2} (with \xinttheDigits{} digits of precision).}
\xintNewFloatExpr \f [1] {sqrt(#1)*sqrt(2)}
\f {2} (with \xinttheDigits {} digits of precision).
-\xintDigits := 32;\f {2} (?? we thought we had a higher precision.)
+\xintDigits := 32\relax\f {2} (?? we thought we had a higher precision.)
\xintNewFloatExpr \f [1] {sqrt(#1)*sqrt(2)}
\f {2} (with \xinttheDigits {} digits of precision)
-\xintDigits := 16;% back to default
+\xintDigits := 16\relax back to default
\end{everbatim*}
The |sqrt(2)| in the first |sqrt(#1)*sqrt(2)| NewFloatExpression was computed
@@ -13579,7 +13704,7 @@ Like \csbxint{NewExpr} but using |\xinttheiiexpr|.
Like \csbxint{NewExpr} but using |\xinttheboolexpr|.
-\xintDigits:= 16;
+\xintDigits:= 16\relax
\subsection{The \cshnolabel{xintdefvar}, \cshnolabel{xintdefiivar}, \cshnolabel{xintdeffloatvar} macros}
@@ -13666,7 +13791,7 @@ Note that |\relax| is \emph{mandatory} (contrarily to the situation for |\numexp
I was greatly helped in my preparatory thinking, prior to producing such an
expandable parser, by the commented source of the
-\href{http://www.ctan.org/pkg/l3kernel}{l3fp} package, specifically the
+\href{https://ctan.org/pkg/l3kernel}{l3fp} package, specifically the
|l3fp-parse.dtx| file (in the version of April-May 2013; I think there was in
particular a text called ``roadmap'' which was helpful). Also the source of the
|calc| package was instructive, despite the fact that here for |\xintexpr| the
@@ -13687,23 +13812,30 @@ principles are necessarily different due to the aim of achieving expandability.
This package provides trigonometric functions for use with \xintexprname.
The sole macro is \csbxint{reloadxinttrig}.
-This package was first included in release |1.3e| (|2019/04/01|) of
+This package was first included in release |1.3e| (|2019/04/05|) of
\xintexprname. It is automatically loaded by \xintexprname.
-\textbf{Acknowledgements} I finally decided to release some such functions
+\textbf{Acknowledgements:} I finally decided to release some such functions
under friendly pressure of Jürgen \textsc{Gilg} and Thomas \textsc{Söll}, let
them both be thanked here.
\subsection{\csh{xintreloadxinttrig}}\label{xintreloadxinttrig}
+The library is loaded automatically by \xintexprname, thus with the default
+value of \csbxint{theDigits} which is \dtt{16}. But it can handle a precision
+of up to about \fbox{\dtt{60}} digits (make this \dtt{59} at most for the
+inverse functions). For this, execute for example \csbxint{SetDigits*}|{48}|.
+
\begin{framed}
- After modifying \csbxint{Digits},\IMPORTANTf{} one must issue
- \csbxint{reloadxinttrig} to let the package re-configure itself.
+ Since |1.3f|, the starred variants \csbxint{Digits*}|:=P;| and\NewWithf{1.3f}
+ \csbxint{SetDigits*}\marg{num. expression} execute \csbxint{reloadxinttrig}
+ to let the package re-configure itself.
+
+ The non-starred variants do not execute \csbxint{reloadxinttrig} (to avoid
+ adding artificial overhead to existing documents).\IMPORTANTf{}
\end{framed}
-The library is pre-configured to be able to handle a precision of up to about
-\fbox{\dtt{60}} digits (make this \dtt{59} at most for the inverse functions).
-But absence of guard digits (whether in the used hard-coded constants or in
+Absence of guard digits (whether in the used hard-coded constants or in
passing over values from one auxiliary function to the next) due to high level
(user) interface used for the programming means that the produced values are
definitely expected to be wrong in the last digit or last two digits. I should
@@ -13728,7 +13860,7 @@ into to tell the float macros to work at a somewhat elevated precision.
\subsection{Constants}
-They are the correct rounding to \csbxint{Digits} precision of the
+They are the correct rounding to \csbxint{theDigits} precision of the
mathematically exact ones. Their values get incorporated into the
trigonometrical functions at the time of their definitions during loading or
reloading of the package. They are left free to use, or modified, or
@@ -13800,9 +13932,8 @@ With the value in radians:
\funcdesc{acos} arccosine
\funcdesc{atan} arctangent
\funcdesc[x, y]{Arg} the main branch of the argument of the complex number
-|x+iy|, from $-\pi$ (excluded) to $\pi$ (included). Inherent rounding of
-output makes
--\var{Pi} a possible return value.
+|x+iy|, from $-\pi$ (excluded) to $\pi$ (included). As the output is rounded
+-\var{Pi} is a possible return value.
\funcdesc[x, y]{pArg} the branch of the argument of the complex number
|x+iy| with values going from $0$ (included) to $2\pi$ (excluded). Inherent
rounding makes \var{twoPi} a possible return value.
@@ -13823,7 +13954,7 @@ to be returned.
\funcdesc[x, y]{pArgd} the branch of the argument of the complex number
|x+iy| with values going from $0$ (included) to $360$ (excluded). Inherent rounding of
output can cause |360| to be returned.
-\funcdesc[y, x]{atan2d} it is |Arg(x, y)|. Note the reversal of the arguments,
+\funcdesc[y, x]{atan2d} it is |Argd(x, y)|. Note the reversal of the arguments,
this seems to be the most frequently encountered convention across languages.
\end{description}
@@ -13899,29 +14030,70 @@ an elevated precision and print final results at a lower precision.
whole thing.
\item Floats with large exponents are integers and are multiple of \dtt{1000};
hence modulo \dtt{360} all such ``angles'' are multiple of \dtt{40} degrees.
- Needless to say that considering usage of the sine and cosine functions
+ Needless to say that considering usage of the |sind()| and |cosd()| functions
with such large float numbers is meaningless.
-\item Regarding such a big float angle in radians, \xinttrigname converts
- it to degrees by multiplication by (pre-rounded) $180/\pi$, then it does
- range reduction modulo $360$ and goes back to radians in the appropriate
- octants and use the series (roughly said). Thus |cos()| and |sin()| will be
- evaluated as if at some of the finitely many rounded multiples of (exact)
- $2\pi/9$. When the unit in the last place of the original input was for
- example \dtt{1e9} it is clear that the final result means nothing at all;
- this intrinsic problem is not one of conversion from radians to degrees: the
- unit in the last place interval extends above possibly astronomical numbers of
- intervals of length $2\pi$. This is an in-built inadequacy of (large)
- floating point numbers for trigonometrical evaluations; the argument should
- be treated then as a uniformly distributed random variable modulo $2\pi$,
- and the sine and cosine values should be random variables realizing the value
- distribution of these mathematical functions. Clearly this adds some
- programming complication of deciding how to make the transition. Too lazy
- for that.
+\item Regarding |sin()| and |cos()|, \xinttrigname converts their argument to
+ degrees by multiplication by (pre-rounded) $180/\pi$, then does range
+ reduction modulo $360$ and finally goes back to radians in the appropriate
+ octants to use usual Taylor series (roughly said). For large floats, the
+ output value will thus be one of |sind(40n)|, |cosd(40n)|, |n=0..8|. If the
+ unit in the last place of original variable was for example \dtt{1e9} the
+ final result means nothing at all: the unit in the last place interval
+ extends above possibly astronomical numbers of intervals of length $2\pi$.
+
+ This intrinsic problem is not a by-product of conversion problems to and
+ from degrees, it is an in-built inadequacy of the concept of floating point
+ numbers to provide meaning to evaluating trigonometrical functions. The
+ argument should be treated as a uniformly distributed random variable modulo
+ $2\pi$, and the sine and cosine values should be random variables realizing
+ the value distribution of these mathematical functions. Clearly this adds
+ some (rather severe) implementation complications such as deciding how to
+ make the transition to randomness. Too lazy for that.
+
+ Opting for a random value also raises the question of how to deal with
+ multiple such evaluations at the same argument in a single expression. I
+ would argue again that as it is evil to consider meaningless quantities, it
+ is not a problem if new compilations give different results, or even single
+ compilation gives different results in various parts of the same formula,
+ that's the whole point of randomness! As said already, I got too lazy to
+ consider seriously implementing such a non-standard philosophy, despite its
+ compelling soundness.
\item Did I say the implementation was done at very high level (for the most
part), hence has ample room for optimization? This is particularly the case
for the handling of small inputs by functions such as sine or arcsine.
\end{itemize}
+\subsection{Some example evaluations}
+
+\noindent
+\begin{everbatim*}
+\xintDigits* := 50\relax % target 48 digits via 2 guard digits
+$sind(17)\approx\xintfloateval{[-2] sind(17)}$\newline
+$cosd(17)\approx\xintfloateval{[-2] cosd(17)}$\newline
+$tand(17)\approx\xintfloateval{[-2] tand(17)}$\newline
+$sind(43)\approx\xintfloateval{[-2] sind(43)}$\newline
+$cosd(43)\approx\xintfloateval{[-2] cosd(43)}$\newline
+$tand(43)\approx\xintfloateval{[-2] tand(43)}$\newline
+$asind(0.3)\approx\xintfloateval{[-2] asind(0.3)}$\newline
+$acosd(0.3)\approx\xintfloateval{[-2] acosd(0.3)}$\newline
+$atand(3)\approx\xintfloateval{[-2] atand(3)}$\newline
+$tan(atan(7))\approx\xintfloateval{[-2] tan(atan(7))}$\newline
+$asind(sind(25))\approx\xintfloateval{[-2] asind(sind(25))}$\par\medskip
+\noindent\xintDigits* := 26\relax % target 24 digits via 2 guard digits
+$sind(17)\approx\xintfloateval{[-2] sind(17)}$\newline
+$cosd(17)\approx\xintfloateval{[-2] cosd(17)}$\newline
+$tand(17)\approx\xintfloateval{[-2] tand(17)}$\newline
+$sind(43)\approx\xintfloateval{[-2] sind(43)}$\newline
+$cosd(43)\approx\xintfloateval{[-2] cosd(43)}$\newline
+$tand(43)\approx\xintfloateval{[-2] tand(43)}$\newline
+$asind(0.3)\approx\xintfloateval{[-2] asind(0.3)}$\newline
+$acosd(0.3)\approx\xintfloateval{[-2] acosd(0.3)}$\newline
+$atand(3)\approx\xintfloateval{[-2] atand(3)}$\newline
+$tan(atan(7))\approx\xintfloateval{[-2] tan(atan(7))}$\newline
+$asind(sind(25))\approx\xintfloateval{[-2] asind(sind(25))}$\par
+\xintDigits* := 16\relax
+\end{everbatim*}
+
\clearpage
\let\xinttrignameUp\undefined
\csname xintlognameUp\endcsname
@@ -13937,13 +14109,19 @@ an elevated precision and print final results at a lower precision.
This package provides logarithms, exponentials and fractional powers for use
with \xintexprname.
-This package was first included in release |1.3e| (|2019/04/01|) of
+This package was first included in release |1.3e| (|2019/04/05|) of
\xintexprname. It is automatically loaded by \xintexprname.
-Currently it is a wrapper to import package
-\href{http://www.ctan.org/pkg/poormanlog}{poormanlog} which computes with
-\dtt{8} or \dtt{9} digits of precision, adding the \func{log}, \func{exp}, and
-\func{pow} function to the \func{log10} and \func{pow10} provided by the package.
+Currently, the functions \func{log10}, \func{pow10}, \func{log}, \func{exp},
+and \func{pow} use at their core two fast expandable macros handling base 10
+logarithms and powers for mantissas of 9 digit tokens. They are
+defined by package \href{https://ctan.org/pkg/poormanlog}{poormanlog} which is
+automatically imported. The error is believed to be at most \dtt{2ulp} (see
+its |README|). The package \href{https://ctan.org/pkg/poormanlog}{poormanlog}
+has no dependencies and can be imported by any other \TeX\ macro file.
+
+Although the precision is thus limited to about \dtt{8} or \dtt{9} digits this
+is amply enough for plots.
\subsection{\csh{poormanloghack}}
\label{ssec:poormanloghack}
@@ -13960,8 +14138,6 @@ If used, they obey \TeX\ scoping as usual.
\poormanloghack{**}\xintfloateval{[8]1.234**5.678}\newline
\poormanloghack{^}\xintfloateval{[8]1.234^5.678}\par
\endgroup
-% ** and ^ now do not accept fractional exponents: only half-integer ones and
-% only in \xintfloateval, not \xinteval.
\end{everbatim*}
Notice that in \csbxint{floateval} those (equivalent) operators already
@@ -13993,7 +14169,7 @@ first 8 or 9 digits of the output are significant...
\end{everbatim*}
Notice that the last digit of |log(2)| is not the correctly rounded one... I
did say 9 \textbf{or} 8 digits or precision... The documentation of
-\href{http://www.ctan.org/pkg/poormanlog}{poormanlog} mentions an error of up
+\href{https://ctan.org/pkg/poormanlog}{poormanlog} mentions an error of up
to 2 units in the ninth digit when computing |log10(x)| for |1<x<10| and
|10^x| for |0<x<1|.
@@ -15223,7 +15399,7 @@ laptop (a 2012 model) this took about $5.05$ seconds last time I tried.%
denominators at most $9999$). The |1.2| \xintcorename achieves a further
gain at \dtt{5.6} seconds.}
%
-\footnote{With |\xintDigits:=1001;|, the non-optimized implementation with the
+\footnote{With |\xintDigits:=1001\relax|, the non-optimized implementation with the
|iter| of \xintexprname fame using the
\hyperlink{BrentSalamin}{Brent-Salamin algorithm}, took, last time I tried
(1.2i), about \dtt{7} seconds on my laptop (the last two digits were wrong,
@@ -15247,7 +15423,7 @@ laptop (a 2012 model) this took about $5.05$ seconds last time I tried.%
As mentioned in the
-introduction, the file \href{http://www.ctan.org/pkg/pi}{pi.tex} by \textsc{D.
+introduction, the file \href{https://ctan.org/pkg/pi}{pi.tex} by \textsc{D.
Roegel} shows that orders of magnitude faster computations are possible within
\TeX{}, but recall our constraints of complete expandability and be merciful,
please.
@@ -17734,7 +17910,7 @@ be treated as first item) number.
\makeatother
-\section{Introduction to the implementation (recent changes)}
+\section{Introduction to this document and (very much) shortened version history}
This is \expandafter|\xintbndlversion| of \expandafter|\xintbndldate|.
@@ -17751,9 +17927,11 @@ in PDF viewers. Already the local tables of contents are useful enough most of
the time when one searches something.
\begin{itemize}
-\item Release |1.3e| of |2019/04/01|: \xinttrignameimp, \xintlognameimp,
- \csbxint{defefunc} ``non-protected'' variant of \csbxint{deffunc}. Indices
- removed from |sourcexint.pdf|.
+\item Release |1.3f| of |2019/09/10|: starred variant \csbxint{Digits*}.
+\item Release |1.3e| of |2019/04/05|: \xinttrignameimp, \xintlognameimp,
+ \csbxint{defefunc} ``non-protected'' variant of \csbxint{deffunc}.
+
+ Indices removed from |sourcexint.pdf|.
\item Release |1.3d| of |2019/01/06|: bugfix of |1.2p| bug for division with a
zero dividend and a one-digit divisor, \csbxint{eval} et al. wrappers,
|gcd()| and |lcm()| work with fractions.
@@ -17995,7 +18173,7 @@ math shift catcode.
\fi
\XINT_providespackage
\ProvidesPackage {xintkernel}%
- [2019/04/05 1.3e Paraphernalia for the xint packages (JFB)]%
+ [2019/09/10 v1.3f Paraphernalia for the xint packages (JFB)]%
% \end{macrocode}
% \subsection{Constants}
% \begin{macrocode}
@@ -18669,7 +18847,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xinttools}%
- [2019/04/05 1.3e Expandable and non-expandable utilities (JFB)]%
+ [2019/09/10 v1.3f 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.|
@@ -20638,7 +20816,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintcore}%
- [2019/04/05 1.3e Expandable arithmetic on big integers (JFB)]%
+ [2019/09/10 v1.3f 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
@@ -21565,11 +21743,6 @@ math shift catcode.
{%
\expandafter\XINT_add_nfork\expandafter#1\romannumeral`&&@#3\xint:#2\xint:
}%
-\def\XINT_iadd #1#2\xint:#3%
-{%
- \expandafter\XINT_add_nfork\expandafter
- #1\romannumeral0\xintnum{#3}\xint:#2\xint:
-}%
\def\XINT_add_fork #1#2\xint:#3\xint:{\XINT_add_nfork #1#3\xint:#2\xint:}%
\def\XINT_add_nfork #1#2%
{%
@@ -21658,7 +21831,7 @@ math shift catcode.
% but not have to check lengths), and I will probably remove it at some point.
%
% Output: blocks of 1<8d>! representing the addition, (least significant
-% first), and a final 1;!. In recursive algotithm this 1;! terminator can
+% first), and a final 1;!. In recursive algorithm this 1;! terminator can
% thus conveniently be reused as part of input terminator (up to the length
% problem).
%
@@ -21756,10 +21929,6 @@ math shift catcode.
{%
\expandafter\XINT_cmp_nfork\expandafter #1\romannumeral`&&@#3\xint:#2\xint:
}%
-\def\XINT_icmp #1#2\xint:#3%
-{%
- \expandafter\XINT_cmp_nfork\expandafter #1\romannumeral0\xintnum{#3}\xint:#2\xint:
-}%
\def\XINT_cmp_nfork #1#2%
{%
\xint_UDzerofork
@@ -21858,7 +22027,7 @@ math shift catcode.
%
% Refactored at 1.2l. I was initially aiming at clinching some internal format
% of the type 1<8digits>!....1<8digits>! for chaining the arithmetic
-% operations (as a preliminary step to decided upon some internal format for
+% operations (as a preliminary step to deciding upon some internal format for
% $xintfracnameimp macros), thus I wanted to uniformize delimiters in
% particular and have some core macros inputting and outputting such formats.
% But the way division is implemented makes it currently very hard to obtain a
@@ -21889,11 +22058,6 @@ math shift catcode.
\expandafter\XINT_sub_nfork\expandafter
#1\romannumeral`&&@#3\xint:#2\xint:
}%
-\def\XINT_isub #1#2\xint:#3%
-{%
- \expandafter\XINT_sub_nfork\expandafter
- #1\romannumeral0\xintnum{#3}\xint:#2\xint:
-}%
\def\XINT_sub_nfork #1#2%
{%
\xint_UDzerofork
@@ -23314,9 +23478,6 @@ math shift catcode.
% \begin{macrocode}
\def\xintiiDivRound {\romannumeral0\xintiidivround }%
\def\xintiidivround #1{\expandafter\XINT_iidivround\romannumeral`&&@#1\xint:}%
-\def\XINT_idivround #1#2\xint:#3%
- {\expandafter\XINT_iidivround_a\expandafter #1%
- \romannumeral0\xintnum{#3}\xint:#2\xint:}%
\def\XINT_iidivround #1#2\xint:#3%
{\expandafter\XINT_iidivround_a\expandafter #1\romannumeral`&&@#3\xint:#2\xint:}%
\def\XINT_iidivround_a #1#2% #1 de A, #2 de B.
@@ -23955,7 +24116,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xint}%
- [2019/04/05 1.3e Expandable operations on big integers (JFB)]%
+ [2019/09/10 v1.3f Expandable operations on big integers (JFB)]%
% \end{macrocode}
% \subsection{More token management}
% \begin{macrocode}
@@ -26379,7 +26540,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintbinhex}%
- [2019/04/05 1.3e Expandable binary and hexadecimal conversions (JFB)]%
+ [2019/09/10 v1.3f Expandable binary and hexadecimal conversions (JFB)]%
% \end{macrocode}
% \subsection{Constants, etc...}
% \lverb|1.2n switches to \csname-governed expansion at various places.|
@@ -27031,7 +27192,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintgcd}%
- [2019/04/05 1.3e Euclide algorithm with xint package (JFB)]%
+ [2019/09/10 v1.3f Euclide algorithm with xint package (JFB)]%
% \end{macrocode}
% \subsection{\csh{xintGCD}, \csh{xintiiGCD}}
% \lverb|&
@@ -27741,7 +27902,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintfrac}%
- [2019/04/05 1.3e Expandable operations on fractions (JFB)]%
+ [2019/09/10 v1.3f 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
@@ -29406,16 +29567,6 @@ math shift catcode.
#2\romannumeral\XINT_rep#1\endcsname0.\romannumeral\XINT_rep#3\endcsname0%
}%
% \end{macrocode}
-% \subsection{\csh{xintDigits}}
-% \lverb|The mathchardef used to be called \XINT_digits, but for reasons
-% originating in \xintNewExpr (and now obsolete), release 1.09a uses
-% \XINTdigits without underscore.|
-% \begin{macrocode}
-\mathchardef\XINTdigits 16
-\def\xintDigits #1#2%
- {\afterassignment \xint_gobble_i \mathchardef\XINTdigits=}%
-\def\xinttheDigits {\number\XINTdigits }%
-% \end{macrocode}
% \subsection{\csh{xintAdd}}
% \lverb|Big change at 1.3: a/b+c/d uses lcm(b,d) as denominator.|
% \begin{macrocode}
@@ -30252,6 +30403,20 @@ math shift catcode.
% cost of fetching long sequences of tokens.
% \end{framed}
%
+% \subsection{\csh{xintDigits}, \csh{xintSetDigits}}
+% \lverb|&
+% 1.3f modifies the (strange) original signature #1#2 for \xintDigits macro
+% into #1=, allowing usage
+% without colon. It also adds \xintSetDigits. Starred variants are added
+% by xintexpr.sty.
+% |
+% \begin{macrocode}
+\mathchardef\XINTdigits 16
+\def\xintDigits #1=%
+ {\afterassignment \xint_gobble_i \mathchardef\XINTdigits=}%
+\def\xinttheDigits {\number\XINTdigits }%
+\def\xintSetDigits #1{\mathchardef\XINTdigits=\numexpr#1\relax}%
+% \end{macrocode}
%
% \subsection{\csh{xintFloat}}
% \lverb|&
@@ -32457,6 +32622,75 @@ math shift catcode.
\romannumeral`&&@\expandafter\XINT_eightrandomdigits
\romannumeral`&&@\XINT_eightrandomdigits[-16]%
}%
+% \end{macrocode}
+% \subsection{\csh{PoorManLogBaseTen}}
+% \lverb|1.3f. Code originally in poormanlog v0.4 got transferred here. It
+% produces the logarithm in base 10 with an error (believed to be at
+% most) about 1 unit in the 9th (i.e. last) fractional digit. Testing seems
+% to indicate error at most 2 units.|
+% \begin{macrocode}
+\def\PoorManLogBaseTen{\romannumeral0\poormanlogbaseten}%
+\def\poormanlogbaseten #1%
+ {\expandafter\PML@logbaseten\romannumeral0\XINTinfloat[9]{#1}}%
+\def\PML@logbaseten#1[#2]%
+{%
+ \xintiiadd{\xintDSx{-9}{\the\numexpr#2+8\relax}}{\the\numexpr\PML@#1.}%
+ [-9]%
+}%
+% \end{macrocode}
+% \subsection{\csh{PoorManPowerOfTen}}
+% \lverb|1.3f. Transferred from poormanlog v0.4. Produces the 10^#1 with 9
+% digits of float precision, with an error (believed to be) at most 2 units in
+% the last place. Of course for this the input must be precise enough to have
+% 9 fractional digits of **fixed point** precision.|
+% \begin{macrocode}
+\def\PoorManPowerOfTen{\the\numexpr\poormanpoweroften}%
+\def\poormanpoweroften #1%
+ {\expandafter\PML@powoften\romannumeral0\xintraw{#1}}%
+\def\PML@powoften#1%
+{%
+ \xint_UDzerominusfork
+ #1-\PML@powoften@zero
+ 0#1\PML@powoften@neg
+ 0-\PML@powoften@pos
+ \krof #1%
+}%
+\def\PML@powoften@zero 0{1\relax}%/1[0]
+\def\PML@powoften@pos#1[#2]%
+{%
+ \expandafter\PML@powoften@pos@a\romannumeral0\xintround{9}{#1[#2]}.%
+}%
+\def\PML@powoften@pos@a#1.#2.{\PML@Pa#2.\expandafter[\the\numexpr-8+#1]}%
+\def\PML@powoften@neg#1[#2]%
+{%
+ \expandafter\PML@powoften@neg@a\romannumeral0\xintround{9}{#1[#2]}.%
+}%
+\def\PML@powoften@neg@a#1.#2.%
+{\ifnum#2=\xint_c_ \xint_afterfi{1\relax/1[#1]}\else
+ \expandafter\expandafter\expandafter
+ \PML@Pa\expandafter\xint_gobble_i\the\numexpr2000000000-#2.%
+ \expandafter[\the\numexpr-9+#1\expandafter]\fi
+}%
+% \end{macrocode}
+% \subsection{\csh{PoorManPower}}
+% \lverb|1.3f. This code originally in poormanlog v0.4 transferred here. It does
+% #1 to the power #2.|
+% \begin{macrocode}
+\def\PoorManPower#1#2%
+{%
+ \PoorManPowerOfTen{\xintMul{#2}{\PoorManLogBaseTen{#1}}}%
+}%
+% \end{macrocode}
+% \subsection{Support macros for natural logarithm and exponential
+% \xintexprnameimp functions}
+% \lverb|At 1.3f, the poormanlog v0.04 extension to xintfrac.sty got
+% transferred here. These macros from xintlog.sty 1.3e got transferred here
+% too.|
+% \begin{macrocode}
+\def\xintLog#1{\xintMul{\PoorManLogBaseTen{#1}}{23025850923[-10]}}%
+\def\XINTinFloatLog#1{\XINTinFloatMul{\PoorManLogBaseTen{#1}}{23025850923[-10]}}%
+\def\xintExp#1{\PoorManPowerOfTen{\xintMul{#1}{434294481903[-12]}}}%
+\def\XINTinFloatExp#1{\PoorManPowerOfTen{\XINTinFloatMul{#1}{434294481903[-12]}}}%
\XINT_restorecatcodes_endinput%
% \end{macrocode}
% \StoreCodelineNo {xintfrac}
@@ -32532,7 +32766,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintseries}%
- [2019/04/05 1.3e Expandable partial sums with xint package (JFB)]%
+ [2019/09/10 v1.3f Expandable partial sums with xint package (JFB)]%
% \end{macrocode}
% \subsection{\csh{xintSeries}}
% \begin{macrocode}
@@ -33033,7 +33267,7 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintcfrac}%
- [2019/04/05 1.3e Expandable continued fractions with xint package (JFB)]%
+ [2019/09/10 v1.3f Expandable continued fractions with xint package (JFB)]%
% \end{macrocode}
% \subsection{\csh{xintCFrac}}
% \begin{macrocode}
@@ -34282,10 +34516,21 @@ math shift catcode.
% \begin{macrocode}
\XINT_providespackage
\ProvidesPackage{xintexpr}%
- [2019/04/05 1.3e Expandable expression parser (JFB)]%
+ [2019/09/10 v1.3f Expandable expression parser (JFB)]%
\catcode`! 11
\let\XINT_Cmp \xintiiCmp
% \end{macrocode}
+% \subsection{\csh{xintDigits*}, \csh{xintSetDigits*}}
+% \lverb|1.3f|
+% \begin{macrocode}
+\def\xintDigits {\futurelet\XINT_token\xintDigitss}%
+\def\xintDigitss #1={\afterassignment\xintDigitsss\mathchardef\XINTdigits=}%
+\def\xintDigitsss#1{\ifx*\XINT_token\expandafter\xintreloadxinttrig\fi}%
+\let\xintfracSetDigits\xintSetDigits
+\def\xintSetDigits#1#{\if\relax\detokenize{#1}\relax
+ \else\afterassignment\xintreloadxinttrig\fi
+ \xintfracSetDigits}%
+% \end{macrocode}
% \subsection{\csh{xintexpr}, \csh{xintiexpr}, \csh{xintfloatexpr},
% \csh{xintiiexpr}}
% \lverb|ATTENTION! 1.3d renamed \xinteval to \xintexpro etc...|
@@ -34306,7 +34551,8 @@ math shift catcode.
%
% ATTENTION! 1.3d renamed \xinteval to \xintexpro etc...
%
-% Some renaming of macros at 1.3e here.|
+% Some renaming of macros at 1.3e here. Again at 1.3f with some real changes
+% (to fix the \xintfloatexpr [D] issue inside \xintdeffunc).|
% \begin{macrocode}
\def\xintiexpro #1%
{%
@@ -34315,16 +34561,16 @@ math shift catcode.
}%
\def\XINT_iexpr_noopt
{%
- \expandafter\XINT_iexpr_preprint\expandafter 0%
+ \expandafter\XINT_iexpr_round\expandafter 0%
\romannumeral0\xintbareeval
}%
\def\XINT_iexpr_withopt [#1]%
{%
- \expandafter\XINT_iexpr_preprint\expandafter
+ \expandafter\XINT_iexpr_round\expandafter
{\the\numexpr \xint_zapspaces #1 \xint_gobble_i\expandafter}%
\romannumeral0\xintbareeval
}%
-\def\XINT_iexpr_preprint #1#2%
+\def\XINT_iexpr_round #1#2%
{%
\expandafter\XINT_expr_wrap
\csname .=\xintRound::csv {#1}{\XINT_expr_unlock #2}\endcsname
@@ -34336,21 +34582,37 @@ math shift catcode.
}%
\def\XINT_flexpr_noopt
{%
- \expandafter\XINT_flexpr_preprint\expandafter\xinttheDigits
- \romannumeral0\xintbarefloateval
+ \expandafter\XINT_flexpr_noopt_a\romannumeral0\xintbarefloateval
+}%
+\def\XINT_flexpr_noopt_a #1%
+{%
+ \expandafter\XINT_flexpr_wrap
+ \csname .;\xinttheDigits.=\XINT_expr_unlock #1\endcsname
}%
\def\XINT_flexpr_withopt [#1]%
{%
- \expandafter\XINT_flexpr_preprint\expandafter
- {\the\numexpr\xint_zapspaces #1 \xint_gobble_i\expandafter}%
+ \expandafter\XINT_flexpr_withopt_a
+ \the\numexpr\xint_zapspaces #1 \xint_gobble_i\expandafter.%
\romannumeral0\xintbarefloateval
}%
-\def\XINT_flexpr_preprint #1#2%
+\def\XINT_flexpr_withopt_a #1.#2%
{%
\expandafter\XINT_flexpr_wrap
\csname .;#1.=\XINTinFloat::csv {#1}{\XINT_expr_unlock #2}\endcsname
}%
% \end{macrocode}
+% \lverb|&
+% 1.3f fixes some problems with using \xintfloatexpr [D]..\relax as a sub
+% expression inside \xintdeffunc. Comma separated expressions are not allowed
+% inside such sub-expression.
+% |
+% \begin{macrocode}
+\def\XINT:NE_flexpr_withopt_a #1.#2%
+{%
+ \expandafter\XINT_flexpr_wrap
+ \csname .;#1.=\XINT:NE:one{\XINTinFloat::csv{#1}}{\XINT_expr_unlock #2}\endcsname
+}%
+% \end{macrocode}
% \subsection{\csh{XINT_expr_wrap}, \csh{XINT_iiexpr_wrap}, \csh{XINT_flexpr_wrap}}
% \lverb|1.3e removes some leading space tokens which served nothing. There is
% no \XINT_iexpr_wrap, because \XINT_expr_wrap is used directly.|
@@ -34367,7 +34629,11 @@ math shift catcode.
% \subsection{\csh{XINT_expr_print}, \csh{XINT_iiexpr_print}, \csh{XINT_flexpr_print}}
% \begin{macrocode}
\def\XINT_expr_print #1{\xintSPRaw::csv {\XINT_expr_unlock #1}}%
-\def\XINT_iiexpr_print #1{\xintCSV::csv {\XINT_expr_unlock #1}}%
+\def\XINT:NE_expr_print#1{\expandafter
+ \xintSPRaw::csv\expandafter{\romannumeral`&&@\XINT_expr_unlock #1}}%
+\def\XINT_iiexpr_print #1{\xintCSV::csv {\XINT_expr_unlock #1}}%
+\def\XINT:NE_iiexpr_print #1{\expandafter
+ \xintCSV::csv\expandafter{\romannumeral`&&@\XINT_expr_unlock #1}}%
\def\XINT_flexpr_print #1%
{%
\expandafter\xintPFloat::csv
@@ -34412,6 +34678,18 @@ math shift catcode.
\def\xintiieval #1%
{\romannumeral`&&@\expandafter\XINT_iiexpr_print\romannumeral0\xintbareiieval#1\relax}%
% \end{macrocode}
+% \lverb|The «print» macros are made into inert entities when an expression is
+% parsed by \xintNewExpr or \xintdeffunc. In order to allow usage of \xinteval
+% et al., we need to replace them by the corresponding \xintexpr et al and
+% drop the macro wrappers (because they do not expand and will trap the
+% expression parser). The behaviour of \xinteval{3}7 will not be as in a
+% normal expression but such syntax is anyhow obscure.|
+% \begin{macrocode}
+\def\XINT:NE:eval #1{\xintexpr #1\relax}%
+\def\XINT:NE:ieval #1{\xintiexpr #1\relax}%
+\def\XINT:NE:floateval#1{\xintfloatexpr #1\relax}%
+\def\XINT:NE:iieval #1{\xintiiexpr #1\relax}%
+% \end{macrocode}
% \subsection{\csh{xintthe}}
% \begin{macrocode}
\def\xintthe #1{\romannumeral`&&@\expandafter\xint_gobble_iii\romannumeral`&&@#1}%
@@ -34441,7 +34719,9 @@ math shift catcode.
\XINT_boolexpr_done\expandafter\xint_gobble_iv\romannumeral0\xintexpro
}%
\def\XINT_boolexpr_done {!\XINT_expr_usethe\XINT_protectii\XINT_boolexpr_print}%
-\def\XINT_boolexpr_print #1{\xintIsTrue::csv {\XINT_expr_unlock #1}}%
+\def\XINT_boolexpr_print #1{\xintIsTrue::csv {\XINT_expr_unlock #1}}%
+\def\XINT:NE_boolexpr_print #1{\expandafter
+ \xintIsTrue::csv\expandafter{\romannumeral`&&@\XINT_expr_unlock #1}}%
\def\xinttheboolexpr
{%
\romannumeral`&&@\expandafter\expandafter\expandafter
@@ -38521,7 +38801,7 @@ math shift catcode.
\def\XINT_expr_defuserefunc_none #1#2#3%
{%
\expandafter\XINT_expr_defuserefunc_none_a
- \csname XINT_#3_userefunc_#2\endcsname
+ \csname XINT_#3_userefunc_#2\endcsname #1%
}%
\def\XINT_expr_defuserefunc_none_a #1#2%
{%
@@ -38869,27 +39149,22 @@ math shift catcode.
\xint_orthat{#3}%
}%
% \end{macrocode}
-% \lverb|Problème pour autoriser ici qu'une liste arrive comme argument qui
-% potentiellement en donnerait deux mais pour le moment on ne sait pas. Donc
-% j'impose le prérequis que \XINT:NE:twosp soit toujours suivi de deux items
-% exactement.
-%
-% Il y a eu des modifications à 1.3e car j'ai supprimé des choses que je ne
-% comprenais pas puis je les ai remises lorsque je comprenais mais sans doute
-% pas pareil (certains tests passent et pas avant) et ensuite je ne comprenais
-% plus à nouveau.|
+% \lverb|&
+% At 1.3f, added braces around #1 and #3 in \XINT:NE:one to handle the
+% \xintfloatexpr [D] issue inside an \xintdeffunc.
+% |
% \begin{macrocode}
\def\XINT:NE:twosp#1#2,#3#4,!#5%
{%
\XINT:NE:two_fork_dd#1#3{#5}{\detokenize{#5}}{#1#2}{#3#4}%
}%
-\def\XINT:NE:one#1#2{\expandafter\XINT:NE:one_a\romannumeral`&&@#2!#1}%
+\def\XINT:NE:one#1#2{\expandafter\XINT:NE:one_a\romannumeral`&&@#2!{#1}}%
\def\XINT:NE:one_a#1#2!#3%
{%
\if ###1\xint_dothis {\detokenize{#3}}\fi
\if ~#1\xint_dothis {\detokenize{#3}}\fi
\if $#1\xint_dothis {~xintApply::csv{\detokenize{#3}}}\fi %$
- \xint_orthat #3{#1#2}%
+ \xint_orthat {#3}{#1#2}%
}%
% \end{macrocode}
% \lverb|\xintExpandArgs is defined in xinttools.sty (I don't recall why; not
@@ -39104,7 +39379,6 @@ math shift catcode.
\let\xintiiifSgn: \xintiiifSgnNE:
\let\xintSeqNumeric::csv \xintSeq::csv
\let\xintiiSeqNumeric::csv \xintiiSeq::csv
- \let\XINTinFloatSeqNumeric::csv \XINTinFloatSeq::csv
\let\xintSeqBNumeric::csv \xintSeqB::csv
\let\xintiiSeqBNumeric::csv \xintiiSeqB::csv
\let\XINTinFloatSeqBNumeric::csv\XINTinFloatSeqB::csv
@@ -39112,8 +39386,6 @@ math shift catcode.
{\XINT:NE:two_\xintSeqNumeric::csv{$noexpand$xintSeq::csv}}%
\def\xintiiSeq::csv
{\XINT:NE:two_\xintiiSeqNumeric::csv{$noexpand$xintiiSeq::csv}}%
- \def\XINTinFloatSeq::csv
- {\XINT:NE:two_\XINTinFloatSeqNumeric::csv{$noexpand$XINTinFloatSeq::csv}}%
\def\xintSeqB::csv
{\XINT:NE:two_\xintSeqBNumeric::csv{$noexpand$xintSeqB:f:csv}}%
\def\xintiiSeqB::csv
@@ -39125,37 +39397,34 @@ math shift catcode.
\def\XINTinRandomFloatSixteen{~XINTinRandomFloatSixteen }%
\def\xintiiRandRange{~xintiiRandRange }%
\def\xintiiRandRangeAtoB{~xintiiRandRangeAtoB }%
+% \end{macrocode}
+% \lverb|1.3f authorizes usage of \xinteval et al. inside expression
+% definitions. The computed value must end up purely numerical.
+% |
+% \begin{macrocode}
+ \let\xinteval\XINT:NE:eval
+ \let\xintieval\XINT:NE:ieval
+ \let\xintiieval\XINT:NE:iieval
+ \let\xintfloateval\XINT:NE:floateval
}%
% \end{macrocode}
% \subsubsection{\csh{XINT_expr_redefineprints}}
-% \lverb|This is used by \xintNewExpr and prior to 1.3e not by \xintdeffunc,
-% presumably to avoid some supposedly unneeded overhead. Now also used by
-% \xintdeffunc see some comment further below for why.
+% \lverb|&
+% This was used by \xintNewExpr but not by \xintdeffunc until 1.3e.
+% Since then, used by both.
+%
+% Comma separated sub-expressions are not supported, the expansion
+% is inhibited but it is not checked if it would have given strictly
+% more than one value.
+%
% |
% \begin{macrocode}
\def\XINT_expr_redefineprints
{%
- \def\XINT_flexpr_noopt
- {%
- \expandafter
- \XINT_flexpr_preprint\expandafter-\romannumeral0\xintbarefloateval
- }%
- \def\XINT_flexpr_preprint ##1##2%
- {%
- \expandafter\XINT_flexpr_wrap
- \csname .;##1.=\XINT_expr_unlock##2\endcsname
- }%
- \def\XINT_expr_unlock_sp ##1.;##2##3.=##4!%
- {%
- \if -##2\expandafter\xint_firstoftwo\else\expandafter\xint_secondoftwo\fi
- \XINTdigits{{##2##3}}{##4}%
- }%
- \def\XINT_expr_print ##1{\expandafter
- \xintSPRaw::csv\expandafter{\romannumeral`&&@\XINT_expr_unlock ##1}}%
- \def\XINT_iiexpr_print ##1{\expandafter
- \xintCSV::csv\expandafter{\romannumeral`&&@\XINT_expr_unlock ##1}}%
- \def\XINT_boolexpr_print ##1{\expandafter
- \xintIsTrue::csv\expandafter{\romannumeral`&&@\XINT_expr_unlock ##1}}%
+ \let\XINT_flexpr_withopt_a\XINT:NE_flexpr_withopt_a
+ \let\XINT_expr_print \XINT:NE_expr_print
+ \let\XINT_iiexpr_print \XINT:NE_iiexpr_print
+ \let\XINT_boolexpr_print \XINT:NE_boolexpr_print
\def\xintCSV::csv {~xintCSV::csv }%
\def\xintSPRaw::csv {~xintSPRaw::csv }%
\def\xintPFloat::csv {~xintPFloat::csv }%
@@ -39168,17 +39437,22 @@ math shift catcode.
% 1.2c modifications to accomodate \XINT_expr_deffunc_newexpr etc..
%
% 1.2f adds token \XINT_newexpr_clean to be able to have a different
-% \XINT_newfunc_clean.|
+% \XINT_newfunc_clean.
+%
+% As \XINT_NewExpr always execute \XINT_expr_redefineprints since 1.3e whether
+% with \xintNewExpr or \XINT_NewFunc, it has been moved from argument to
+% hardcoded in replacement text.
+% |
% \begin{macrocode}
-\def\xintNewExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone
+\def\xintNewExpr {\XINT_NewExpr\xint_firstofone
\xinttheexpr\XINT_newexpr_clean}%
-\def\xintNewFloatExpr{\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone
+\def\xintNewFloatExpr{\XINT_NewExpr\xint_firstofone
\xintthefloatexpr\XINT_newexpr_clean}%
-\def\xintNewIExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone
+\def\xintNewIExpr {\XINT_NewExpr\xint_firstofone
\xinttheiexpr\XINT_newexpr_clean}%
-\def\xintNewIIExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone
+\def\xintNewIIExpr {\XINT_NewExpr\xint_firstofone
\xinttheiiexpr\XINT_newexpr_clean}%
-\def\xintNewBoolExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone
+\def\xintNewBoolExpr {\XINT_NewExpr\xint_firstofone
\xinttheboolexpr\XINT_newexpr_clean}%
\def\XINT_newexpr_clean #1>{\noexpand\romannumeral`&&@}%
% \end{macrocode}
@@ -39187,11 +39461,11 @@ math shift catcode.
% At 1.3, NewFunc does not use a comma delimited pattern anymore.|
% \begin{macrocode}
\def\XINT_NewFunc
- {\XINT_NewExpr\XINT_expr_redefineprints\xint_gobble_i\xintthebareeval\XINT_newfunc_clean}%
+ {\XINT_NewExpr\xint_gobble_i\xintthebareeval\XINT_newfunc_clean}%
\def\XINT_NewFloatFunc
- {\XINT_NewExpr\XINT_expr_redefineprints\xint_gobble_i\xintthebarefloateval\XINT_newfunc_clean}%
+ {\XINT_NewExpr\xint_gobble_i\xintthebarefloateval\XINT_newfunc_clean}%
\def\XINT_NewIIFunc
- {\XINT_NewExpr\XINT_expr_redefineprints\xint_gobble_i\xintthebareiieval\XINT_newfunc_clean}%
+ {\XINT_NewExpr\xint_gobble_i\xintthebareiieval\XINT_newfunc_clean}%
\def\XINT_newfunc_clean #1>{}%
% \end{macrocode}
% \lverb|1.2c adds optional logging. For this needed to pass to _NewExpr_a the
@@ -39201,38 +39475,34 @@ math shift catcode.
% 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.
+% \xintexprSafeCatcodes, as it is now already done earlier by \xintdeffunc.
%
% Modified at 1.3e: \XINT_NewFunc et al. do issue \XINT_expr_redefineprints.
% I suppose I did not use it formely as I considered it unneeded overhead,
% but this meant that \xintdeffunc foo(x):=\xintfloatexpr bar(x)\relax; was
-% impossible. And in fact this is convenient for xinttrig.sty to transfer
+% impossible. But such a syntax is convenient for xinttrig.sty to transfer
% float functions to normal functions.
% |
% \begin{macrocode}
-\def\XINT_NewExpr #1#2#3#4#5#6[#7]%
+\def\XINT_NewExpr #1#2#3#4#5[#6]%
{%
\begingroup
- \ifcase #7\relax
- \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}%
+ \ifcase #6\relax
+ \toks0 {\endgroup\XINT_global\def#4}%
+ \or \toks0 {\endgroup\XINT_global\def#4##1}%
+ \or \toks0 {\endgroup\XINT_global\def#4##1##2}%
+ \or \toks0 {\endgroup\XINT_global\def#4##1##2##3}%
+ \or \toks0 {\endgroup\XINT_global\def#4##1##2##3##4}%
+ \or \toks0 {\endgroup\XINT_global\def#4##1##2##3##4##5}%
+ \or \toks0 {\endgroup\XINT_global\def#4##1##2##3##4##5##6}%
+ \or \toks0 {\endgroup\XINT_global\def#4##1##2##3##4##5##6##7}%
+ \or \toks0 {\endgroup\XINT_global\def#4##1##2##3##4##5##6##7##8}%
+ \or \toks0 {\endgroup\XINT_global\def#4##1##2##3##4##5##6##7##8##9}%
\fi
- #2\xintexprSafeCatcodes
+ #1\xintexprSafeCatcodes
\XINT_expr_redefinemacros
- #1%
- \XINT_NewExpr_a #2#3#4#5%
+ \XINT_expr_redefineprints
+ \XINT_NewExpr_a #1#2#3#4%
}%
% \end{macrocode}
% \lverb|& attention que & est de catcode 14
@@ -39376,8 +39646,10 @@ math shift catcode.
% \csbxint{NewExpr}, and to add to \xintexprnameimp the \csbxint{defefunc}
% macro (see user documentation).
%
-% Finally on April 5, 2019 I pushed the idea of the algorithm for the arcsine
-% function to its logical limit obtaining the method finally in use here.
+% Finally on April 5, 2019 I pushed further the idea of the algorithm for the
+% arcsine function. The cost is at least the one of a combined |sin()/cos()|
+% evaluation, surely this is not best approach for low precision, but I like
+% the principle and its suitability to go into hundreds of digits if desired.
%
% Almost all of the code remains written at high level, and in particular it
% is not easily feasible from this interface to execute computations with
@@ -39436,10 +39708,10 @@ math shift catcode.
\expandafter\xint_secondoftwo
\fi
{\immediate\write-1{Reloading xinttrig library using Digits=\xinttheDigits.}}%
-{\expandafter\gdef\csname xintlibver@trig\endcsname{2019/04/05 1.3e}%
+{\expandafter\gdef\csname xintlibver@trig\endcsname{2019/09/10 v1.3f}%
\XINT_providespackage
\ProvidesPackage{xinttrig}%
-[2019/04/05 1.3e Trigonometrical functions for xintexpr (JFB)]%
+[2019/09/10 v1.3f Trigonometrical functions for xintexpr (JFB)]%
}%
% \end{macrocode}
% \subsection{Ensure used letters are dummy letters}
@@ -39966,7 +40238,8 @@ math shift catcode.
% \end{macrocode}
% \subsection{\cshn{sinc()}}
% \lverb|&
-% Should I also consider adding (1-cos(x))/x^2 ?
+% Should I also consider adding (1-cos(x))/(x^2/2) ? it is sinc^2(x/2) but
+% avoids a square.
% |
% \begin{macrocode}
\xintdeffloatefunc sinc(x):=
@@ -40002,7 +40275,7 @@ math shift catcode.
%
% The approach I shall first describe (which is only a first step towards our
% final approach) converges quintically but requires an initial square root
-% computation. However, when used for atan(x), we then do not have to do any
+% computation. For atan(x), we do not have to do any
% such square root extraction. See code next.
%
% The algorithm (for this first approach): we have 0 <= t < 0.72,
@@ -40024,8 +40297,7 @@ math shift catcode.
%
% ©copyright J.F. Burnol, March 30, 2019. This surely has a name.
%
-% The algorithm is quintically convergent! I must have thought about this some
-% many years ago, but I like it a lot and I found it again on March 30, 2019.
+% The algorithm is quintically convergent.
% One can do the same to go from exp to log. Basically the idea is that we can
% improve the Newton Method for any function f for which knowing target value
% of f implies one also knows target value of its derivative. In fact I
@@ -40098,8 +40370,7 @@ math shift catcode.
% transition values were chosen or why (the series below is enough up to 59
% digits of precision). It does only one iteration, in all cases. Using it for
% arcsine requires a preliminary square root extraction, but for arctangent
-% one can arrange things as I did in order to avoid having to compute a square
-% root!
+% one arranges things to avoid having to compute a square root.
%
%
% ©copyright J.F. Burnol, April 5, 2019. This surely has a name.
@@ -40378,10 +40649,12 @@ math shift catcode.
\xintexprSafeCatcodes\catcode`_ 11
\XINT_providespackage
\ProvidesPackage{xintlog}%
-[2019/04/05 1.3e Logarithms and exponentials for xintexpr (JFB)]%
+[2019/09/10 v1.3f Logarithms and exponentials for xintexpr (JFB)]%
% \end{macrocode}
% \subsection{Loading of \cshn{poormanlog} package}
-% \lverb|Attention to catcode regime when loading poormanlog.|
+% \lverb|Attention to catcode regime when loading poormanlog. It matters less
+% now for 1.3f as those chunks of code from poormanlog.tex v0.04 which needed
+% specific xintexpr like catcodes got transferred here anyway.|
% \begin{macrocode}
\ifdefined\RequirePackage
\RequirePackage{poormanlog}%
@@ -40390,21 +40663,38 @@ math shift catcode.
\fi
% \end{macrocode}
% \lverb|\XINT_setcatcodes switches to the standard catcode regime of
-% xint*.sty files. And we need the xintexpr catcode for ! too.
+% xint*.sty files. And we need the xintexpr catcode for ! too (cf
+% \XINT_expr_func_pow)
%
-% See remark above about \xintexprRestoreCatcodes.|
+% See the remark above about importance of doing \xintexprRestoreCatcodes if
+% \xintexprSafeCatcodes has been used...|
% \begin{macrocode}
\xintexprRestoreCatcodes\csname XINT_setcatcodes\endcsname\catcode`\! 11
% \end{macrocode}
-% \subsection{Support macros for natural logarithm and exponential}
+% \subsection{The \cshn{log10()} and \cshn{pow10()} functions}
+% \lverb|The support macros from poormanlog v0.04 \PoorManLogBaseTen,
+% \PoorManLogPowerOfTen, \PoorManPower got transferred into xintfrac.sty at
+% 1.3f.|
% \begin{macrocode}
-\def\xintLog#1{\xintMul{\PoorManLogBaseTen{#1}}{23025850923[-10]}}%
-\def\XINTinFloatLog#1{\XINTinFloatMul{\PoorManLogBaseTen{#1}}{23025850923[-10]}}%
-\def\xintExp#1{\PoorManPowerOfTen{\xintMul{#1}{434294481903[-12]}}}%
-\def\XINTinFloatExp#1{\PoorManPowerOfTen{\XINTinFloatMul{#1}{434294481903[-12]}}}%
+\expandafter\def\csname XINT_expr_func_log10\endcsname#1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\PoorManLogBaseTen{\XINT_expr_unlock #3}\endcsname
+}%
+\expandafter\let\csname XINT_flexpr_func_log10\expandafter\endcsname
+ \csname XINT_expr_func_log10\endcsname
+\expandafter\def\csname XINT_expr_func_pow10\endcsname#1#2#3%
+{%
+ \expandafter #1\expandafter #2\csname.=%
+ \XINT:NEhook:one\PoorManPowerOfTen{\XINT_expr_unlock #3}\endcsname
+}%
+\expandafter\let\csname XINT_flexpr_func_pow10\expandafter\endcsname
+ \csname XINT_expr_func_pow10\endcsname
% \end{macrocode}
-% \subsection{The \cshn{log()}, \cshn{exp()}, and \cshn{pow()} function}
-% \lverb|The log10() and pow10() are already defined by poormanlog.|
+% \subsection{The \cshn{log()}, \cshn{exp()}, and \cshn{pow()} functions}
+% \lverb|The log10() and pow10() were defined by poormanlog v0.04 but have
+% been moved here at xint 1.3f. The support macros are defined in
+% xintfrac.sty.|
% \begin{macrocode}
\def\XINT_expr_func_log #1#2#3%
{%
@@ -40426,6 +40716,9 @@ math shift catcode.
\expandafter #1\expandafter #2\csname.=%
\XINT:NEhook:one\XINTinFloatExp{\XINT_expr_unlock #3}\endcsname
}%
+% \end{macrocode}
+% \lverb|Attention that the ! is of catcode 11 here.|
+% \begin{macrocode}
\def\XINT_expr_func_pow #1#2#3%
{%
\expandafter #1\expandafter #2\csname.=%
@@ -40435,8 +40728,66 @@ math shift catcode.
}%
\let\XINT_flexpr_func_pow\XINT_expr_func_pow
% \end{macrocode}
-% \lverb|We don't worry about setting catcodes as this file is theoretically
-% only loadable from xintexpr.sty itself.|
+% \subsection{\csh{poormanloghack}}
+% \lverb|With \poormanloghack{**}, the ** operator will use pow10(y*log10(x)).
+% Same for ^.|
+% \begin{macrocode}
+\catcode`\* 11
+\def\poormanloghack**{%
+\def\XINT_expr_op_** ##1%
+{%
+ \expandafter \XINT_expr_until_**_a
+ \expandafter ##1\romannumeral`&&@\expandafter\XINT_expr_getnext
+}%
+\def\XINT_expr_until_**_a ##1{%
+\def\XINT_expr_until_**_a ####1####2%
+{%
+ \xint_UDsignfork
+ ####2{\expandafter \XINT_expr_until_**_a \expandafter ##1%
+ \romannumeral`&&@##1}%
+ -{\XINT_expr_until_**_b ####1####2}%
+ \krof
+}}\expandafter\XINT_expr_until_**_a\csname XINT_expr_op_-ix\endcsname
+\def\XINT_expr_until_**_b ##1##2##3##4%
+{%
+ \ifnum ##2>\XINT_expr_precedence_**
+ \xint_afterfi
+ {\expandafter \XINT_expr_until_**_a \expandafter ##1%
+ \romannumeral`&&@\csname XINT_expr_op_##3\endcsname{##4}}%
+ \else
+ \xint_afterfi
+ {\expandafter ##2\expandafter ##3%
+ \csname .=\XINT:NEhook:two
+ \PoorManPower{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname
+ }%
+ \fi
+}%
+\let\XINT_flexpr_op_** \XINT_expr_op_**
+\let\XINT_flexpr_until_**_a\XINT_expr_until_**_a
+\let\XINT_flexpr_until_**_b\XINT_expr_until_**_b
+}%
+\def\poormanloghack^{%
+\def\XINT_expr_until_^_b ##1##2##3##4%
+{%
+ \ifnum ##2>\XINT_expr_precedence_^
+ \xint_afterfi
+ {\expandafter \XINT_expr_until_^_a \expandafter ##1%
+ \romannumeral`&&@\csname XINT_expr_op_##3\endcsname {##4}}%
+ \else
+ \xint_afterfi
+ {\expandafter ##2\expandafter ##3%
+ \csname .=\XINT:NEhook:two
+ \PoorManPower{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname
+ }%
+ \fi
+}%
+\let\XINT_flexpr_until_^_b\XINT_expr_until_^_b
+}%
+\def\poormanloghack#1{\csname poormanloghack#1\endcsname}%
+% \end{macrocode}
+% \lverb|We don't worry about resetting catcodes now as this file is
+% theoretically only loadable from xintexpr.sty itself which will take care of
+% the needed restore.|
% \StoreCodelineNo {xintlog}
% \cleardoublepage\let\xintlognameUp\undefined
% \MakePercentComment
@@ -40447,35 +40798,35 @@ math shift catcode.
xint.sty:190
xintbinhex.sty:53
xintcfrac.sty:183
-xintcore.sty:274
-xintexpr.sty:285
-xintfrac.sty:468
+xintcore.sty:271
+xintexpr.sty:287
+xintfrac.sty:473
xintgcd.sty:48
xintkernel.sty:15
-xintlog.sty:5
+xintlog.sty:11
xintseries.sty:48
xinttools.sty:140
xinttrig.sty:31
\fi
% grep -o "^{%" xint*sty | wc -l
-\def\totala{ 1740}
+\def\totala{ 1750}
\iffalse
% grep -c -e "^}%" xint*sty
xint.sty:189
xintbinhex.sty:52
xintcfrac.sty:183
-xintcore.sty:271
-xintexpr.sty:312
-xintfrac.sty:470
+xintcore.sty:268
+xintexpr.sty:314
+xintfrac.sty:476
xintgcd.sty:50
xintkernel.sty:16
-xintlog.sty:5
+xintlog.sty:12
xintseries.sty:48
xinttools.sty:139
xinttrig.sty:32
\fi
% grep -o "^}%" xint*sty | wc -l
-\def\totalb{ 1767}
+\def\totalb{ 1779}
\cleardoublepage
\section{Cumulative line count}
@@ -40499,8 +40850,8 @@ xinttrig.sty:32
\TeX\strut. Version {\xintbndlversion} of {\xintbndldate}.\par
}
-\CheckSum {33274}% 1.3e
-% 31601 pour 1.3d, 31122 pour 1.3c
+\CheckSum {33497}% 1.3f
+% 33497 pour 1.3f, 33274 pour 1.3e, 31601 pour 1.3d, 31122 pour 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,
diff --git a/macros/generic/xint/xint.pdf b/macros/generic/xint/xint.pdf
index 991d2ac665..d81acf490b 100644
--- a/macros/generic/xint/xint.pdf
+++ b/macros/generic/xint/xint.pdf
Binary files differ