diff options
Diffstat (limited to 'Master/texmf-dist')
19 files changed, 2245 insertions, 1817 deletions
diff --git a/Master/texmf-dist/doc/generic/xint/CHANGES.html b/Master/texmf-dist/doc/generic/xint/CHANGES.html index ca442c6d6d0..44d7e3e8594 100644 --- a/Master/texmf-dist/doc/generic/xint/CHANGES.html +++ b/Master/texmf-dist/doc/generic/xint/CHANGES.html @@ -4,7 +4,7 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta name="generator" content="pandoc" /> - <meta name="author" content="xint 1.2q" /> + <meta name="author" content="xint 1.3" /> <title>CHANGE LOG</title> <style type="text/css">code{white-space: pre;}</style> <style type="text/css"> @@ -17,97 +17,101 @@ <body> <div id="header"> <h1 class="title">CHANGE LOG</h1> -<h2 class="author">xint 1.2q</h2> -<h3 class="date">2018/02/06</h3> +<h2 class="author">xint 1.3</h2> +<h3 class="date">2018/03/01</h3> </div> <div id="TOC"> <ul> -<li><a href="#q-20180206"><code>1.2q (2018/02/06)</code></a><ul> +<li><a href="#section"><code>1.3 (2018/03/01)</code></a><ul> +<li><a href="#incompatible-changes">Incompatible changes</a></li> <li><a href="#improvements-and-new-features">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-1">Improvements and new features</a></li> <li><a href="#bug-fixes">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">Incompatible changes</a></li> -<li><a href="#improvements-and-new-features-1">Improvements and new features</a></li> +<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-1">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-1">Incompatible changes</a></li> +<li><a href="#incompatible-changes-2">Incompatible changes</a></li> <li><a href="#deprecated">Deprecated</a></li> </ul></li> <li><a href="#n-20170806"><code>1.2n (2017/08/06)</code></a><ul> -<li><a href="#incompatible-changes-2">Incompatible changes</a></li> -<li><a href="#improvements-and-new-features-2">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-3">Incompatible changes</a></li> <li><a href="#improvements-and-new-features-3">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-4">Incompatible changes</a></li> +<li><a href="#improvements-and-new-features-4">Improvements and new features</a></li> <li><a href="#bug-fixes-2">Bug fixes</a></li> </ul></li> <li><a href="#l-20170726"><code>1.2l (2017/07/26)</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="#improvements-and-new-features-5">Improvements and new features</a></li> <li><a href="#bug-fixes-3">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-4">Incompatible changes</a></li> -<li><a href="#improvements-and-new-features-5">Improvements and new features</a></li> +<li><a href="#incompatible-changes-5">Incompatible changes</a></li> +<li><a href="#improvements-and-new-features-6">Improvements and new features</a></li> <li><a href="#bug-fixes-4">Bug fixes</a></li> </ul></li> <li><a href="#j-20161222"><code>1.2j (2016/12/22)</code></a><ul> -<li><a href="#improvements-and-new-features-6">Improvements and new features</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="#i-20161213"><code>1.2i (2016/12/13)</code></a><ul> -<li><a href="#incompatible-changes-5">Incompatible changes</a></li> +<li><a href="#incompatible-changes-6">Incompatible changes</a></li> <li><a href="#removed-1">Removed</a></li> -<li><a href="#improvements-and-new-features-7">Improvements and new features</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="#h-20161120"><code>1.2h (2016/11/20)</code></a><ul> -<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> <li><a href="#bug-fixes-7">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-6">Incompatible changes</a></li> -<li><a href="#improvements-and-new-features-9">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-7">Incompatible changes</a></li> <li><a href="#improvements-and-new-features-10">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-8">Incompatible changes</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="#e-20151122"><code>1.2e (2015/11/22)</code></a><ul> -<li><a href="#improvements-and-new-features-11">Improvements and new features</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="#d-20151118"><code>1.2d (2015/11/18)</code></a><ul> -<li><a href="#improvements-and-new-features-12">Improvements and new features</a></li> +<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="#c-20151116"><code>1.2c (2015/11/16)</code></a><ul> -<li><a href="#improvements-and-new-features-13">Improvements and new features</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="#b-20151029"><code>1.2b (2015/10/29)</code></a><ul> <li><a href="#bug-fixes-12">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-14">Improvements and new features</a></li> +<li><a href="#improvements-and-new-features-15">Improvements and new features</a></li> <li><a href="#bug-fixes-13">Bug fixes</a></li> </ul></li> -<li><a href="#section"><code>1.2 (2015/10/10)</code></a><ul> +<li><a href="#section-1"><code>1.2 (2015/10/10)</code></a><ul> <li><a href="#removed-2">Removed</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="#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> <li><a href="#a-20141107"><code>1.1a (2014/11/07)</code></a></li> -<li><a href="#section-1"><code>1.1 (2014/10/28)</code></a><ul> -<li><a href="#incompatible-changes-8">Incompatible changes</a></li> +<li><a href="#section-2"><code>1.1 (2014/10/28)</code></a><ul> +<li><a href="#incompatible-changes-9">Incompatible changes</a></li> <li><a href="#removed-3">Removed</a></li> <li><a href="#deprecated-1">Deprecated</a></li> -<li><a href="#improvements-and-new-features-16">Improvements and new features</a></li> +<li><a href="#improvements-and-new-features-17">Improvements and new features</a></li> <li><a href="#bug-fixes-14">Bug fixes</a></li> </ul></li> <li><a href="#n-20140401"><code>1.09n (2014/04/01)</code></a></li> @@ -126,23 +130,37 @@ <li><a href="#a-20130924"><code>1.09a (2013/09/24)</code></a></li> <li><a href="#b-20130614"><code>1.08b (2013/06/14)</code></a></li> <li><a href="#a-20130611"><code>1.08a (2013/06/11)</code></a></li> -<li><a href="#section-2"><code>1.08 (2013/06/07)</code></a></li> -<li><a href="#section-3"><code>1.07 (2013/05/25)</code></a></li> +<li><a href="#section-3"><code>1.08 (2013/06/07)</code></a></li> +<li><a href="#section-4"><code>1.07 (2013/05/25)</code></a></li> <li><a href="#b-20130514"><code>1.06b (2013/05/14)</code></a></li> -<li><a href="#section-4"><code>1.06 (2013/05/07)</code></a></li> -<li><a href="#section-5"><code>1.05 (2013/05/01)</code></a></li> -<li><a href="#section-6"><code>1.04 (2013/04/25)</code></a></li> -<li><a href="#section-7"><code>1.03 (2013/04/14)</code></a></li> -<li><a href="#section-8"><code>1.0 (2013/03/28)</code></a></li> +<li><a href="#section-5"><code>1.06 (2013/05/07)</code></a></li> +<li><a href="#section-6"><code>1.05 (2013/05/01)</code></a></li> +<li><a href="#section-7"><code>1.04 (2013/04/25)</code></a></li> +<li><a href="#section-8"><code>1.03 (2013/04/14)</code></a></li> +<li><a href="#section-9"><code>1.0 (2013/03/28)</code></a></li> </ul> </div> -<pre><code>Source: xint.dtx 1.2q 2018/02/06 (doc 2018/02/06) +<pre><code>Source: xint.dtx 1.3 2018/03/01 (doc 2018/03/01) Author: Jean-Francois Burnol Info: Expandable operations on big integers, decimals, fractions -License: LPPL 1.2qc</code></pre> -<h2 id="q-20180206"><code>1.2q (2018/02/06)</code></h2> +License: LPPL 1.3c</code></pre> +<h2 id="section"><code>1.3 (2018/03/01)</code></h2> +<h3 id="incompatible-changes">Incompatible changes</h3> +<ul> +<li><p><strong>xintcore</strong>, <strong>xint</strong>, <strong>xintfrac</strong>: all macros deprecated at <code>1.2o</code> got removed.</p></li> +<li><p><strong>xintfrac</strong>: addition and subtraction of <code>a/b</code> and <code>c/d</code> now use the l.c.m. of the denominators. Similarly the macro supporting the modulo operator <code>/:</code> uses a l.c.m for the denominator of the result.</p></li> +<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">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-1">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">Bug fixes</h3> @@ -150,7 +168,7 @@ License: LPPL 1.2qc</code></pre> <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> <h2 id="p-20171205"><code>1.2p (2017/12/05)</code></h2> -<h3 id="incompatible-changes">Incompatible changes</h3> +<h3 id="incompatible-changes-1">Incompatible changes</h3> <ul> <li><p><strong>xintgcd</strong>: <code>\xintBezout{a}{b}</code>'s output consists of <code>{u}{v}{d}</code> with <code>u*a+v*b==d</code>, with <code>d</code> the GCD. Formerly it was <code>{a}{b}{u}{v}{d}</code>, and with <code>u*a-v*b==d</code>.</p></li> <li><p><strong>xintgcd</strong>: <code>\xintBezout{0}{0}</code> expands to <code>{0}{0}{0}</code>. Formerly (since <code>1.2l</code>) it raised <code>InvalidOperation</code>.</p></li> @@ -158,7 +176,7 @@ License: LPPL 1.2qc</code></pre> <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-1">Improvements and new features</h3> +<h3 id="improvements-and-new-features-2">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> @@ -172,7 +190,7 @@ License: LPPL 1.2qc</code></pre> <li><p>various documentation fixes; in particular, the partial dependency of <strong>xintcfrac</strong> on <strong>xinttools</strong> had not been mentioned.</p></li> </ul> <h2 id="o-20170829"><code>1.2o (2017/08/29)</code></h2> -<h3 id="incompatible-changes-1">Incompatible changes</h3> +<h3 id="incompatible-changes-2">Incompatible changes</h3> <ul> <li><strong>xint</strong>: <code>\xintAND</code>, <code>\xintOR</code>, ... and similar Boolean logic macros do not apply anymore <code>\xintNum</code> (or <code>\xintRaw</code> if <strong>xintfrac</strong> is loaded), to their arguments (often, from internal usage of <code>\xintSgn</code>), but only f-expand them (using e.g. <code>\xintiiSgn</code>). This is kept un-modified even if loading <strong>xintfrac</strong>.</li> </ul> @@ -188,22 +206,22 @@ License: LPPL 1.2qc</code></pre> <li><p><strong>xint</strong>: <code>\xintNot</code> was renamed to <code>\xintNOT</code>, former denomination is deprecated. See also item about Boolean logic macros in the <em>Incompatible Changes</em> section.</p></li> </ul> <h2 id="n-20170806"><code>1.2n (2017/08/06)</code></h2> -<h3 id="incompatible-changes-2">Incompatible changes</h3> +<h3 id="incompatible-changes-3">Incompatible changes</h3> <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-2">Improvements and new features</h3> +<h3 id="improvements-and-new-features-3">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> </ul> <h2 id="m-20170731"><code>1.2m (2017/07/31)</code></h2> -<h3 id="incompatible-changes-3">Incompatible changes</h3> +<h3 id="incompatible-changes-4">Incompatible changes</h3> <ul> <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-3">Improvements and new features</h3> +<h3 id="improvements-and-new-features-4">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> @@ -219,7 +237,7 @@ License: LPPL 1.2qc</code></pre> <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-4">Improvements and new features</h3> +<h3 id="improvements-and-new-features-5">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> @@ -235,12 +253,12 @@ License: LPPL 1.2qc</code></pre> <li><p><strong>xintfrac</strong>: the manual said one could use directly <code>\numexpr</code> compatible expressions in arithmetic macros (without even a <code>\numexpr</code> encapsulation) if they were expressed with up to 8 tokens. There was a bug if these 8 tokens evaluated to zero. The bug has been fixed, and up to 9 tokens are now accepted. But it is simpler to use <code>\the\numexpr</code> prefix and not to worry about the token count... The ending <code>\relax</code> is now un-needed.</p></li> </ul> <h2 id="k-20170106"><code>1.2k (2017/01/06)</code></h2> -<h3 id="incompatible-changes-4">Incompatible changes</h3> +<h3 id="incompatible-changes-5">Incompatible changes</h3> <ul> <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-5">Improvements and new features</h3> +<h3 id="improvements-and-new-features-6">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>>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> @@ -254,7 +272,7 @@ License: LPPL 1.2qc</code></pre> <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-6">Improvements and new features</h3> +<h3 id="improvements-and-new-features-7">Improvements and new features</h3> <ul> <li><p><strong>xinttools</strong> and <strong>xintexpr</strong>:</p> <ol style="list-style-type: decimal"> @@ -268,7 +286,7 @@ License: LPPL 1.2qc</code></pre> <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> <h2 id="i-20161213"><code>1.2i (2016/12/13)</code></h2> -<h3 id="incompatible-changes-5">Incompatible changes</h3> +<h3 id="incompatible-changes-6">Incompatible changes</h3> <ul> <li><code>\xintDecSplit</code> second argument must have no sign (former code replaced it with its absolute value, a sign now may cause an error.)</li> </ul> @@ -276,7 +294,7 @@ License: LPPL 1.2qc</code></pre> <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-7">Improvements and new features</h3> +<h3 id="improvements-and-new-features-8">Improvements and new features</h3> <ul> <li><p><strong>xintkernel</strong>: <code>\xintLength</code> is faster. New macros:</p> <ul> @@ -300,7 +318,7 @@ License: LPPL 1.2qc</code></pre> <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-8">Improvements and new features</h3> +<h3 id="improvements-and-new-features-9">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> @@ -313,12 +331,12 @@ License: LPPL 1.2qc</code></pre> <li><p>the <code>add</code> and <code>mul</code> from <strong>xintexpr</strong>, which work with dummy variables since <code>1.1</code>, raised an error since <code>1.2c 2015/11/16</code> when the dummy variable was given an empty range (or list) of values, rather than producing respectively <code>0</code> and <code>1</code> as formerly.</p></li> </ul> <h2 id="g-20160319"><code>1.2g (2016/03/19)</code></h2> -<h3 id="incompatible-changes-6">Incompatible changes</h3> +<h3 id="incompatible-changes-7">Incompatible changes</h3> <ul> <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-9">Improvements and new features</h3> +<h3 id="improvements-and-new-features-10">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> @@ -327,11 +345,11 @@ License: LPPL 1.2qc</code></pre> <li><p>the syntax of expressions is described in a devoted chapter of the documentation; an example shows how to implement (expandably) the Brent-Salamin algorithm for computation of Pi using <code>iter</code> in a float expression.</p></li> </ul> <h2 id="f-20160312"><code>1.2f (2016/03/12)</code></h2> -<h3 id="incompatible-changes-7">Incompatible changes</h3> +<h3 id="incompatible-changes-8">Incompatible changes</h3> <ul> <li>no more <code>\xintFac</code> macro but <code>\xintiFac/\xintiiFac/\xintFloatFac</code>.</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>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> @@ -352,7 +370,7 @@ License: LPPL 1.2qc</code></pre> <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-11">Improvements and new features</h3> +<h3 id="improvements-and-new-features-12">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> @@ -366,7 +384,7 @@ License: LPPL 1.2qc</code></pre> <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-12">Improvements and new features</h3> +<h3 id="improvements-and-new-features-13">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> @@ -377,7 +395,7 @@ License: LPPL 1.2qc</code></pre> <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-13">Improvements and new features</h3> +<h3 id="improvements-and-new-features-14">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> @@ -392,7 +410,7 @@ License: LPPL 1.2qc</code></pre> <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-14">Improvements and new features</h3> +<h3 id="improvements-and-new-features-15">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> @@ -402,12 +420,12 @@ License: LPPL 1.2qc</code></pre> <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> -<h2 id="section"><code>1.2 (2015/10/10)</code></h2> +<h2 id="section-1"><code>1.2 (2015/10/10)</code></h2> <h3 id="removed-2">Removed</h3> <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-15">Improvements and new features</h3> +<h3 id="improvements-and-new-features-16">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> @@ -440,8 +458,8 @@ License: LPPL 1.2qc</code></pre> <li><p>added the previously mentioned <code>ii</code> macros, and some others from <code>1.1</code>, to the user manual. But their main usage is internal to <code>\xintiiexpr</code>, to skip unnecessary overheads.</p></li> <li><p>various typographical fixes throughout the documentation, and a bit of clean up of the code comments. Improved <code>\Factors</code> example of nested <code>subs</code>, <code>rseq</code>, <code>iter</code> in <code>\xintiiexpr</code>.</p></li> </ul> -<h2 id="section-1"><code>1.1 (2014/10/28)</code></h2> -<h3 id="incompatible-changes-8">Incompatible changes</h3> +<h2 id="section-2"><code>1.1 (2014/10/28)</code></h2> +<h3 id="incompatible-changes-9">Incompatible changes</h3> <ul> <li><p>in <code>\xintiiexpr</code>, <code>/</code> does <em>rounded</em> division, rather than the Euclidean division (for positive arguments, this is truncated division). The <code>//</code> operator does truncated division,</p></li> <li><p>the <code>:</code> operator for three-way branching is gone, replaced with <code>??</code>,</p></li> @@ -461,7 +479,7 @@ License: LPPL 1.2qc</code></pre> <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>&</code> and <code>|</code> as Boolean operators in <code>xintexpr</code>-essions are deprecated in favour of <code>&&</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-16">Improvements and new features</h3> +<h3 id="improvements-and-new-features-17">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> @@ -642,12 +660,12 @@ License: LPPL 1.2qc</code></pre> <li><p>Better management by <code>\xintCmp</code>, <code>\xintMax</code>, <code>\xintMin</code> and <code>\xintGeq</code> of inputs having big powers of ten in them.</p></li> <li><p>Macros for floating point numbers added to the <strong>xintseries</strong> package.</p></li> </ul> -<h2 id="section-2"><code>1.08 (2013/06/07)</code></h2> +<h2 id="section-3"><code>1.08 (2013/06/07)</code></h2> <ul> <li><p>(<strong>xint</strong> and <strong>xintfrac</strong>) Macros for extraction of square roots, for floating point numbers (<code>\xintFloatSqrt</code>), and integers (<code>\xintiSqrt</code>).</p></li> <li><p>new package <strong>xintbinhex</strong> providing <em>conversion routines</em> to and from binary and hexadecimal bases.</p></li> </ul> -<h2 id="section-3"><code>1.07 (2013/05/25)</code></h2> +<h2 id="section-4"><code>1.07 (2013/05/25)</code></h2> <ul> <li><p>The <strong>xintexpr</strong> package is a new core constituent (which loads automatically <strong>xintfrac</strong> and <strong>xint</strong>) and implements the expandable expanding parser</p> <pre><code>\xintexpr . . . \relax,</code></pre> @@ -662,16 +680,16 @@ License: LPPL 1.2qc</code></pre> <ul> <li>Minor code and documentation improvements. Everywhere in the source code, a more modern underscore has replaced the @ sign.</li> </ul> -<h2 id="section-4"><code>1.06 (2013/05/07)</code></h2> +<h2 id="section-5"><code>1.06 (2013/05/07)</code></h2> <ul> <li><p>Some code improvements, particularly for macros of <strong>xint</strong> doing loops.</p></li> <li><p>New utilities in <strong>xint</strong> for expandable manipulations of lists:</p> <pre><code>\xintNthElt, \xintCSVtoList, \xintRevWithBraces</code></pre></li> <li><p>The macros did only a double expansion of their arguments. They now fully expand them (using <code>\romannumeral-`0</code>). Furthermore, in the case of arguments constrained to obey the TeX bounds they will be inserted inside a <code>\numexpr..\relax</code>, hence completely expanded, one may use count registers, even infix arithmetic operations, etc...</p></li> </ul> -<h2 id="section-5"><code>1.05 (2013/05/01)</code></h2> +<h2 id="section-6"><code>1.05 (2013/05/01)</code></h2> <p>Minor changes and additions to <strong>xintfrac</strong> and <strong>xintcfrac</strong>.</p> -<h2 id="section-6"><code>1.04 (2013/04/25)</code></h2> +<h2 id="section-7"><code>1.04 (2013/04/25)</code></h2> <ul> <li><p>New component <strong>xintcfrac</strong> devoted to continued fractions.</p></li> <li><p><strong>xint</strong>: faster division.</p></li> @@ -681,13 +699,13 @@ License: LPPL 1.2qc</code></pre> <li><p><code>tex xint.dtx</code> extracts style files (no need for a <code>xint.ins</code>).</p></li> <li><p>Bug fix (<strong>xintfrac</strong>): <code>\xintIrr {0}</code> crashed.</p></li> </ul> -<h2 id="section-7"><code>1.03 (2013/04/14)</code></h2> +<h2 id="section-8"><code>1.03 (2013/04/14)</code></h2> <ul> <li><p>New modules <strong>xintfrac</strong> (expandable operations on fractions) and <strong>xintseries</strong> (expandable partial sums with xint package).</p></li> <li><p>Slightly improved division and faster multiplication (the best ordering of the arguments is chosen automatically).</p></li> <li><p>Added illustration of Machin algorithm to the documentation.</p></li> </ul> -<h2 id="section-8"><code>1.0 (2013/03/28)</code></h2> +<h2 id="section-9"><code>1.0 (2013/03/28)</code></h2> <p>Initial announcement:</p> <blockquote> <p>The <strong>xint</strong> package implements with expandable TeX macros the basic arithmetic operations of addition, subtraction, multiplication and division, as applied to arbitrarily long numbers represented as chains of digits with an optional minus sign.</p> diff --git a/Master/texmf-dist/doc/generic/xint/CHANGES.pdf b/Master/texmf-dist/doc/generic/xint/CHANGES.pdf Binary files differindex c9435452f2a..eab1fe3a6f3 100644 --- a/Master/texmf-dist/doc/generic/xint/CHANGES.pdf +++ b/Master/texmf-dist/doc/generic/xint/CHANGES.pdf diff --git a/Master/texmf-dist/doc/generic/xint/README b/Master/texmf-dist/doc/generic/xint/README index 045c23a8faf..4e06f22b163 100644 --- a/Master/texmf-dist/doc/generic/xint/README +++ b/Master/texmf-dist/doc/generic/xint/README @@ -1,7 +1,7 @@ - Source: xint.dtx 1.2q 2018/02/06 (doc 2018/02/06) + Source: xint.dtx 1.3 2018/03/01 (doc 2018/03/01) Author: Jean-Francois Burnol Info: Expandable operations on big integers, decimals, fractions - License: LPPL 1.2qc + License: LPPL 1.3c This README is also available as README.pdf and README.html. @@ -196,7 +196,7 @@ filename database. LICENSE -Copyright (C) 2013-2017 by Jean-Francois Burnol +Copyright (C) 2013-2018 by Jean-Francois Burnol This Work may be distributed and/or modified under the conditions of the LaTeX Project Public License version 1.3c. This version of this license diff --git a/Master/texmf-dist/doc/generic/xint/README.html b/Master/texmf-dist/doc/generic/xint/README.html index 7fe6e40439b..85699cbf6d5 100644 --- a/Master/texmf-dist/doc/generic/xint/README.html +++ b/Master/texmf-dist/doc/generic/xint/README.html @@ -4,7 +4,7 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta name="generator" content="pandoc" /> - <meta name="author" content="xint 1.2q" /> + <meta name="author" content="xint 1.3" /> <title>README</title> <style type="text/css">code{white-space: pre;}</style> <style type="text/css"> @@ -17,8 +17,8 @@ <body> <div id="header"> <h1 class="title">README</h1> -<h2 class="author">xint 1.2q</h2> -<h3 class="date">2018/02/06</h3> +<h2 class="author">xint 1.3</h2> +<h3 class="date">2018/03/01</h3> </div> <div id="TOC"> <ul> @@ -36,10 +36,10 @@ <li><a href="#license">License</a></li> </ul> </div> -<pre><code>Source: xint.dtx 1.2q 2018/02/06 (doc 2018/02/06) +<pre><code>Source: xint.dtx 1.3 2018/03/01 (doc 2018/03/01) Author: Jean-Francois Burnol Info: Expandable operations on big integers, decimals, fractions -License: LPPL 1.2qc</code></pre> +License: LPPL 1.3c</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> @@ -129,7 +129,7 @@ sudo texhash /usr/local/texlive/texmf-local</code></pre></li> <p>Depending on the destination, it may then be necessary to refresh a filename database.</p> <h1 id="license">License</h1> <div class="mono"> -<p>Copyright (C) 2013-2017 by Jean-Francois Burnol</p> +<p>Copyright (C) 2013-2018 by Jean-Francois Burnol</p> <p>This Work may be distributed and/or modified under the conditions of the LaTeX Project Public License version 1.3c. This version of this license is in</p> <blockquote> <p><a href="http://www.latex-project.org/lppl/lppl-1-3c.txt" class="uri">http://www.latex-project.org/lppl/lppl-1-3c.txt</a></p> diff --git a/Master/texmf-dist/doc/generic/xint/README.pdf b/Master/texmf-dist/doc/generic/xint/README.pdf Binary files differindex cd6fe59f7c4..04740e5acac 100644 --- a/Master/texmf-dist/doc/generic/xint/README.pdf +++ b/Master/texmf-dist/doc/generic/xint/README.pdf diff --git a/Master/texmf-dist/doc/generic/xint/sourcexint.pdf b/Master/texmf-dist/doc/generic/xint/sourcexint.pdf Binary files differindex 395c26c08af..eccb01bd279 100644 --- a/Master/texmf-dist/doc/generic/xint/sourcexint.pdf +++ b/Master/texmf-dist/doc/generic/xint/sourcexint.pdf diff --git a/Master/texmf-dist/doc/generic/xint/xint.pdf b/Master/texmf-dist/doc/generic/xint/xint.pdf Binary files differindex dcf85713f41..25cf7858a6c 100644 --- a/Master/texmf-dist/doc/generic/xint/xint.pdf +++ b/Master/texmf-dist/doc/generic/xint/xint.pdf diff --git a/Master/texmf-dist/source/generic/xint/xint.dtx b/Master/texmf-dist/source/generic/xint/xint.dtx index cbfb3a2e9f4..fb30b1972e3 100644 --- a/Master/texmf-dist/source/generic/xint/xint.dtx +++ b/Master/texmf-dist/source/generic/xint/xint.dtx @@ -3,27 +3,27 @@ % Extract all files via "etex xint.dtx" and do "make help" % or follow instructions from extracted README.md. %<*dtx> -\def\xintdtxtimestamp {Time-stamp: <06-02-2018 at 21:58:51 CET>} +\def\xintdtxtimestamp {Time-stamp: <01-03-2018 at 20:38:22 CET>} %</dtx> %<*drv> %% --------------------------------------------------------------- -\def\xintdocdate {2018/02/06} -\def\xintbndldate{2018/02/06} -\def\xintbndlversion {1.2q} +\def\xintdocdate {2018/03/01} +\def\xintbndldate{2018/03/01} +\def\xintbndlversion {1.3} %</drv> %<readme>% README %<changes>% CHANGE LOG -%<readme|changes>% xint 1.2q -%<readme|changes>% 2018/02/06 +%<readme|changes>% xint 1.3 +%<readme|changes>% 2018/03/01 %<readme|changes> -%<readme|changes> Source: xint.dtx 1.2q 2018/02/06 (doc 2018/02/06) +%<readme|changes> Source: xint.dtx 1.3 2018/03/01 (doc 2018/03/01) %<readme|changes> Author: Jean-Francois Burnol %<readme|changes> Info: Expandable operations on big integers, decimals, fractions -%<readme|changes> License: LPPL 1.2qc +%<readme|changes> License: LPPL 1.3c %<readme|changes> %<*!readme&!changes&!dohtmlsh&!dopdfsh&!makefile> %% --------------------------------------------------------------- -%% The xint bundle 1.2q 2018/02/06 +%% The xint bundle 1.3 2018/03/01 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %<xintkernel>%% xintkernel: Paraphernalia for the xint packages %<xinttools>%% xinttools: Expandable and non-expandable utilities @@ -225,7 +225,7 @@ License ======= <div class="mono"> -Copyright (C) 2013-2017 by Jean-Francois Burnol +Copyright (C) 2013-2018 by Jean-Francois Burnol This Work may be distributed and/or modified under the conditions of the LaTeX Project Public License version 1.3c. @@ -250,6 +250,40 @@ Makefile.mk.</div> %</readme>-------------------------------------------------------- %<*changes>------------------------------------------------------- +`1.3 (2018/03/01)` +---- + +### Incompatible changes + + - **xintcore**, **xint**, **xintfrac**: all macros deprecated at `1.2o` + got removed. + + - **xintfrac**: addition and subtraction of `a/b` and `c/d` now use the + l.c.m. of the denominators. Similarly the macro supporting the modulo + operator `/:` uses a l.c.m for the denominator of the result. + + - **xintexpr**: the addition, subtraction, modulo `/:`, and the + `mod()`and `divmod()` functions produce generally smaller denominators + (see previous item). + + - **xintexpr**: 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 `\xintverbosetrue`). + +### Improvements and new features + + - **xintexpr**: user-defined functions may now be of a recursive + nature. This was made possible by a refactoring of the `\xintNewExpr` + mechanism. It became both leaner and more extensive than formerly. + + - **xintfrac**: new macros `\xintPIrr` and `\xintDecToString`. The + latter is a backport of a `polexpr 0.4` utility, and it is to be + considered unstable. + + - **xintexpr**: new function `preduce()` associated with `\xintPIrr`. + `1.2q (2018/02/06)` ---- @@ -2429,13 +2463,14 @@ dvipdfmx CHANGES.dvi {\noindent \llap{\makebox[\dimexpr\leftmargini+1em\relax][l]% {\ttzfamily\bfseries\etoclink - {.\expandafter\gobbletodot\etocthenumber}}}% + {\HOOKLOCALTOC.\expandafter\gobbletodot\etocthenumber}}}% \strut\etocname\nobreak \leaders\etoctoclineleaders \hfill\nobreak \strut\makebox[\MARGEPAGENO][r]{\small\etocpage}\endgraf } {\endgroup }% +\let\HOOKLOCALTOC\empty% quick hack to get style I want in User defined functions \etocsetlevel{table}{6} \makeatother @@ -2682,10 +2717,10 @@ pdfpagemode=UseOutlines} \def\CHANGEDf #1{\@bsphack \vadjust{\vskip-\dp\strutbox - \smash{\hbox to 0pt {\hss\color[named]{PineGreen}% - \normalfont\small + \smash{\hbox to 0pt {\hss\color[named]{Red}% + \normalfont\small\bfseries \hsize 1.5cm\rightskip.5cm minus.5cm - \vtop{\noindent Changed (#1)}\ + \vtop{\noindent Changed at #1!}\ \kern\dimexpr\FrameSep+\FrameRule\relax}}% \vskip\dp\strutbox }\strut\@esphack} @@ -3758,7 +3793,7 @@ The normal mode of operation of the parsers is to unveil the parsed material token by token. This means that all elements may arise from expansion of encountered macros (or active characters). For example a closing parenthesis does not have to be immediately visible, it may arise later from expansion. -This general behavior has exceptions, in particular constructs with dummy +This general behaviour has exceptions, in particular constructs with dummy variables need immediately visible balanced parentheses and commas. The expansion stops only when the ending |\relax| has been found; it is then removed from the token stream, and the final computation result is inserted. @@ -3801,15 +3836,15 @@ It is also possible to do some computer algebra like evaluations (only numerically though): \begin{everbatim*} \xinttheiiexpr add(i^5, i=100..200)\relax\par +\noindent\xinttheexpr add(x/(x+1), x = 1000..1014)\relax\par \noindent\xinttheexpr reduce(add(x/(x+1), x = 1000..1014))\relax \end{everbatim*} -\newline Were it not for the \func{reduce} function, the latter fraction would -not have been obtained in reduced terms: +\newline In this example, the fraction obtained by addition was thus already +irreducible, but this is not always the case: \begin{framed} By default, the basic operations on fractions are not followed in an automatic manner by reduction to smallest terms: |A/B| multiplied by |C/D| - returns |AC/BD|, |A/B| added to |C/D| returns |(AD+BC)/BD| except if either - |B| divides |D| or |D| divides |B|. + returns |AC/BD|, and |A/B| added to |C/D| uses |lcm(B, D)| as denominator.\CHANGEDf{1.3} \end{framed} Make sure to read \autoref{sec:expr}, \autoref{sec:xintexprsyntax} and @@ -4145,6 +4180,25 @@ file with name |README.md|. Further help and options will be found therein. This is release \expandafter|\xintbndlversion| of \expandafter|\xintbndldate|. +|1.3| brings one important main new feature: the possibility of +\hyperref[sssec:recursive]{recursive definitions} with \csbxint{deffunc} for +user additions to the expression parsers. + +Also, it adds macros \csbxint{PIrr} et \csbxint{DecToString} and function +\func{preduce}. + +And it brings significant breaking changes: +\begin{itemize}[nosep] +\item Addition (\csbxint{Add}) and subtraction (\csbxint{Sub}) of fractions use + the least common multiple of the denominators. +\item This of course modifies also addition and subtraction in |xintexpr|. + Similarly the |/:| operator and the \func{mod} and \func{divmod} functions + also use a least common multiple for the denominator of the result. +\item The macros deprecated at |1.2o| have now been all removed. See +\autoref{ssec:coredeprecated}, \autoref{ssec:xintdeprecated}, and +\autoref{ssec:xintdeprecatedNum} for details. +\end{itemize} + |1.2q| fixes a bug introduced by |1.2l| in some cases of subtraction. It also extends \hyperref[ssec:tacit multiplication]{Tacit multiplication} to cover cases such as |10!20!30!|. @@ -4163,11 +4217,7 @@ fixes): \end{itemize} |1.2o| did mass-deprecation of those macros which were so far defined by -\xintcorename/\xintname to use automatically \csbxint{Num}; users of -\xintfracname (or a fortiori \xintexprname) will see almost nothing of this, -as \xintfracname does the proper definitions. See -\autoref{ssec:coredeprecated}, \autoref{ssec:xintdeprecated}, and -\autoref{ssec:xintdeprecatedNum} for details. +\xintcorename/\xintname to use automatically \csbxint{Num}. |1.2n| removed the \xintbinhexname dependency upon \xintcorename: it now loads only \xintkernelname. @@ -4485,7 +4535,8 @@ corresponding definitions. \centering \xintAssignArray\xintCSVtoList{!, ?, |`*`|, |`+`|, abs, add, all, any, binomial, bool, ceil, divmod, even, factorial, first, float, floor, frac, gcd, if, ifsgn, iter, -iterr, last, lcm, len, max, min, mod, mul, not, num, odd, pfactorial, qfloat, +iterr, last, lcm, len, max, min, mod, mul, not, num, odd, pfactorial, +preduce, qfloat, qfrac, qint, quo, reduce, rem, reversed, round, rrseq, rseq, seq, sgn, sqr, sqrt, sqrtr, subs, togl, trunc, xor} \to\Functions @@ -4615,6 +4666,13 @@ Miscellaneous notes: \end{everbatim*} Recall that this is NOT done automatically, for example when adding fractions. + \funcdesc{preduce} internally, fractions may have some power of ten part + (for example when they got input in scientific notation). This function + ignores the decimal part when doing the reduction. See \csbxint{PIrr}. +\begin{everbatim*} +\xinttheexpr preduce(10e3/2), reduce(10e3/2)\relax +\end{everbatim*} + \funcdesc{abs} absolute value \funcdesc{sgn} sign \funcdesc{floor} floor function. @@ -4774,13 +4832,32 @@ Recall that this is NOT done automatically, for example when adding fractions. Prior to |1.2p| it computed |f - g*trunc(f/g)|.\CHANGED{1.2p} The |/:| and |'mod'| infix operators are both mapped to the same underlying - macro as this |mod(f, g)| function. + macro as this |mod(f, g)| function. At |1.3| this macro produces smaller + denominators when handling fractions than formerly.\CHANGED{1.3} \begin{everbatim*} \xinttheexpr mod(11/7,1/13), reduce(((11/7)//(1/13))*1/13+mod(11/7,1/13)), mod(11/7,1/13)- (11/7)/:(1/13), (11/7)//(1/13)\relax\newline \xintthefloatexpr mod(11/7,1/13)\relax\par \end{everbatim*} + Attention! the precedence rules mean that |29/5 /: 3/5| is handled like + |((29/5)/:3)/5|. This is coherent with behaviour of Python language for + example: +\begin{everbatim} +>>> 29/5 % 3/5, 11/3 % 17/19, 11/57 +(0.5599999999999999, 0.19298245614035087, 0.19298245614035087) +>>> (29/5) % (3/5), (11/3) % (17/19), 5/57 +(0.4, 0.08771929824561386, 0.08771929824561403) +\end{everbatim} + For comparison (observe on the last lines how |\xintfloatexpr| is more accurate than + Python!): +\begin{everbatim*} +\noindent\xinttheexpr 29/5 /: 3/5, 11/3 /: 17/19\relax\newline + \xinttheexpr (29/5) /: (3/5), (11/3) /: (17/19)\relax\newline + \xintthefloatexpr 29/5 /: 3/5, 11/3 /: 17/19, 11/57\relax\newline + \xintthefloatexpr (29/5) /: (3/5), (11/3) /: (17/19), 5/57\relax\newline + 5/57 = \xinttheexpr trunc(5/57, 20)\relax\dots\newline +\end{everbatim*}% Regarding some details of behaviour in |\xintfloatexpr|, see discussion of |divmod| function next. @@ -5042,7 +5119,15 @@ this ``nuple''. For example: |\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). + \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} @@ -5507,6 +5592,9 @@ For example with Xe\TeX\ or Lua\LaTeX\ the following works: This macro is a public interface for a functionality existing since |1.2e|.\NewWith{1.2k} \subsection{User defined functions}\label{ssec:userfunctions} +\def\HOOKLOCALTOC#1#2#3{} +\etocsetnexttocdepth{subsubsection}\localtableofcontents +\let\HOOKLOCALTOC\empty \subsubsection{\csbh{xintdeffunc}} \label{xintdeffunc} @@ -5535,6 +5623,11 @@ and that |x/2y| is interpreted as |x/(2y)|.) A function must be defined for a specific parser, using either |\xintdeffunc|, |\xintdefiifunc| or |\xintdeffloatfunc|. + + Cryptic error messages will signal failures of using with another parser a + function declared for one parser (particularly if the name is a single + letter, because the parser will have made an attempt to use the letter as a + dummy variable.) \end{framed} \footnotetext{with the current syntax, the |;| as used for |iterr|, |rseq|, |rrseq| must be hidden as |{;}| to not be confused with the |;| ending the @@ -5548,7 +5641,7 @@ Nothing problematic for an \emph{exact} evaluation, naturally ! A function may be declared either via \csa{xintdeffunc}, \csa{xintdefiifunc}, \csa{xintdeffloatfunc}. It will then be known \emph{only} to the parser which -was used for its definition. +was used for its definition.\IMPORTANT Thus to test the \textsc{Rump} polynomial (it is not quite a polynomial with its |x/2y| final term) with floats, we \emph{must} also @@ -5595,12 +5688,12 @@ creates a macro whose meaning one can find in the log file, after |\xintverbosetrue|. Here it is: \begin{everbatim} Function e for \xintexpr parser associated to \XINT_expr_userfunc_e with me -aning macro:#1,->\xintAdd {\xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\x -intDiv {\xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {\xintMul {\ -xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv { -\xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {#1}{10}}{1}}{#1}}{9 -}}{1}}{#1}}{8}}{1}}{#1}}{7}}{1}}{#1}}{6}}{1}}{#1}}{5}}{1}}{#1}}{4}}{1}}{#1}}{3} -}{1}}{#1}}{2}}{1}}{#1}}{1} +aning macro:#1->\xintAdd {\xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\xi +ntDiv {\xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {\xintMul {\x +intAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {\ +xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {#1}{10}}{1}}{#1}}{9} +}{1}}{#1}}{8}}{1}}{#1}}{7}}{1}}{#1}}{6}}{1}}{#1}}{5}}{1}}{#1}}{4}}{1}}{#1}}{3}} +{1}}{#1}}{2}}{1}}{#1}}{1} \end{everbatim} This has the same limitations as the \csbxint{NewExpr} macro. The main one @@ -5630,6 +5723,60 @@ iterated over do not depend upon the function parameters: \end{everbatim*} +\subsubsection{Recursive definitions}\label{sssec:recursive} + +Since |1.3|, it is possible to make recursive definitions.\NewWith{1.3} Here +are two examples: +\begin{everbatim*} +\xintdeffunc GCD(a,b):=if(b,GCD(b,a/:b),a); +\end{everbatim*} +This of course is the Euclide algorithm: it will be here applied to variables +which may be fractions. For example: +\begin{everbatim*} +\xinttheexpr GCD(385/102, 605/238)\relax +\end{everbatim*} +There is already (with \xintgcdname loaded) a built-in \func{gcd} (which +accepts arbitrarily many arguments), but it is the integer-valued one (and it +truncates its arguments to integers when used in |\xintexpr|). +\begin{everbatim*} +\xinttheexpr gcd(385/102, 605/238)\relax % no good!, does gcd(3, 2) +\end{everbatim*} + +Our second example is modular exponentiation: +\begin{everbatim*} +\xintdefiifunc powmod(x, m, n) := + if(m, + % m non zero (assume positive) + if(m=1, + % m=1, return x modulo n + x /: n, + % m > 1 test if odd or even and do recursive call + if(odd(m), (x*sqr(powmod(x, m//2, n))) /: n, + sqr(powmod(x, m//2, n)) /: n + ) + ), + % m is zero, return 1 + 1); +\end{everbatim*} +I have made the definition here for the |\xintiiexpr| parser; we could do the +same for the |\xintexpr|-parser (but its usage with big powers would quickly +create big denominators, think |powmod(1/2, 1000, 1)| for example.) +\begin{everbatim*} +\xinttheiiexpr seq(powmod(x, 1000, 128), x=9, 11, 13, 15, 17, 19, 21)\relax\par +\end{everbatim*} +The function assumes the exponent is non-negative (the Python |pow| behaves +the same), but zealous users will add the necessary code for negative +exponents, after having defined another function for modular inverse! + +It is mandatory for such definitions to use the \func{if} function, and not +the |(x)?{A}{B}| construct which much choose a branch. The parsing of the +\func{if} function keeps the memory of the two alternative branches; to the +contrary, the \emph{constructed} |powmod| function will expand \emph{only} the +then relevant branch. This is of course absolutely needed for things such as +the Euclide algorithm where it would be catastrophic to evaluate both branches +as the first one involves a division by |b| and the algorithm stops only when +|b| is actually zero. + \subsubsection{\csbh{ifxintverbose} conditional} \label{xintverbosetrue} \label{xintverbosefalse} @@ -5640,22 +5787,22 @@ functions (or rather their associated macros) will be written to the log. For example the first |Rump| declaration above generates this in the log file: \begin{everbatim} Function Rump for \xintexpr parser associated to \XINT_expr_userfunc_Rump w -ith meaning macro:#1,#2,->\xintAdd {\xintAdd {\xintAdd {\xintDiv {\xintMul {133 -5}{\xintPow {#2}{6}}}{4}}{\xintMul {\xintPow {#1}{2}}{\xintSub {\xintSub {\xint -Sub {\xintMul {11}{\xintMul {\xintPow {#1}{2}}{\xintPow {#2}{2}}}}{\xintPow {#2 -}{6}}}{\xintMul {121}{\xintPow {#2}{4}}}}{2}}}}{\xintDiv {\xintMul {11}{\xintPo -w {#2}{8}}}{2}}}{\xintDiv {#1}{\xintMul {2}{#2}}} +ith meaning macro:#1#2->\xintAdd {\xintAdd {\xintAdd {\xintDiv {\xintMul {1335} +{\xintPow {#2}{6}}}{4}}{\xintMul {\xintPow {#1}{2}}{\xintSub {\xintSub {\xintSu +b {\xintMul {11}{\xintMul {\xintPow {#1}{2}}{\xintPow {#2}{2}}}}{\xintPow {#2}{ +6}}}{\xintMul {121}{\xintPow {#2}{4}}}}{2}}}}{\xintDiv {\xintMul {11}{\xintPow +{#2}{8}}}{2}}}{\xintDiv {#1}{\xintMul {2}{#2}}} \end{everbatim} and the declaration |\xintdeffunc f(x):=iter(1{;} @*x/i+1, i=10..1);| generates: \begin{everbatim} Function f for \xintexpr parser associated to \XINT_expr_userfunc_f with me -aning macro:#1,->\xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {\xintMul {\x -intAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {\ -xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd { -\xintDiv {\xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {\xintMul -{1}{#1}}{10/1[0]}}{1}}{#1}}{9/1[0]}}{1}}{#1}}{8/1[0]}}{1}}{#1}}{7/1[0]}}{1}}{#1 -}}{6/1[0]}}{1}}{#1}}{5/1[0]}}{1}}{#1}}{4/1[0]}}{1}}{#1}}{3/1[0]}}{1}}{#1}}{2/1[ -0]}}{1}}{#1}}{1/1[0]}}{1} +aning macro:#1->\xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {\xintMul {\xi +ntAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {\x +intMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\ +xintDiv {\xintMul {\xintAdd {\xintDiv {\xintMul {\xintAdd {\xintDiv {\xintMul { +1}{#1}}{10/1[0]}}{1}}{#1}}{9/1[0]}}{1}}{#1}}{8/1[0]}}{1}}{#1}}{7/1[0]}}{1}}{#1} +}{6/1[0]}}{1}}{#1}}{5/1[0]}}{1}}{#1}}{4/1[0]}}{1}}{#1}}{3/1[0]}}{1}}{#1}}{2/1[0 +]}}{1}}{#1}}{1/1[0]}}{1} \end{everbatim} Starting with |1.2d| the definitions made by \csbxint{NewExpr} have local @@ -5672,9 +5819,10 @@ example the declarations: will generate \begin{everbatim} Function f for \xintexpr parser associated to \XINT_expr_userfunc_f with me -aning macro:#1,->#1,\xintPow {#1}{2},\xintPow {#1}{3},\xintPow {#1}{#1} +aning macro:#1->#1,\xintPow {#1}{2},\xintPow {#1}{3},\xintPow {#1}{#1} +Package xintexpr Info: (on line 2) Function g for \xintexpr parser associated to \XINT_expr_userfunc_g with me -aning macro:#1,->\xintApply::csv {\xintPow {#1}}{\xintSeq::csv {0}{#1}} +aning macro:#1->\xintApply::csv {\xintPow {#1}}{\xintSeq::csv {0}{#1}} \end{everbatim} and we can check that they work: \begin{everbatim*} @@ -5696,7 +5844,8 @@ does work: \label{xintNewFunction} The syntax is analogous to the one of \csbxint{NewExpr} but achieves something -completely different.\NewWith{1.2h} Here is an example: +\emph{completely different} from +\csa{xintNewExpr}/\csbxint{deffunc}.\NewWith{1.2h} Here is an example: \begin{everbatim*} \xintNewFunction {foo}[3]{add(mul(x+i, i=#1..#2),x=1..#3)} \end{everbatim*} @@ -5706,29 +5855,27 @@ whatever. \begin{everbatim*} \xinttheexpr seq(foo(0, 3, j), j= 1..10)\relax \end{everbatim*} +See \autoref{ssec:PrimesIV} for some additional examples. -A notable aspect is that this syntax allows to make recursive definitions, -contrarily (currently) to \csbxint{deffunc}. See \autoref{ssec:PrimesIV} for -an example. - -However this construct is only syntactic sugar to benefit from functional -notation. Each time the function |foo| will be encountered the corresponding -expression will be inserted as a sub-expression (of the same type as the -surrounding one), the macro parameters having been replaced with the (already -evaluated) function arguments, and the parser will then parse the expression. -It is very much like a macro substitution, but using functional notation. +This construct is only syntactic sugar to benefit from functional notation. +Each time the function |foo| will be encountered the corresponding expression +will be inserted as a sub-expression (of the same type as the surrounding +one), the macro parameters having been replaced with the (already evaluated) +function arguments, and the parser will then have to parse the expression. It +is very much like a macro substitution, but with parentheses and comma +separated arguments (which can be arbitrary expressions themselves). \begin{everbatim} -Package xintexpr Info: (on line 3151) Function foo for the expression parsers is associated to \XINT_expr_macrofu -nc_foo with meaning macro:#1,#2,#3,->add(mul(x+i, i=\XINT_expr_wrapit {#1}..\XI -NT_expr_wrapit {#2}),x=1..\XINT_expr_wrapit {#3}) +nc_foo with meaning macro:#1#2#3->add(mul(x+i, i=\XINT_expr_wrapit {#1}..\XINT_ +expr_wrapit {#2}),x=1..\XINT_expr_wrapit {#3}) \end{everbatim} - -This is thus very different from a function defined via |\xintdeffunc| which -expands to some (possibly very complicated) nesting of various macro calls, -which were determined at the time of the function definition. But (see -\autoref{sssec:limitations}) it is not currently possible to define a |foo| -function like the one above via |\xintdeffunc|. +Thus, this works with quite arbitrary constructs, contrarily to the mechanism +of |\xintdeffunc|. It is not currently possible to define a |foo| function +like the one above via |\xintdeffunc|.% +% +\footnote{Or rather, it turns out that no error is raised on making the + definition via \csbxint{deffunc} but the created supporting macro is only + garbage and raises errors on use.} One can declare a function |foo| with |[0]| arguments but it must be used as |foo(nil)|, as |foo()| with no argument would generate an error. @@ -6626,11 +6773,12 @@ margin annotation signals what is the argument type. digits. With \xintfracname loaded, \csbxint{Num} is extended to accept fractions and its action is to truncate them to integers. - At |1.2o|\CHANGEDf{1.2o} many macros from \xintcorename/\xintname which + At |1.2o| many macros from \xintcorename/\xintname which use \csbxint{Num} to parse their arguments got deprecated, see \autoref{ssec:coredeprecated}, \autoref{ssec:xintdeprecated}, and \autoref{ssec:xintdeprecatedNum}. + All these macros have now been removed at |1.3|.\CHANGEDf{1.3} \item the fraction input format\ntype{\Ff} applies to the arguments of \xintfracname macros handling genuine fractions. It allows two types @@ -7245,11 +7393,8 @@ control sequence) must be left undefined. I trust it will be |;-)|.% Deprecated macros also generate an (expandable) error message. Just hit the |RETURN| key once to proceed.\IMPORTANT\ Most deprecated macros at |1.2o| are listed either in \autoref{ssec:coredeprecated} or -\autoref{ssec:xintdeprecated} or \autoref{ssec:xintdeprecatedNum}. They will -get removed at some future release. Replace them with the correctly named ones -(possibly with additional usage of \csbxint{Num} if really needed); in most -cases loading \xintfracname resolves these deprecations from -\xintcorename/\xintname. +\autoref{ssec:xintdeprecated} or \autoref{ssec:xintdeprecatedNum}. All +were removed at |1.3|.\CHANGED{1.3} The expression parsers are at |1.2l| still using a slightly less evolved method which lets \TeX{} display an undefined control sequence name giving @@ -7810,6 +7955,10 @@ But I have modified it to use \csbxint{NewFunction} which is available since |1.2i|. This is good opportunity to illustrate how \csbxint{NewFunction} can be used to define a recursive function (here modular exponentiation.) +The modular exponentiation can be defined as a genuine |\xintiiexpr|-function +since |1.3|. The others still have the problem of using |iter|, or |break| +statements which are not compatible with \csbxint{deffunc}. + The |isPseudoPrime(n)| is usable in \csbxint{iiexpr}-essions and establishes if its (positive) argument is a Miller-Rabin PseudoPrime to the bases $2, 3, 5, 7, 11, 13, 17$. If this is true and $n<341550071728321$ (which has 15 @@ -7838,19 +7987,31 @@ then write a very fast expandable primality test for such numbers using only % #1=x, #2=m, #3=N, compute x^m modulo N (with m non negative) % We will always use it with 1< x < N hence we skip an initial reduction modulo N. -% We can not use \xintdefiifunction for such recursive definition but -% \xintNewFunction succeeds! -\xintNewFunction{powmod}[3]{% x = #1, m = #2, n = #3 - (#2)? - % m non zero (assume positive), and look if m=1 - {(#2=1)?{#1/:#3} - {odd(#2)?{(#1*sqr(powmod(#1,#2//2,#3)))/:#3} - {sqr(powmod(#1,#2//2,#3))/:#3}}} +\xintdefiifunc powmod(x, m, n) := + if(m, + % m non zero (assume positive) + if(m=1, + % m=1, return x modulo n + x /: n, + % m > 1 test if odd or even and do recursive call + if(odd(m), (x*sqr(powmod(x, m//2, n))) /: n, + sqr(powmod(x, m//2, n)) /: n + ) + ), % m is zero, return 1 - {1}} + 1); + +% See http://tex.stackexchange.com/a/165008 for a (perhaps slightly +% faster) macro-only approach not using \xintexpr. But since 1.3 the above +% is indeed associated with a single (!) f-expandable macro. Here is its +% (recursive) meaning (with end of lines added by TeX when writing to the log): -% See http://tex.stackexchange.com/a/165008 for a (probably faster) macro-only approach -% not using \xintexpr. +% Function powmod for \xintiiexpr parser associated to \XINT_iiexpr_userfunc_ +% powmod with meaning macro:#1#2#3->\xintifNotZero {#2}{\xintifNotZero {\xintiiEq +% {#2}{1}}{\xintiiMod {#1}{#3}}{\xintifNotZero {\xintiiOdd {#2}}{\xintiiMod {\xi +% ntiiMul {#1}{\xintiiSqr {\csname XINT_iiexpr_userfunc_powmod\endcsname {#1}{\xi +% ntiiDivFloor {#2}{2}}{#3}}}}{#3}}{\xintiiMod {\xintiiSqr {\csname XINT_iiexpr_u +% serfunc_powmod\endcsname {#1}{\xintiiDivFloor {#2}{2}}{#3}}}{#3}}}}{1} % II ------------------------------ Miller-Rabin compositeness witness @@ -7876,7 +8037,7 @@ then write a very fast expandable primality test for such numbers using only % let's use again xintexpr indecipherable (except to author) syntax. Of course % doing it with macros only would be faster. -% Here \xintdefiifunction is not usable because not compatible with iter, break, ... +% Here \xintdefiifunc is not usable because not compatible with iter, break, ... % but \xintNewFunction comes to the rescue. \xintNewFunction{isCompositeWitness}[4]{% x=#1, n=#2, m=#3, k=#4 @@ -8693,7 +8854,7 @@ does not do any expansion of its second argument but inserts it in the upcoming token stream precisely |x| times. Using it with a negative |x| raises no error and does nothing.% % -\footnote{This behavior may change in future.} +\footnote{This behaviour may change in future.} Note that expansion must be triggered by a |\romannumeral|. @@ -8746,33 +8907,30 @@ strict integer format on output, except:\IMPORTANT \item \csbxint{iNum} which converts to strict integer format an input in \emph{extended} integer format, i.e. admitting multiple leading plus or minus signs, then possibly leading zeroes, then digits, -\item \csbxint{Num} which is an alias for the former, which gets redefined by +\item and \csbxint{Num} which is an alias for the former, which gets redefined by \xintfracname to accept more generally also decimal numbers or fractions as input and which truncates them to integers. -\item most macros listed in \autoref{ssec:coredeprecated}. They will get - removed at some future release. \end{itemize} -Most deprecated macros listed in \autoref{ssec:coredeprecated} were by design -applying \csbxint{Num} to their inputs. This was signaled in the macro -description by a \smash{\textcolor[named]{PineGreen}{\Numf}} sign in the -margin,\IMPORTANT and typically the macro had a single |i| in its name, for -example \csa{xintiAdd} was such a companion to \csa{xintiiAdd}. \xintfracname -redefined \csbxint{Num} to be the a macro accepting general fractional input -and truncating it to an integer. Hence a macro such as \csa{xintiAdd} was -compatible with the output format of \xintfracname macros, contrarily to -\csbxint{iiAdd} which handles only strict integer format for its inputs. Of -course, \xintfracname defined also its own \csbxint{Add} which did the -addition of its arguments without truncating them to integers... (but whose -output format is the |A/B[N]| format explained in \autoref{ssec:outputs}, -hence even if representing a small integer it can not be used directly in a -\TeX\ context such as |\ifnum|, contrarily to deprecated \csa{xintiAdd} or to -\csbxint{iiAdd}.) +Most removed macros listed in \autoref{ssec:coredeprecated} were by design +applying \csbxint{Num} to their inputs. Typically these macros had a single +|i| in their names, for example \csa{xintiAdd} was such a companion to +\csa{xintiiAdd}. \xintfracname redefined \csbxint{Num} to be the macro +accepting general fractional input and truncating it to an integer. Hence a +macro such as \csa{xintiAdd} was compatible with the output format of +\xintfracname macros, contrarily to \csbxint{iiAdd} which handles only strict +integer format for its inputs. Of course, \xintfracname defined also its own +\csbxint{Add} which did the addition of its arguments without truncating them +to integers... but whose output format is the |A/B[N]| format explained in +\autoref{ssec:outputs}, hence even if representing a small integer it can not +be used directly in a \TeX\ context such as |\ifnum|, contrarily to +\csa{xintiAdd} or to \csbxint{iiAdd}. \begin{framed} - This situation\CHANGEDf{1.2o} was the result of some early-on design + This situation was the result of some early-on design decisions which now appear misguided and impede further development. Hence, - at |1.2o| it has been decided to deprecate \emph{all} such |i|-macros. + at |1.2o| it has been decided to deprecate \emph{all} such |i|-macros. And + they got removed from the package at |1.3|.\CHANGEDf{1.3} \end{framed} The |ii| in the names of the macros such as \csbxint{iiAdd} serves to stress that they accept only strict integers as input (this is signaled by the margin @@ -9017,11 +9175,9 @@ retained as \csa{xintiiModTrunc}.\CHANGED{1.2p} more general inputs. It then becomes an alias to \csbxint{TTrunc} which truncates the general input to an integer in strict format. -\subsection{Deprecated macros}\label{ssec:coredeprecated} +\subsection{Removed macros}\label{ssec:coredeprecated} -These macros work as in earlier releases but will also generate an error (in -interactive mode, just hit the return key to proceed). They will get removed -at some future release:\DEPRECATED{1.2o} +These macros were deprecated at |1.2o| and removed at |1.3|.\CHANGED{1.3} |\xintiiFDg| (renamed to \csbxint{FDg}), |\xintiiLDg| (renamed to \csbxint{LDg}), |\xintiOpp|, @@ -9095,8 +9251,8 @@ needed if the input is obtained as a nested chain of \xintfracname macros for example. Prior to release |1.2o|, \xintname defined additional macros which applied -\csbxint{Num} to their input arguments. All these macros are now deprecated -and they will get removed at some future release.\CHANGED{1.2o} +\csbxint{Num} to their input arguments. All these macros were deprecated at +|1.2o| and have been removed at |1.3|.\CHANGED{1.3} See \autoref{ssec:expansions} for the significance of the \textcolor[named]{PineGreen}{\Numf}, \textcolor[named]{PineGreen}{\emph{f}}, @@ -9229,7 +9385,6 @@ simultaneously. |\xintiiNotEq|\n\m\etype{ff} returns 0 if |N=M|, 1 otherwise. -Former denomination \csa{xintiiNeq} is deprecated. \subsection{\csbh{xintiiGeq}}\label{xintiiGeq} @@ -9592,8 +9747,6 @@ logic» type macros next. {\small |\xintiiiszero| serves as lowercase companion macro.\par} -Its former name was \csa{xintNot} which is now deprecated and will be removed -at some future release. \subsection{\csbh{xintAND}}\label{xintAND} @@ -9635,12 +9788,10 @@ The list argument may be a macro, it is \fexpan ded first. \xintfracname loaded its meaning is \hyperref[xintLenFrac]{modified} to accept more general inputs. -\subsection{Deprecated macros (they require \xintfracname)}\label{ssec:xintdeprecated} +\subsection{Removed macros (they require \xintfracname)}\label{ssec:xintdeprecated} -These macros get their definitive definitions only from loading \xintfracname. -With only \xintname loaded they raise an error message (but then -operate as in former releases.) They will get removed -from \xintname at some future release:\DEPRECATED{1.2o} +These macros now require \xintfracname. They have been removed from \xintname +at |1.3|.\CHANGED{1.3} |\xintEq|, |\xintNeq|, |\xintGeq|, @@ -9663,16 +9814,13 @@ from \xintname at some future release:\DEPRECATED{1.2o} |\xintifOne|, |\xintifOdd|. -With the exception of |\xintNeq| which is renamed to |\xintNotEq|, the above -listed macros belong to \xintfracname, which extends their scope to handle -decimal numbers and fractions (|\xintOdd|, |\xintEven|, |\xintifOdd| will test -the argument after truncation to an integer.) Thus loading \xintfracname -overrides the \xintname deprecations. +With the exception of |\xintNeq| which was renamed to |\xintNotEq|, the above +listed macros all belong to \xintfracname. -\subsection{Deprecated macros using \csbh{xintNum}}\label{ssec:xintdeprecatedNum} +\subsection{Removed macros (they used \csbh{xintNum})}\label{ssec:xintdeprecatedNum} -These macros filter their arguments via \csbxint{Num}. They are deprecated and -will be removed at some future release:\DEPRECATED{1.2o} +These macros filtered their arguments via \csbxint{Num}. They got deprecated +at |1.2o| and removed at |1.3|:\CHANGED{1.3} |\xintMON|, |\xintMMON|, |\xintiMax|, @@ -9692,6 +9840,14 @@ will be removed at some future release:\DEPRECATED{1.2o} First version of this package was in release |1.03| (|2013/04/14|) of the \xintname bundle. +At release |1.3| (|2018/02/28|) the behaviour of \csbxint{Add} (and of +\csbxint{Sub}) was modified:\CHANGED{1.3} when adding |a/b| and |c/d| they +will use always the least common multiple of the denominators. This helps +limit the build-up of denominators, but the author still hesitates if the +fraction should be reduced to smallest terms. The current method allows (for +example when multiplying two polynomials) to keep a well-predictable +denominator among various terms, even though some may be reducible. + \localtableofcontents \def\x{|{x}|} @@ -9801,7 +9957,7 @@ trailing zeroes of |A| and |B| are suppressed and |N| is accordingly adjusted. This puts the fraction\etype{\Ff} into its unique irreducible form: \begin{everbatim*} -\xintIrr {178.256/256.178}, \xintIrr {178000/25600000[17]} +\xintIrr {178.256/256.1780}, \xintIrr {178000/25600000[17]} \end{everbatim*} The current implementation does not cleverly first factor powers of @@ -9817,6 +9973,30 @@ in cases where it turns out that |B=1|. Use \csbxint{PRaw} on top of \csa{xintIrr} if it is needed to get rid of such a trailing |/1|. +\subsection{\csbh{xintPIrr}}\label{xintPIrr} + +This puts the fraction\etype{\Ff} into irreducible form, +\emph{keeping as is the + decimal part} |[N]| from raw internal |A/B[N]| format.\NewWith{1.3} +(|P| stands here for \emph{Partial}) +\begin{everbatim*} +\xintPIrr {178.256/256.1780}, \xintPIrr {178000/25600000[17]} +\end{everbatim*} + +Notice that the output always has the ending |[N]|, which is exactly the +opposite of \csbxint{Irr}'s behaviour. The interest of this macro is mainly in +handling fractions which somehow acquired a big |[N]| (perhaps from input in +scientific notation) and for which the reduced fraction would have a very +large number of digits. This large number of digits can considerably slow-down +computations done afterwards. + +For example package \href{http://ctan.org/pkg/polexpr}{polexpr} uses +\csa{xintPIrr} when differentiating a polynomial, or in setting up a Sturm +chain for localization of the real roots of a polynomial. This is relevant to +polynomials whose coefficients were input in decimal notation, as this +automatically creates internally some |[N]|. Keeping and combining those +|[N]|'s during computations significantly increases their speed. + \subsection{\csbh{xintJrr}}\label{xintJrr} This also puts the fraction\etype{\Ff} into its unique irreducible form: @@ -9843,6 +10023,21 @@ from removing the |[N]| part if |N=0| and removing the |B| if |B=1|. \xintPRaw {123e10/321e10}, \xintPRaw {123e9/321e10}, \xintPRaw {\xintIrr{861/123}} \end{everbatim*} +\subsection{\csbh{xintDecToString}}\label{xintDecToString} + +This is\etype{\Ff} a macro tailored for printing decimal numbers. It does not +trim trailing zeros, use |\xintDecToString{\xintREZ{<foo>}}| for that. +\NewWith{1.3} +\begin{everbatim*} +\xintDecToString {123456789e5}\newline +\xintDecToString {123456789e-5}\newline +\xintDecToString {12345e-10}\newline +\xintDecToString {12345e-10/123}\par % just leave denominator as is +\end{everbatim*} +Consider it an unstable macro, what it does exactly is yet to be decided. It +is a backport from \href{http://ctan.org/pkg/polexpr}{polexpr}'s +|\PolDecToString|, which has now been made an alias to it. + \subsection{\csbh{xintTrunc}}\label{xintTrunc} \csa{xintTrunc}|{x}{f}|\etype{\numx\Ff} returns the integral part, a dot @@ -9852,7 +10047,7 @@ when the fraction is (or evaluates to) zero, then it simply prints \dtt{0} (with no dot). \begin{framed} - The argument |x| must be non-negative, the behavior is currently undefined + The argument |x| must be non-negative, the behaviour is currently undefined when |x<0| and will provoke errors. \end{framed} @@ -10188,7 +10383,6 @@ For choosing branches according to the result of comparing |f| and |g|, see |\xintNotEq{f}{g}|\etype{\Ff\Ff} returns 0 if |f=g|, 1 otherwise. -Former denomination \csa{xintNeq} is deprecated. \subsection{\csbh{xintGeq}}\label{xintGeq} @@ -10240,7 +10434,7 @@ even, and \dtt{0} otherwise. \subsection{\csbh{xintifSgn}}\label{xintifSgn} -\csbh{xintifSgn}\marg{f}\marg{B}\marg{C}\etype{\Ff nnn} executes either the +\csbh{xintifSgn}\marg{f}\marg{A}\marg{B}\marg{C}\etype{\Ff nnn} executes either the \meta{A}, \meta{B} or \meta{C} code, depending on its first argument being respectively negative, zero, or positive. @@ -10322,16 +10516,16 @@ where |\xintiiAbs {-2}| outputs \dtt{=\xintiiAbs {-2}}. Computes the addition\etype{\Ff\Ff} of two fractions. -Checks if one denominator is a multiple of the other. Else multiplies the -denominators. +Since |1.3| always uses the least common multiple of the +denominators.\CHANGED{1.3} \subsection{\csbh{xintSub}}\label{xintSub} Computes the difference\etype{\Ff\Ff} of two fractions (|\xintSub{F}{G}| computes |F-G|). -Checks if one denominator is a multiple of the other. Else multiplies the -denominators. +Since |1.3| always uses the least common multiple of the +denominators.\CHANGED{1.3} \subsection{\csbh{xintMul}}\label{xintMul} @@ -10388,8 +10582,6 @@ This is a convenience variant of \csbxint{iiFac} which applies \csbxint{Num} to its argument\etype{\Numf}. Notice however that the output will have a trailing |[0]| according to the \xintfracname format for integers. -The |\xintiFac| variant which does not add this |[0]| -is deprecated and will be removed at some future release. \subsection{\csbh{xintBinomial}}\label{xintBinomial} @@ -10398,8 +10590,6 @@ This is a convenience variant of \csbxint{iiBinomial} which applies output will have a trailing |[0]| according to the \xintfracname format for integers. -The |\xintiBinomial| variant which does not add this |[0]| -is deprecated and will be removed at some future release. \subsection{\csbh{xintPFactorial}}\label{xintPFactorial} @@ -10408,8 +10598,6 @@ This is a convenience variant of \csbxint{iiPFactorial} which applies output will have a trailing |[0]| according to the \xintfracname format for integers. -The |\xintiPFactorial| variant which does not add this |[0]| -is deprecated and will be removed at some future release. \subsection{\csbh{xintMax}}\label{xintMax} @@ -11554,16 +11742,16 @@ With |\xintverbosetrue| we will find in the log: \begin{everbatim} Function det3 for \xintexpr parser associated to \XINT_expr_userfunc_det3 w -ith meaning macro:#1,#2,#3,#4,#5,#6,#7,#8,#9,->\xintSub {\xintSub {\xintSub {\x -intAdd {\xintAdd {\xintMul {\xintMul {#1}{#5}}{#9}}{\xintMul {\xintMul {#2}{#6} -}{#7}}}{\xintMul {\xintMul {#3}{#4}}{#8}}}{\xintMul {\xintMul {#2}{#4}}{#9}}}{\ -xintMul {\xintMul {#3}{#5}}{#7}}}{\xintMul {\xintMul {#1}{#6}}{#8}} +ith meaning macro:#1#2#3#4#5#6#7#8#9->\xintSub {\xintSub {\xintSub {\xintAdd {\ +xintAdd {\xintMul {\xintMul {#1}{#5}}{#9}}{\xintMul {\xintMul {#2}{#6}}{#7}}}{\ +xintMul {\xintMul {#3}{#4}}{#8}}}{\xintMul {\xintMul {#2}{#4}}{#9}}}{\xintMul { +\xintMul {#3}{#5}}{#7}}}{\xintMul {\xintMul {#1}{#6}}{#8}} Package xintexpr Info: (on line 11) Function det3bis for \xintexpr parser associated to \XINT_expr_userfunc_det -3bis with meaning macro:#1,#2,#3,#4,#5,#6,#7,#8,#9,->\xintAdd {\xintSub {\xintM -ul {#1}{\xintSub {\xintMul {#5}{#9}}{\xintMul {#6}{#8}}}}{\xintMul {#2}{\xintSu -b {\xintMul {#4}{#9}}{\xintMul {#6}{#7}}}}}{\xintMul {#3}{\xintSub {\xintMul {# -4}{#8}}{\xintMul {#5}{#7}}}} +3bis with meaning macro:#1#2#3#4#5#6#7#8#9->\xintAdd {\xintSub {\xintMul {#1}{\ +csname XINT_expr_userfunc_det2\endcsname {#5}{#6}{#8}{#9}}}{\xintMul {#2}{\csna +me XINT_expr_userfunc_det2\endcsname {#4}{#6}{#7}{#9}}}}{\xintMul {#3}{\csname +XINT_expr_userfunc_det2\endcsname {#4}{#5}{#7}{#8}}} \end{everbatim} @@ -12467,6 +12655,14 @@ The arguments serving as indices are of the \numx{} expansion type. In some cases one or two of the macro arguments are only expanded at a later stage not immediately. +\begin{framed} + Since |1.3|, \csbxint{Add} and \csbxint{Sub} use systematically the least + common multiple of the denominators. Some of the comments in this chapter + refer to the earlier situation where often the denominators were simply + multiplied together. \emph{They have yet to be updated to reflect the new + situation brought by the |1.3| release.} Some of these comments may now be + off-synced from the actual computation results and thus may be wrong. +\end{framed} %% \clearpage \subsection{\csbh{xintSeries}}\label{xintSeries} @@ -15133,7 +15329,7 @@ this does not work:\par \csbxint{For}\ntype{on} is a new kind of for loop.\footnote{first introduced with \xintname |1.09c| of |2013/10/09|.} Rather than using macros -for encapsulating list items, its behavior is like a macro with parameters: +for encapsulating list items, its behaviour is like a macro with parameters: |#1|, |#2|, \dots, |#9| are used to represent the items for up to nine levels of nested loops. Here is an example: % @@ -15458,7 +15654,7 @@ the hundreds, as they will get converted into as many zeroes. We see here that \csbxint{Trunc} outputs (deliberately) zero as $0$, not (here) $0.000$, the idea being not to lose the information that the truncated thing was -truly zero. Perhaps this behavior should be changed? or made optional? Anyhow +truly zero. Perhaps this behaviour should be changed? or made optional? Anyhow printing of fixed points numbers should be dealt with via dedicated packages such as |numprint| or |siunitx|.\par @@ -15694,7 +15890,29 @@ be treated as first item) number. % This is \expandafter|\xintbndlversion| of \expandafter|\xintbndldate|. % % \begin{itemize} -% \item Release \expandafter|\xintbndlversion| of \expandafter|\xintbndldate| +% \item Release |1.3| of |2018/03/01|: +% \begin{itemize}[nosep] +% \item removed all macros previously deprecated at |1.2o|, +% \item modified addition, subtraction and modulo operations to use a least +% common multiple for the denominator of the result, +% \item added |\xintPIrr|, |\xintDecToString| and |preduce()|, +% \item and last but not least refactored extensively the +% |\xintNewExpr/\xintdeffunc| mechanism. It got both leaner and stronger +% and makes possible recursive function definitions. +% \end{itemize} +% +% \item Release |1.2q| of |2018/02/06| was a bugfix release with these changes: +% \begin{itemize}[nosep] +% \item fix to an |1.2l| \xintcorenameimp subtraction bug causing a breakage +% under some rare circumstances |:-(|. It was caused by a refactoring +% left-over (extra |!| in |\XINT_sub_l_Ida| replacement text), and should +% have been detected by the test suite, but manual testing from early days +% was not yet entirely included in our automated procedure. +% \item new feature: tacit multiplication in front of digits, for example +% |10!20!30!| or |(10+10)10|. +% \end{itemize} +% +% \item Release |1.2p| of |2017/12/05| % had some breaking changes: % \begin{itemize}[nosep] % \item new output for the |\xintBezout| macro (\xintgcdnameimp), @@ -15961,7 +16179,7 @@ be treated as first item) number. \fi \XINT_providespackage \ProvidesPackage {xintkernel}% - [2018/02/06 1.2q Paraphernalia for the xint packages (JFB)]% + [2018/03/01 1.3 Paraphernalia for the xint packages (JFB)]% % \end{macrocode} % \subsection{Constants} % \begin{macrocode} @@ -16547,7 +16765,7 @@ be treated as first item) number. % \begin{macrocode} \XINT_providespackage \ProvidesPackage{xinttools}% - [2018/02/06 1.2q Expandable and non-expandable utilities (JFB)]% + [2018/03/01 1.3 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.| @@ -18428,6 +18646,8 @@ be treated as first item) number. % later date, but for the time being the new routines are not commented at % all. % +% |1.3| removes all macros which were deprecated at |1.2o|. +% % \subsection{Catcodes, \protect\eTeX{} and reload detection} % % The code for reload detection was initially copied from \textsc{Heiko @@ -18485,7 +18705,7 @@ be treated as first item) number. % \begin{macrocode} \XINT_providespackage \ProvidesPackage{xintcore}% - [2018/02/06 1.2q Expandable arithmetic on big integers (JFB)]% + [2018/03/01 1.3 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 @@ -18731,11 +18951,6 @@ be treated as first item) number. {% \expandafter\XINT_sgn \romannumeral`&&@#1\xint: }% -\def\xintSgn {\romannumeral0\XINT_signaldeprecated{xintcore}{xintSgn}\xintsgn }% -\def\xintsgn #1% -{% - \expandafter\XINT_sgn \romannumeral0\xintnum{#1}\xint: -}% \def\XINT_sgn #1#2\xint: {% \xint_UDzerominusfork @@ -18771,11 +18986,6 @@ be treated as first item) number. {% \expandafter\XINT_opp \romannumeral`&&@#1% }% -\def\xintiOpp {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiOpp}\xintiopp }% -\def\xintiopp #1% -{% - \expandafter\XINT_opp \romannumeral0\xintnum{#1}% -}% \def\XINT_Opp #1{\romannumeral0\XINT_opp #1}% \def\XINT_opp #1% {% @@ -18796,11 +19006,6 @@ be treated as first item) number. {% \expandafter\XINT_abs \romannumeral`&&@#1% }% -\def\xintiAbs {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiAbs}\xintiabs }% -\def\xintiabs #1% -{% - \expandafter\XINT_abs \romannumeral0\xintnum{#1}% -}% \def\XINT_abs #1% {% \xint_UDsignfork @@ -18819,8 +19024,6 @@ be treated as first item) number. % \begin{macrocode} \def\xintFDg {\romannumeral0\xintfdg }% \def\xintfdg #1{\expandafter\XINT_fdg \romannumeral`&&@#1\xint:\Z}% -\def\xintiiFDg {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiiFDg}\xintiifdg }% -\let\xintiifdg\xintfdg \def\XINT_FDg #1% {\romannumeral0\expandafter\XINT_fdg\romannumeral`&&@\xintnum{#1}\xint:\Z }% \def\XINT_fdg #1#2#3\Z @@ -18847,8 +19050,6 @@ be treated as first item) number. \def\xintLDg {\romannumeral0\xintldg }% \def\xintldg #1{\expandafter\XINT_ldg_fork\romannumeral`&&@#1% \XINT_ldg_c{}{}{}{}{}{}{}{}\xint_bye\relax}% -\def\xintiiLDg {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiiLDg}\xintiildg }% -\let\xintiildg\xintldg \def\XINT_ldg_fork #1% {% \xint_UDsignfork @@ -19419,8 +19620,6 @@ be treated as first item) number. % \subsection{\csbh{xintiiAdd}} % \lverb|1.2l: \xintiiAdd made robust against non terminated input.| % \begin{macrocode} -\def\xintiAdd {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiAdd}\xintiadd }% -\def\xintiadd #1{\expandafter\XINT_iadd\romannumeral0\xintnum{#1}\xint:}% \def\xintiiAdd {\romannumeral0\xintiiadd }% \def\xintiiadd #1{\expandafter\XINT_iiadd\romannumeral`&&@#1\xint:}% \def\XINT_iiadd #1#2\xint:#3% @@ -19612,8 +19811,6 @@ be treated as first item) number. % 1.2o deprecates \xintCmp, with xintfrac loaded it will get overwritten anyhow. %| % \begin{macrocode} -\def\xintCmp {\romannumeral0\XINT_signaldeprecated{xintcore}{xintCmp}\xintcmp }% -\def\xintcmp #1{\expandafter\XINT_icmp\romannumeral0\xintnum{#1}\xint:}% \def\xintiiCmp {\romannumeral0\xintiicmp }% \def\xintiicmp #1{\expandafter\XINT_iicmp\romannumeral`&&@#1\xint:}% \def\XINT_iicmp #1#2\xint:#3% @@ -19753,8 +19950,6 @@ be treated as first item) number. \expandafter\XINT_sub_nfork\expandafter #1\romannumeral`&&@#3\xint:#2\xint: }% -\def\xintiSub {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiSub}\xintisub }% -\def\xintisub #1{\expandafter\XINT_isub\romannumeral0\xintnum{#1}\xint:}% \def\XINT_isub #1#2\xint:#3% {% \expandafter\XINT_sub_nfork\expandafter @@ -20071,15 +20266,6 @@ be treated as first item) number. % % 1.2l: \xintiiMul made robust against non terminated input.| % \begin{macrocode} -\def\xintiMul {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiMul}\xintimul }% -\def\xintimul #1% -{% - \expandafter\XINT_imul\romannumeral0\xintnum{#1}\xint: -}% -\def\XINT_imul #1#2\xint:#3% -{% - \expandafter\XINT_mul_nfork\expandafter #1\romannumeral0\xintnum{#3}\xint:#2\xint: -}% \def\xintiiMul {\romannumeral0\xintiimul }% \def\xintiimul #1% {% @@ -20331,10 +20517,6 @@ be treated as first item) number. % \lverb-#1 = A, #2 = B. On calcule le quotient et le reste dans la division % euclidienne de A par B: A=BQ+R, 0<= R < |B|.- % \begin{macrocode} -\def\xintiDivision {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiDivision}\xintidivision }% -\def\xintidivision #1{\expandafter\XINT_idivision\romannumeral0\xintnum{#1}\xint:}% -\def\XINT_idivision #1#2\xint:#3{\expandafter\XINT_iidivision_a\expandafter #1% - \romannumeral0\xintnum{#3}\xint:#2\xint:}% \def\xintiiDivision {\romannumeral0\xintiidivision }% \def\xintiidivision #1{\expandafter\XINT_iidivision \romannumeral`&&@#1\xint:}% \def\XINT_iidivision #1#2\xint:#3{\expandafter\XINT_iidivision_a\expandafter #1% @@ -21184,12 +21366,6 @@ be treated as first item) number. {\expandafter\xint_firstoftwo_thenstop\romannumeral0\xintiidivision }% \def\xintiirem {\expandafter\xint_secondoftwo_thenstop\romannumeral0\xintiidivision }% -\def\xintiQuo {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiQuo}\xintiquo }% -\def\xintiRem {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiRem}\xintirem }% -\def\xintiquo - {\expandafter\xint_firstoftwo_thenstop\romannumeral0\xintidivision }% -\def\xintirem - {\expandafter\xint_secondoftwo_thenstop\romannumeral0\xintidivision }% % \end{macrocode} % \subsection{\csh{xintiiDivRound}} % \lverb|1.1, transferred from first release of bnumexpr. Rewritten for 1.2. @@ -21197,9 +21373,6 @@ be treated as first item) number. % % 1.2l: \xintiiDivRound made robust against non terminated input.| % \begin{macrocode} -\def\xintiDivRound {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiDivRound}\xintidivround }% -\def\xintidivround #1% - {\expandafter\XINT_idivround\romannumeral0\xintnum{#1}\xint:}% \def\xintiiDivRound {\romannumeral0\xintiidivround }% \def\xintiidivround #1{\expandafter\XINT_iidivround\romannumeral`&&@#1\xint:}% \def\XINT_idivround #1#2\xint:#3% @@ -21242,8 +21415,6 @@ be treated as first item) number. % \subsection{\csh{xintiiDivTrunc}} % \lverb|1.2l: \xintiiDivTrunc made robust against non terminated input.| % \begin{macrocode} -\def\xintiDivTrunc {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiDivTrunc}\xintidivtrunc }% -\def\xintidivtrunc #1{\expandafter\XINT_iidivtrunc\romannumeral0\xintnum{#1}\xint:}% \def\xintiiDivTrunc {\romannumeral0\xintiidivtrunc }% \def\xintiidivtrunc #1{\expandafter\XINT_iidivtrunc\romannumeral`&&@#1\xint:}% \def\XINT_iidivtrunc #1#2\xint:#3{\expandafter\XINT_iidivtrunc_a\expandafter #1% @@ -21281,8 +21452,6 @@ be treated as first item) number. % \subsection{\csh{xintiiModTrunc}} % \lverb|Renamed from \xintiiMod to \xintiiModTrunc at 1.2p.| % \begin{macrocode} -\def\xintiMod {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiMod}\xintimod }% -\def\xintimod #1{\expandafter\XINT_iimodtrunc\romannumeral0\xintnum{#1}\xint:}% \def\xintiiModTrunc {\romannumeral0\xintiimodtrunc }% \def\xintiimodtrunc #1{\expandafter\XINT_iimodtrunc\romannumeral`&&@#1\xint:}% \def\XINT_iimodtrunc #1#2\xint:#3{\expandafter\XINT_iimodtrunc_a\expandafter #1% @@ -21377,11 +21546,6 @@ be treated as first item) number. {% \expandafter\XINT_sqr\romannumeral0\xintiiabs{#1}\xint: }% -\def\xintiSqr {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiSqr}\xintisqr }% -\def\xintisqr #1% -{% - \expandafter\XINT_sqr\romannumeral0\xintiabs{#1}\xint: -}% \def\XINT_sqr #1\xint: {% \expandafter\XINT_sqr_a @@ -21449,12 +21613,6 @@ be treated as first item) number. \expandafter\xint_pow\the\numexpr #2\expandafter .\romannumeral`&&@#1\xint: }% -\def\xintiPow {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiPow}\xintipow }% -\def\xintipow #1#2% -{% - \expandafter\xint_pow\the\numexpr #2\expandafter - .\romannumeral0\xintnum{#1}\xint: -}% \def\xint_pow #1.#2%#3\xint: {% \xint_UDzerominusfork @@ -21667,8 +21825,6 @@ be treated as first item) number. % \begin{macrocode} \def\xintiiFac {\romannumeral0\xintiifac }% \def\xintiifac #1{\expandafter\XINT_fac_fork\the\numexpr#1.}% -\def\xintiFac {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiFac}\xintifac }% -\let\xintifac \xintiifac % redefined by xintfrac \def\XINT_fac_fork #1#2.% {% \xint_UDzerominusfork @@ -21789,7 +21945,7 @@ be treated as first item) number. % \end{macrocode} % \subsection*{At End of \LaTeX\ Document deprecation message} % \addcontentsline{toc}{subsection}{At End of \LaTeX\ Document deprecation message} -% \lverb|1.2o| +% \lverb|1.2o. Updated at 1.3 which actually removed all deprecated macros.| % \begin{macrocode} \ifdefined\documentclass\ifdefined\AtEndDocument \AtEndDocument{% @@ -21815,7 +21971,7 @@ be treated as first item) number. \XINT_ifFlagRaised{xintiSqr}{\string\xintiSqr\MessageBreak}{}% \XINT_ifFlagRaised{xintiPow}{\string\xintiPow\MessageBreak}{}% \XINT_ifFlagRaised{xintiFac}{\string\xintiFac\MessageBreak}{}% -They will get removed at some future release.}}% +This is not possible because they all got removed from xintcore at 1.3!}}% {% no deprecated macro used (at top level...) }% }\fi\fi @@ -21850,6 +22006,8 @@ They will get removed at some future release.}}% % |\xintiiSub|, |\xintiiMul|, |\xintiiQuo|, |\xintiiPow| were separated to be % the main component of the then new % \xintcorenameimp. +% +% At |1.3| the macros deprecated at |1.2o| got all removed. % \begin{macrocode} \begingroup\catcode61\catcode48\catcode32=10\relax% \catcode13=5 % ^^M @@ -21899,7 +22057,7 @@ They will get removed at some future release.}}% % \begin{macrocode} \XINT_providespackage \ProvidesPackage{xint}% - [2018/02/06 1.2q Expandable operations on big integers (JFB)]% + [2018/03/01 1.3 Expandable operations on big integers (JFB)]% % \end{macrocode} % \subsection{More token management} % \begin{macrocode} @@ -22346,14 +22504,11 @@ They will get removed at some future release.}}% % \subsection{\csh{xintiiEq}} % \lverb|no \xintiieq.| % \begin{macrocode} -\def\xintEq {\romannumeral0\XINT_signaldeprecated{xint}{xintEq}\xinteq }% -\def\xinteq #1#2{\xintifeq{#1}{#2}{1}{0}}% \def\xintiiEq #1#2{\romannumeral0\xintiiifeq{#1}{#2}{1}{0}}% % \end{macrocode} % \subsection{\csh{xintiiNotEq}} % \lverb|Pour xintexpr. Pas de version en lowercase.| % \begin{macrocode} -\def\xintNeq #1#2{\romannumeral0\XINT_signaldeprecated{xint}{xintNeq}\xintifeq {#1}{#2}{0}{1}}% \def\xintiiNotEq #1#2{\romannumeral0\xintiiifeq {#1}{#2}{0}{1}}% % \end{macrocode} % \subsection{\csh{xintiiGeq}} @@ -22368,8 +22523,6 @@ They will get removed at some future release.}}% % This macro should have been called \xintGEq for example. % | % \begin{macrocode} -\def\xintGeq {\romannumeral0\XINT_signaldeprecated{xint}{xintGeq}\xintgeq }% -\def\xintgeq #1{\expandafter\XINT_geq\romannumeral0\xintnum{#1}\xint:}% \def\xintiiGeq {\romannumeral0\xintiigeq }% \def\xintiigeq #1{\expandafter\XINT_iigeq\romannumeral`&&@#1\xint:}% \def\XINT_iigeq #1#2\xint:#3% @@ -22413,32 +22566,24 @@ They will get removed at some future release.}}% % \end{macrocode} % \subsection{\csh{xintiiGt}} % \begin{macrocode} -\def\xintGt {\romannumeral0\XINT_signaldeprecated{xint}{xintGt}\xintgt }% -\def\xintgt #1#2{\xintifgt{#1}{#2}{1}{0}}% \def\xintiiGt #1#2{\romannumeral0\xintiiifgt{#1}{#2}{1}{0}}% % \end{macrocode} % \subsection{\csh{xintiiLt}} % \begin{macrocode} -\def\xintLt {\romannumeral0\XINT_signaldeprecated{xint}{xintLt}\xintlt }% -\def\xintlt #1#2{\xintiflt{#1}{#2}{1}{0}}% \def\xintiiLt #1#2{\romannumeral0\xintiiiflt{#1}{#2}{1}{0}}% % \end{macrocode} % \subsection{\csh{xintiiGtorEq}} % \begin{macrocode} -\def\xintGtorEq #1#2{\romannumeral0\XINT_signaldeprecated{xint}{xintGtorEq}\xintiflt {#1}{#2}{0}{1}}% \def\xintiiGtorEq #1#2{\romannumeral0\xintiiiflt {#1}{#2}{0}{1}}% % \end{macrocode} % \subsection{\csh{xintiiLtorEq}} % \begin{macrocode} -\def\xintLtorEq #1#2{\romannumeral0\XINT_signaldeprecated{xint}{xintLtorEq}\xintifgt {#1}{#2}{0}{1}}% \def\xintiiLtorEq #1#2{\romannumeral0\xintiiifgt {#1}{#2}{0}{1}}% % \end{macrocode} % \subsection{\csh{xintiiIsZero}} % \lverb|1.09a. restyled in 1.09i. 1.1 adds \xintiiIsZero, etc... for % optimization in \xintexpr| % \begin{macrocode} -\def\xintIsZero {\romannumeral0\XINT_signaldeprecated{xint}{xintIsZero}\xintiszero }% -\def\xintiszero #1{\if0\xintSgn{#1}\xint_afterfi{ 1}\else\xint_afterfi{ 0}\fi}% \def\xintiiIsZero {\romannumeral0\xintiiiszero }% \def\xintiiiszero #1{\if0\xintiiSgn{#1}\xint_afterfi{ 1}\else\xint_afterfi{ 0}\fi}% % \end{macrocode} @@ -22446,9 +22591,6 @@ They will get removed at some future release.}}% % \lverb|1.09a. restyled in 1.09i. 1.1 adds \xintiiIsZero, etc... for % optimization in \xintexpr| % \begin{macrocode} -\def\xintIsNotZero {\romannumeral0\XINT_signaldeprecated{xint}{xintIsNotZero}\xintisnotzero }% -\def\xintisnotzero - #1{\if0\xintSgn{#1}\xint_afterfi{ 0}\else\xint_afterfi{ 1}\fi}% \def\xintiiIsNotZero {\romannumeral0\xintiiisnotzero }% \def\xintiiisnotzero #1{\if0\xintiiSgn{#1}\xint_afterfi{ 0}\else\xint_afterfi{ 1}\fi}% @@ -22465,8 +22607,6 @@ They will get removed at some future release.}}% % \begin{macrocode} \def\xintiiIsOne {\romannumeral0\xintiiisone }% \def\xintiiisone #1{\expandafter\XINT_isone\romannumeral`&&@#1XY}% -\def\xintIsOne {\romannumeral0\XINT_signaldeprecated{xint}{xintIsOne}\xintisone }% -\def\xintisone #1{\expandafter\XINT_isone\romannumeral0\xintnum{#1}XY}% \def\XINT_isone #1#2#3Y% {% \unless\if#2X\xint_dothis{ 0}\fi @@ -22494,15 +22634,6 @@ They will get removed at some future release.}}% \xint_afterfi{ 0}% \fi }% -\def\xintOdd {\romannumeral0\XINT_signaldeprecated{xint}{xintOdd}\xintodd }% -\def\xintodd #1% -{% - \ifodd\xintLDg{\xintNum{#1}} %<- intentional space - \xint_afterfi{ 1}% - \else - \xint_afterfi{ 0}% - \fi -}% % \end{macrocode} % \subsection{\csh{xintiiEven}} % \begin{macrocode} @@ -22515,15 +22646,6 @@ They will get removed at some future release.}}% \xint_afterfi{ 1}% \fi }% -\def\xintEven {\romannumeral0\XINT_signaldeprecated{xint}{xintEven}\xinteven }% -\def\xinteven #1% -{% - \ifodd\xintLDg{\xintNum{#1}} %<- intentional space - \xint_afterfi{ 0}% - \else - \xint_afterfi{ 1}% - \fi -}% % \end{macrocode} % \subsection{\csh{xintiiMON}} % \lverb|MINUS ONE TO THE POWER N| @@ -22537,15 +22659,6 @@ They will get removed at some future release.}}% \xint_afterfi{ 1}% \fi }% -\def\xintMON {\romannumeral0\XINT_signaldeprecated{xint}{xintMON}\xintmon }% -\def\xintmon #1% -{% - \ifodd\xintLDg{\xintNum{#1}} %<- intentional space - \xint_afterfi{ -1}% - \else - \xint_afterfi{ 1}% - \fi -}% % \end{macrocode} % \subsection{\csh{xintiiMMON}} % \lverb|MINUS ONE TO THE POWER N-1| @@ -22559,15 +22672,6 @@ They will get removed at some future release.}}% \xint_afterfi{ -1}% \fi }% -\def\xintMMON {\romannumeral0\XINT_signaldeprecated{xint}{xintMMON}\xintmmon }% -\def\xintmmon #1% -{% - \ifodd\xintLDg{\xintNum{#1}} %<- intentional space - \xint_afterfi{ 1}% - \else - \xint_afterfi{ -1}% - \fi -}% % \end{macrocode} % \subsection{\csh{xintSgnFork}} % \lverb|Expandable three-way fork added in 1.07. The argument #1 must expand @@ -22592,15 +22696,6 @@ They will get removed at some future release.}}% % 1.1 adds \xintiiifSgn for optimization in xintexpr-essions. Should I move % them to xintcore? (for bnumexpr)| % \begin{macrocode} -\def\xintifSgn {\romannumeral0\XINT_signaldeprecated{xint}{xintifSgn}\xintifsgn }% -\def\xintifsgn #1% -{% - \ifcase \xintSgn{#1} - \expandafter\xint_secondofthree_thenstop - \or\expandafter\xint_thirdofthree_thenstop - \else\expandafter\xint_firstofthree_thenstop - \fi -}% \def\xintiiifSgn {\romannumeral0\xintiiifsgn }% \def\xintiiifsgn #1% {% @@ -22615,15 +22710,6 @@ They will get removed at some future release.}}% % \lverb|1.09e % \xintifCmp {n}{m}{if n<m}{if n=m}{if n>m}. 1.1a adds ii variant| % \begin{macrocode} -\def\xintifCmp {\romannumeral0\XINT_signaldeprecated{xint}{xintifCmp}\xintifcmp }% -\def\xintifcmp #1#2% -{% - \ifcase\xintCmp {#1}{#2} - \expandafter\xint_secondofthree_thenstop - \or\expandafter\xint_thirdofthree_thenstop - \else\expandafter\xint_firstofthree_thenstop - \fi -}% \def\xintiiifCmp {\romannumeral0\xintiiifcmp }% \def\xintiiifcmp #1#2% {% @@ -22637,14 +22723,6 @@ They will get removed at some future release.}}% % \subsection{\csh{xintiiifEq}} % \lverb|1.09a \xintifEq {n}{m}{YES if n=m}{NO if n<>m}. 1.1a adds ii variant| % \begin{macrocode} -\def\xintifEq {\romannumeral0\XINT_signaldeprecated{xint}{xintifEq}\xintifeq }% -\def\xintifeq #1#2% -{% - \if0\xintCmp{#1}{#2}% - \expandafter\xint_firstoftwo_thenstop - \else\expandafter\xint_secondoftwo_thenstop - \fi -}% \def\xintiiifEq {\romannumeral0\xintiiifeq }% \def\xintiiifeq #1#2% {% @@ -22657,14 +22735,6 @@ They will get removed at some future release.}}% % \subsection{\csh{xintiiifGt}} % \lverb|1.09a \xintifGt {n}{m}{YES if n>m}{NO if n<=m}. 1.1a adds ii variant| % \begin{macrocode} -\def\xintifGt {\romannumeral0\XINT_signaldeprecated{xint}{xintifGt}\xintifgt }% -\def\xintifgt #1#2% -{% - \if1\xintCmp{#1}{#2}% - \expandafter\xint_firstoftwo_thenstop - \else\expandafter\xint_secondoftwo_thenstop - \fi -}% \def\xintiiifGt {\romannumeral0\xintiiifgt }% \def\xintiiifgt #1#2% {% @@ -22678,14 +22748,6 @@ They will get removed at some future release.}}% % \lverb|1.09a \xintifLt {n}{m}{YES if n<m}{NO if n>=m}. Restyled in 1.09i. % 1.1a adds ii variant| % \begin{macrocode} -\def\xintifLt {\romannumeral0\XINT_signaldeprecated{xint}{xintifLt}\xintiflt }% -\def\xintiflt #1#2% -{% - \ifnum\xintCmp{#1}{#2}<\xint_c_ - \expandafter\xint_firstoftwo_thenstop - \else \expandafter\xint_secondoftwo_thenstop - \fi -}% \def\xintiiifLt {\romannumeral0\xintiiiflt }% \def\xintiiiflt #1#2% {% @@ -22703,15 +22765,6 @@ They will get removed at some future release.}}% % % 1.2o deprecates \xintifZero.| % \begin{macrocode} -\def\xintifZero {\romannumeral0\XINT_signaldeprecated{xint}{xintifZero}\xintifzero }% -\def\xintifzero #1% -{% - \if0\xintSgn{#1}% - \expandafter\xint_firstoftwo_thenstop - \else - \expandafter\xint_secondoftwo_thenstop - \fi -}% \def\xintiiifZero {\romannumeral0\xintiiifzero }% \def\xintiiifzero #1% {% @@ -22724,15 +22777,6 @@ They will get removed at some future release.}}% % \end{macrocode} % \subsection{\csh{xintiiifNotZero}} % \begin{macrocode} -\def\xintifNotZero {\romannumeral0\XINT_signaldeprecated{xint}{xintifNotZero}\xintifnotzero }% -\def\xintifnotzero #1% -{% - \if0\xintSgn{#1}% - \expandafter\xint_secondoftwo_thenstop - \else - \expandafter\xint_firstoftwo_thenstop - \fi -}% \def\xintiiifNotZero {\romannumeral0\xintiiifnotzero }% \def\xintiiifnotzero #1% {% @@ -22755,15 +22799,6 @@ They will get removed at some future release.}}% \expandafter\xint_secondoftwo_thenstop \fi }% -\def\xintifOne {\romannumeral0\XINT_signaldeprecated{xint}{xintifOne}\xintifone }% -\def\xintifone #1% -{% - \if1\xintIsOne{#1}% - \expandafter\xint_firstoftwo_thenstop - \else - \expandafter\xint_secondoftwo_thenstop - \fi -}% % \end{macrocode} % \subsection{\csh{xintiiifOdd}} % \lverb|1.09e. Restyled in 1.09i. 1.1a adds \xintiiifOdd.| @@ -22777,15 +22812,6 @@ They will get removed at some future release.}}% \expandafter\xint_secondoftwo_thenstop \fi }% -\def\xintifOdd {\romannumeral0\XINT_signaldeprecated{xint}{xintifOdd}\xintifodd }% -\def\xintifodd #1% -{% - \if\xintOdd{#1}1% - \expandafter\xint_firstoftwo_thenstop - \else - \expandafter\xint_secondoftwo_thenstop - \fi -}% % \end{macrocode} % \subsection{\csh{xintifTrueAelseB}, \csh{xintifFalseAelseB}} % \lverb|1.09i. 1.2i has removed deprecated \xintifTrueFalse, \xintifTrue. @@ -22808,7 +22834,6 @@ They will get removed at some future release.}}% % denomination deprecated at 1.2o. Besides, the macro is now defined as ii-type. % | % \begin{macrocode} -\def\xintNot{\romannumeral0\XINT_signaldeprecated{xint}{xintNot}\xintiiiszero}% \def\xintNOT{\romannumeral0\xintiiiszero}% % \end{macrocode} % \subsection{\csh{xintAND}, \csh{xintOR}, \csh{xintXOR}} @@ -22898,15 +22923,6 @@ They will get removed at some future release.}}% % And on this occasion I reduced even more number of times input is grabbed. % | % \begin{macrocode} -\def\xintiMax {\romannumeral0\XINT_signaldeprecated{xint}{xintiMax}\xintimax }% -\def\xintimax #1% -{% - \expandafter\xint_max\romannumeral0\xintnum{#1}\xint: -}% -\def\xint_max #1\xint:#2% -{% - \expandafter\XINT_max_fork\romannumeral0\xintnum{#2}\xint:#1\xint: -}% \def\xintiiMax {\romannumeral0\xintiimax }% \def\xintiimax #1% {% @@ -22978,15 +22994,6 @@ They will get removed at some future release.}}% % And on this occasion I reduced even more number of times input is grabbed. % | % \begin{macrocode} -\def\xintiMin {\romannumeral0\XINT_signaldeprecated{xint}{xintiMin}\xintimin }% -\def\xintimin #1% -{% - \expandafter\xint_min\romannumeral0\xintnum{#1}\xint: -}% -\def\xint_min #1\xint:#2% -{% - \expandafter\XINT_min_fork\romannumeral0\xintnum{#2}\xint:#1\xint: -}% \def\xintiiMin {\romannumeral0\xintiimin }% \def\xintiimin #1% {% @@ -23038,21 +23045,6 @@ They will get removed at some future release.}}% % % 1.2l made \xintiiMaxof robust against non terminated items.| % \begin{macrocode} -\def\xintiMaxof {\romannumeral0\XINT_signaldeprecated{xint}{xintiMaxof}\xintimaxof }% -\def\xintimaxof #1{\expandafter\XINT_imaxof_a\romannumeral`&&@#1\xint:}% -\def\XINT_imaxof_a -#1{\expandafter\XINT_imaxof_b\romannumeral0\xintnum{#1}!}% -% \end{macrocode} -% \lverb|No \xintnum on #2 which might be \xint:, of course. But if list not -% terminated the \xintNum will be done via \xintimax.| -% \begin{macrocode} -\def\XINT_imaxof_b #1!#2% - {\expandafter\XINT_imaxof_c\romannumeral`&&@#2!{#1}!}% -\def\XINT_imaxof_c #1% - {\xint_gob_til_xint: #1\XINT_imaxof_e\xint:\XINT_imaxof_d #1}% -\def\XINT_imaxof_d #1!% - {\expandafter\XINT_imaxof_b\romannumeral0\xintimax {#1}}% -\def\XINT_imaxof_e #1!#2!{ #2}% \def\xintiiMaxof {\romannumeral0\xintiimaxof }% \def\xintiimaxof #1{\expandafter\XINT_iimaxof_a\romannumeral`&&@#1\xint:}% \def\XINT_iimaxof_a #1{\expandafter\XINT_iimaxof_b\romannumeral`&&@#1!}% @@ -23067,16 +23059,6 @@ They will get removed at some future release.}}% % \subsection{\csh{xintiiMinof}} % \lverb|1.09a. 1.2a adds \xintiiMinof which was lacking.| % \begin{macrocode} -\def\xintiMinof {\romannumeral0\XINT_signaldeprecated{xint}{xintiMinof}\xintiminof }% -\def\xintiminof #1{\expandafter\XINT_iminof_a\romannumeral`&&@#1\xint:}% -\def\XINT_iminof_a #1{\expandafter\XINT_iminof_b\romannumeral0\xintnum{#1}!}% -\def\XINT_iminof_b #1!#2% - {\expandafter\XINT_iminof_c\romannumeral`&&@#2!{#1}!}% -\def\XINT_iminof_c #1% - {\xint_gob_til_xint: #1\XINT_iminof_e\xint:\XINT_iminof_d #1}% -\def\XINT_iminof_d #1!% - {\expandafter\XINT_iminof_b\romannumeral0\xintimin {#1}}% -\def\XINT_iminof_e #1!#2!{ #2}% \def\xintiiMinof {\romannumeral0\xintiiminof }% \def\xintiiminof #1{\expandafter\XINT_iiminof_a\romannumeral`&&@#1\xint:}% \def\XINT_iiminof_a #1{\expandafter\XINT_iiminof_b\romannumeral`&&@#1!}% @@ -23158,9 +23140,6 @@ They will get removed at some future release.}}% % % \begin{macrocode} \def\xintiiSquareRoot {\romannumeral0\xintiisquareroot }% -\def\xintiSquareRoot{\romannumeral0\XINT_signaldeprecated{xint}{xintiSquareRoot}\xintisquareroot}% -\def\xintisquareroot #1% - {\expandafter\XINT_sqrt_checkin\romannumeral0\xintnum{#1}\xint:}% \def\xintiisquareroot #1{\expandafter\XINT_sqrt_checkin\romannumeral`&&@#1\xint:}% \def\XINT_sqrt_checkin #1% {% @@ -23627,10 +23606,6 @@ They will get removed at some future release.}}% % \begin{macrocode} \def\XINT_sqrtr_post #1#2% {\xintiiifLt {#2}{#1}{ #1}{\XINT_dec #1\XINT_dec_bye234567890\xint_bye}}% -\def\xintiSqrt {\romannumeral0\XINT_signaldeprecated{xint}{xintiSqrt}\xintisqrt}% -\def\xintisqrt {\expandafter\XINT_sqrt_post\romannumeral0\xintisquareroot }% -\def\xintiSqrtR{\romannumeral0\XINT_signaldeprecated{xint}{xintiSqrtr}\xintisqrtr}% -\def\xintisqrtr {\expandafter\XINT_sqrtr_post\romannumeral0\xintisquareroot }% % \end{macrocode} % \subsection{\csh{xintiiBinomial}} % \lverb|2015/11/28-29 for 1.2f. @@ -23655,8 +23630,6 @@ They will get removed at some future release.}}% {% \expandafter\XINT_binom_fork \the\numexpr#1-#2.#2.#1.% }% -\def\xintiBinomial{\romannumeral0\XINT_signaldeprecated{xint}{xintiBinomial}\xintibinomial}% -\let\xintibinomial\xintiibinomial % \end{macrocode} % \lverb|k.x-k.x. I hesitated to restrict maximal allowed value of x to 10000. % Finally I don't. But due to using small multiplication and small division, x @@ -23985,8 +23958,6 @@ They will get removed at some future release.}}% {% \expandafter\XINT_pfac_fork\the\numexpr#1\expandafter.\the\numexpr #2.% }% -\def\xintiPFactorial{\romannumeral0\XINT_signaldeprecated{xint}{xintiPFactorial}\xintipfactorial}% -\let\xintipfactorial\xintiipfactorial \def\xintPFactorial{\romannumeral0\xintpfactorial}% \let\xintpfactorial\xintiipfactorial % \end{macrocode} @@ -24182,7 +24153,7 @@ They will get removed at some future release.}}% \XINT_ifFlagRaised{xintiSqrtR}{\string\xintiSqrtR\MessageBreak}{}% \XINT_ifFlagRaised{xintiBinomial}{\string\xintiBinomial\MessageBreak}{}% \XINT_ifFlagRaised{xintiPFactorial}{\string\xintiPFactorial\MessageBreak}{}% -They will get removed at some future release.}}% +This is not possible because they all got removed at 1.3!}}% {% no deprecated macro used (at top level...) }% }\fi\fi @@ -24272,7 +24243,7 @@ They will get removed at some future release.}}% % \begin{macrocode} \XINT_providespackage \ProvidesPackage{xintbinhex}% - [2018/02/06 1.2q Expandable binary and hexadecimal conversions (JFB)]% + [2018/03/01 1.3 Expandable binary and hexadecimal conversions (JFB)]% % \end{macrocode} % \subsection{Constants, etc...} % \lverb|1.2n switches to \csname-governed expansion at various places.| @@ -24924,7 +24895,7 @@ They will get removed at some future release.}}% % \begin{macrocode} \XINT_providespackage \ProvidesPackage{xintgcd}% - [2018/02/06 1.2q Euclide algorithm with xint package (JFB)]% + [2018/03/01 1.3 Euclide algorithm with xint package (JFB)]% % \end{macrocode} % \subsection{\csh{xintGCD}, \csh{xintiiGCD}} % \lverb|1.09a added \xintnum filtering from \xintiabs. This is a bit overhead @@ -25595,6 +25566,7 @@ They will get removed at some future release.}}% \let\z\endgroup \expandafter\let\expandafter\x\csname ver@xintfrac.sty\endcsname \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname + \expandafter\let\expandafter\ww\csname ver@xintgcd.sty\endcsname \expandafter \ifx\csname PackageInfo\endcsname\relax \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% @@ -25608,14 +25580,18 @@ They will get removed at some future release.}}% \else \ifx\x\relax % plain-TeX, first loading of xintfrac.sty \ifx\w\relax % but xint.sty not yet loaded. - \def\z{\endgroup\input xint.sty\relax}% + \def\z{\endgroup\input xint.sty\relax\input xintgcd.sty\relax}% \fi \else \def\empty {}% \ifx\x\empty % LaTeX, first loading, % variable is initialized, but \ProvidesPackage not yet seen \ifx\w\relax % xint.sty not yet loaded. - \def\z{\endgroup\RequirePackage{xint}}% + \def\z{\endgroup\RequirePackage{xint}\RequirePackage{xintgcd}}% + \else + \ifx\ww\relax + \def\z{\endgroup\RequirePackage{xintgcd}}% + \fi \fi \else \aftergroup\endinput % xintfrac already loaded. @@ -25629,36 +25605,124 @@ They will get removed at some future release.}}% % \begin{macrocode} \XINT_providespackage \ProvidesPackage{xintfrac}% - [2018/02/06 1.2q Expandable operations on fractions (JFB)]% + [2018/03/01 1.3 Expandable operations on fractions (JFB)]% % \end{macrocode} -% \subsection{Macros now deprecated in \xintcorenameimp or \xintnameimp} -% \lverb|1.2o| +% \subsection{Macros now removed from \xintcorenameimp and \xintnameimp} +% \lverb|Moved here at 1.3| % \begin{macrocode} -\def\xintSgn {\romannumeral0\xintsgn }% deprecated from xintcore -\def\xintCmp {\romannumeral0\xintcmp }% deprecated from xintcore -\def\xintEq {\romannumeral0\xinteq }% deprecated from xint -\def\xintNeq #1#2% renamed into \xintNotEq - {\romannumeral0\XINT_signaldeprecated{xintfrac}{xintNeq}\xintifeq {#1}{#2}{0}{1}}% -\def\xintNotEq #1#2{\romannumeral0\xintifeq {#1}{#2}{0}{1}}% +\def\xintEq {\romannumeral0\xinteq }% +\def\xinteq #1#2{\xintifeq{#1}{#2}{1}{0}}% +\def\xintNotEq#1#2{\romannumeral0\xintifeq {#1}{#2}{0}{1}}% %\def\xintGeq {\romannumeral0\xintgeq }% further down -\def\xintGt {\romannumeral0\xintgt }% +\def\xintGt {\romannumeral0\xintgt }% +\def\xintgt #1#2{\xintifgt{#1}{#2}{1}{0}}% \def\xintLt {\romannumeral0\xintlt }% +\def\xintlt #1#2{\xintiflt{#1}{#2}{1}{0}}% \def\xintGtorEq #1#2{\romannumeral0\xintiflt {#1}{#2}{0}{1}}% \def\xintLtorEq #1#2{\romannumeral0\xintifgt {#1}{#2}{0}{1}}% \def\xintIsZero {\romannumeral0\xintiszero }% +\def\xintiszero #1{\if0\xintSgn{#1}\xint_afterfi{ 1}\else\xint_afterfi{ 0}\fi}% \def\xintIsNotZero{\romannumeral0\xintisnotzero }% +\def\xintisnotzero + #1{\if0\xintSgn{#1}\xint_afterfi{ 0}\else\xint_afterfi{ 1}\fi}% \def\xintIsOne {\romannumeral0\xintisone }% +\def\xintisone #1{\expandafter\XINT_isone\romannumeral0\xintnum{#1}XY}% \def\xintOdd {\romannumeral0\xintodd }% +\def\xintodd #1% +{% + \ifodd\xintLDg{\xintNum{#1}} %<- intentional space + \xint_afterfi{ 1}% + \else + \xint_afterfi{ 0}% + \fi +}% \def\xintEven {\romannumeral0\xinteven }% +\def\xinteven #1% +{% + \ifodd\xintLDg{\xintNum{#1}} %<- intentional space + \xint_afterfi{ 0}% + \else + \xint_afterfi{ 1}% + \fi +}% \def\xintifSgn{\romannumeral0\xintifsgn }% +\def\xintifsgn #1% +{% + \ifcase \xintSgn{#1} + \expandafter\xint_secondofthree_thenstop + \or\expandafter\xint_thirdofthree_thenstop + \else\expandafter\xint_firstofthree_thenstop + \fi +}% \def\xintifCmp{\romannumeral0\xintifcmp }% +\def\xintifcmp #1#2% +{% + \ifcase\xintCmp {#1}{#2} + \expandafter\xint_secondofthree_thenstop + \or\expandafter\xint_thirdofthree_thenstop + \else\expandafter\xint_firstofthree_thenstop + \fi +}% \def\xintifEq {\romannumeral0\xintifeq }% +\def\xintifeq #1#2% +{% + \if0\xintCmp{#1}{#2}% + \expandafter\xint_firstoftwo_thenstop + \else\expandafter\xint_secondoftwo_thenstop + \fi +}% \def\xintifGt {\romannumeral0\xintifgt }% +\def\xintifgt #1#2% +{% + \if1\xintCmp{#1}{#2}% + \expandafter\xint_firstoftwo_thenstop + \else\expandafter\xint_secondoftwo_thenstop + \fi +}% \def\xintifLt {\romannumeral0\xintiflt }% +\def\xintiflt #1#2% +{% + \ifnum\xintCmp{#1}{#2}<\xint_c_ + \expandafter\xint_firstoftwo_thenstop + \else \expandafter\xint_secondoftwo_thenstop + \fi +}% \def\xintifZero {\romannumeral0\xintifzero }% +\def\xintifzero #1% +{% + \if0\xintSgn{#1}% + \expandafter\xint_firstoftwo_thenstop + \else + \expandafter\xint_secondoftwo_thenstop + \fi +}% \def\xintifNotZero{\romannumeral0\xintifnotzero }% +\def\xintifnotzero #1% +{% + \if0\xintSgn{#1}% + \expandafter\xint_secondoftwo_thenstop + \else + \expandafter\xint_firstoftwo_thenstop + \fi +}% \def\xintifOne {\romannumeral0\xintifone }% +\def\xintifone #1% +{% + \if1\xintIsOne{#1}% + \expandafter\xint_firstoftwo_thenstop + \else + \expandafter\xint_secondoftwo_thenstop + \fi +}% \def\xintifOdd {\romannumeral0\xintifodd }% +\def\xintifodd #1% +{% + \if\xintOdd{#1}1% + \expandafter\xint_firstoftwo_thenstop + \else + \expandafter\xint_secondoftwo_thenstop + \fi +}% % \end{macrocode} % \subsection{\csh{XINT_cntSgnFork}} % \lverb|1.09i. Used internally, #1 must expand to \m@ne, \z@, or \@ne or @@ -26134,6 +26198,29 @@ They will get removed at some future release.}}% \expandafter{\romannumeral0\XINT_dsx_addzeros{#1}#3;}{#2}}% \def\XINT_rawz_Bb #1#2{ #2/#1}% % \end{macrocode} +% \subsection{\csh{xintDecToString}} +% \lverb|1.3. This is a backport from polexpr 0.4. It is definitely not in +% final form, consider it to be an unstable macro.| +% \begin{macrocode} +\def\xintDecToString{\romannumeral0\xintdectostring}% +\def\xintdectostring#1{\expandafter\XINT_dectostr\romannumeral0\xintraw{#1}}% +\def\XINT_dectostr #1/#2[#3]{\xintiiifZero {#1}% + \XINT_dectostr_z + {\if1\XINT_isOne{#2}\expandafter\XINT_dectostr_a + \else\expandafter\XINT_dectostr_b + \fi}% + #1/#2[#3]% +}% +\def\XINT_dectostr_z#1[#2]{ 0}% +\def\XINT_dectostr_a#1/#2[#3]{% + \ifnum#3<\xint_c_\xint_dothis{\xinttrunc{-#3}{#1[#3]}}\fi + \xint_orthat{\xintiie{#1}{#3}}% +}% +\def\XINT_dectostr_b#1/#2[#3]{% just to handle this somehow + \ifnum#3<\xint_c_\xint_dothis{\xinttrunc{-#3}{#1[#3]}/#2}\fi + \xint_orthat{\xintiie{#1}{#3}/#2}% +}% +% \end{macrocode} % \subsection{\csh{xintFloor}, \csh{xintiFloor}} % \lverb|1.09a, 1.1 for \xintiFloor/\xintFloor. Not efficient if big negative % decimal exponent. Also sub-efficient if big positive decimal exponent.| @@ -26363,13 +26450,19 @@ They will get removed at some future release.}}% }% \def\XINT_e_end #1.#2#3{ #2/#3[#1]}% % \end{macrocode} -% \subsection{\csh{xintIrr}} +% \subsection{\csh{xintIrr}, \csh{xintPIrr}} +% \lverb|\xintPIrr (partial Irr, which ignores the decimal part) added at 1.3.| % \begin{macrocode} \def\xintIrr {\romannumeral0\xintirr }% +\def\xintPIrr{\romannumeral0\xintpirr }% \def\xintirr #1% {% \expandafter\XINT_irr_start\romannumeral0\xintrawwithzeros {#1}\Z }% +\def\xintpirr #1% +{% + \expandafter\XINT_pirr_start\romannumeral0\xintraw{#1}% +}% \def\XINT_irr_start #1#2/#3\Z {% \if0\XINT_isOne {#3}% @@ -26383,6 +26476,19 @@ They will get removed at some future release.}}% \fi #2\Z {#3}% }% +\def\XINT_pirr_start #1#2/#3[% +{% + \if0\XINT_isOne {#3}% + \xint_afterfi + {\xint_UDsignfork + #1\XINT_irr_negative + -{\XINT_irr_nonneg #1}% + \krof}% + \else + \xint_afterfi{\XINT_irr_denomisone #1}% + \fi + #2\Z {#3}[% +}% \def\XINT_irr_denomisone #1\Z #2{ #1/1}% changed in 1.08 \def\XINT_irr_negative #1\Z #2{\XINT_irr_D #1\Z #2\Z -}% \def\XINT_irr_nonneg #1\Z #2{\XINT_irr_D #1\Z #2\Z \space}% @@ -27173,6 +27279,7 @@ They will get removed at some future release.}}% \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} \def\xintAdd {\romannumeral0\xintadd }% \def\xintadd #1{\expandafter\XINT_fadd\romannumeral0\xintraw {#1}}% @@ -27207,67 +27314,48 @@ They will get removed at some future release.}}% {\romannumeral0\XINT_dsx_addzeros {#1}#4;}% {#5}{#7}{#6}[#3]% }% +\def\XINT_fadd_iszero #1[#2]{ 0/1[0]}% ou [#2] originel? \def\XINT_fadd_C #1#2#3% {% - \ifcase\romannumeral0\xintiicmp {#2}{#3} %<- intentional space here. - \expandafter\XINT_fadd_eq - \or\expandafter\XINT_fadd_D - \else\expandafter\XINT_fadd_Da - \fi {#2}{#3}{#1}% -}% -\def\XINT_fadd_eq #1#2#3#4%#5% -{% - \expandafter\XINT_fadd_G - \romannumeral0\xintiiadd {#3}{#4}/#1%[#5]% + \expandafter\XINT_fadd_D_b + \romannumeral0\XINT_div_prepare{#2}{#3}{#2}{#2}{#3}{#1}% }% -\def\XINT_fadd_D #1#2% -{% - \expandafter\XINT_fadd_E\romannumeral0\XINT_div_prepare {#2}{#1}{#1}{#2}% -}% -\def\XINT_fadd_E #1#2% +% \end{macrocode} +% \lverb|Basically a clone of the \XINT_irr_loop_a loop. I should modify the +% output of \XINT_div_prepare perhaps to be optimized for checking if +% remainder vanishes.| +% \begin{macrocode} +\def\XINT_fadd_D_a #1#2% {% - \if0\XINT_Sgn #2\xint: - \expandafter\XINT_fadd_F - \else\expandafter\XINT_fadd_K - \fi {#1}% + \expandafter\XINT_fadd_D_b + \romannumeral0\XINT_div_prepare {#1}{#2}{#1}% }% -\def\XINT_fadd_F #1#2#3#4#5%#6% +\def\XINT_fadd_D_b #1#2{\XINT_fadd_D_c #2\Z}% +\def\XINT_fadd_D_c #1#2\Z {% - \expandafter\XINT_fadd_G - \romannumeral0\xintiiadd {\xintiiMul {#5}{#1}}{#4}/#2%[#6]% + \xint_gob_til_zero #1\XINT_fadd_D_exit0\XINT_fadd_D_a {#1#2}% }% -\def\XINT_fadd_Da #1#2% +\def\XINT_fadd_D_exit0\XINT_fadd_D_a #1#2#3% {% - \expandafter\XINT_fadd_Ea\romannumeral0\XINT_div_prepare {#1}{#2}{#1}{#2}% + \expandafter\XINT_fadd_E + \romannumeral0\xintiiquo {#3}{#2}.{#2}% }% -\def\XINT_fadd_Ea #1#2% +\def\XINT_fadd_E #1.#2#3% {% - \if0\XINT_Sgn #2\xint: - \expandafter\XINT_fadd_Fa - \else\expandafter\XINT_fadd_K - \fi {#1}% + \expandafter\XINT_fadd_F + \romannumeral0\xintiimul{#1}{#3}.{\xintiiQuo{#3}{#2}}{#1}% }% -\def\XINT_fadd_Fa #1#2#3#4#5%#6% +\def\XINT_fadd_F #1.#2#3#4#5% {% - \expandafter\XINT_fadd_G - \romannumeral0\xintiiadd {\xintiiMul {#4}{#1}}{#5}/#3%[#6]% + \expandafter\XINT_fadd_G + \romannumeral0\xintiiadd{\xintiiMul{#2}{#4}}{\xintiiMul{#3}{#5}}/#1% }% \def\XINT_fadd_G #1{% \def\XINT_fadd_G ##1{\if0##1\expandafter\XINT_fadd_iszero\fi#1##1}% }\XINT_fadd_G{ }% -\def\XINT_fadd_K #1#2#3#4#5% -{% - \expandafter\XINT_fadd_L - \romannumeral0\xintiiadd {\xintiiMul {#2}{#5}}{\xintiiMul {#3}{#4}}.% - {{#2}{#3}}% -}% -\def\XINT_fadd_L #1{\if0#1\expandafter\XINT_fadd_iszero\fi\XINT_fadd_M #1}% -\def\XINT_fadd_M #1.#2{\expandafter\XINT_fadd_N \expandafter - {\romannumeral0\xintiimul #2}{#1}}% -\def\XINT_fadd_N #1#2{ #2/#1}% -\def\XINT_fadd_iszero #1[#2]{ 0/1[0]}% ou [#2] originel? % \end{macrocode} % \subsection{\csh{xintSub}} +% \lverb|Since 1.3 will use least common multiple of denominators.| % \begin{macrocode} \def\xintSub {\romannumeral0\xintsub }% \def\xintsub #1{\expandafter\XINT_fsub\romannumeral0\xintraw {#1}}% @@ -27399,21 +27487,17 @@ They will get removed at some future release.}}% % \end{macrocode} % \subsection{\csh{xintFac}} % \lverb|Factorial coefficients: variant which can be chained with other -% xintfrac macros. \xintiFac deprecated at 1.2o; \xintFac used by xintexpr.sty.| +% xintfrac macros. \xintiFac deprecated at 1.2o and removed at 1.3; \xintFac +% used by xintexpr.sty.| % \begin{macrocode} -\def\xintifac #1{\expandafter\XINT_fac_fork\the\numexpr\xintNum{#1}.}% \def\xintFac {\romannumeral0\xintfac}% \def\xintfac #1{\expandafter\XINT_fac_fork\the\numexpr\xintNum{#1}.[0]}% % \end{macrocode} % \subsection{\csh{xintBinomial}} -% \lverb|1.2f. Binomial coefficients. \xintiBinomial deprecated at 1.2o; +% \lverb|1.2f. Binomial coefficients. \xintiBinomial deprecated at 1.2o and +% removed at 1.3; % \xintBinomial needed by xintexpr.sty.| % \begin{macrocode} -\def\xintibinomial #1#2% -{% - \expandafter\XINT_binom_pre - \the\numexpr\xintNum{#1}\expandafter.\the\numexpr\xintNum{#2}.% -}% \def\xintBinomial {\romannumeral0\xintbinomial}% \def\xintbinomial #1#2% {% @@ -27504,7 +27588,9 @@ They will get removed at some future release.}}% % \lverb|1.1. \xintModTrunc {q1}{q2} computes q1 - q2*t(q1/q2) with t(q1/q2) % equal to the truncated division of two fractions q1 and q2. % -% Its former name, prior to 1.2p, was \xintMod.| +% Its former name, prior to 1.2p, was \xintMod. +% +% At 1.3, uses least common multiple denominator, like \xintMod (next).| % \begin{macrocode} \def\xintModTrunc {\romannumeral0\xintmodtrunc }% \def\xintmodtrunc #1{\expandafter\XINT_modtrunc_a\romannumeral0\xintraw{#1}.}% @@ -27544,16 +27630,19 @@ They will get removed at some future release.}}% \def\XINT_modtrunc_pos #1#2/#3[#4]#5/#6[#7].% {% \expandafter\XINT_modtrunc_pos_a - \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.\expandafter - {\romannumeral0\xintiimul {#6}{#3}}% - {\xintiiE{\xintiiMul {#1#5}{#3}}{#7-#4}}% - {\xintiiE{\xintiiMul {#2}{#6}}{#4-#7}}% + \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.% + \romannumeral0\expandafter\XINT_mod_D_b + \romannumeral0\XINT_div_prepare{#3}{#6}{#3}{#3}{#6}% + {#1#5}{#7-#4}{#2}{#4-#7}% }% \def\XINT_modtrunc_pos_a #1.#2#3#4{\xintiirem {#3}{#4}/#2[#1]}% % \end{macrocode} % \subsection{\csh{xintDivMod}} % \lverb|1.2p. \xintDivMod{q1}{q2} outputs {floor(q1/q2)}{q1 - q2*floor(q1/q2)}. -% Attention that it relies on \xintiiE{x}{e} returning x if e < 0.| +% Attention that it relies on \xintiiE{x}{e} returning x if e < 0. +% +% Modified (like \xintAdd and \xintSub) at 1.3 to use a l.c.m for final +% denominator of the "mod" part.| % \begin{macrocode} \def\xintDivMod {\romannumeral0\xintdivmod }% \def\xintdivmod #1{\expandafter\XINT_divmod_a\romannumeral0\xintraw{#1}.}% @@ -27588,10 +27677,10 @@ They will get removed at some future release.}}% \def\XINT_divmod_bpos #1#2/#3[#4]#5/#6[#7].% {% \expandafter\XINT_divmod_bpos_a - \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.\expandafter - {\romannumeral0\xintiimul {#6}{#3}}% - {\xintiiE{\xintiiMul {#1#5}{#3}}{#7-#4}}% - {\xintiiE{\xintiiMul {#2}{#6}}{#4-#7}}% + \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.% + \romannumeral0\expandafter\XINT_mod_D_b + \romannumeral0\XINT_div_prepare{#3}{#6}{#3}{#3}{#6}% + {#1#5}{#7-#4}{#2}{#4-#7}% }% \def\XINT_divmod_bpos_a #1.#2#3#4% {% @@ -27604,7 +27693,10 @@ They will get removed at some future release.}}% % \lverb|1.2p. \xintMod{q1}{q2} computes q1 - q2*floor(q1/q2). Attention that % it relies on \xintiiE{x}{e} returning x if e < 0. % -% Prior to 1.2p, that macro had the meaning now attributed to \xintModTrunc.| +% Prior to 1.2p, that macro had the meaning now attributed to \xintModTrunc. +% +% Modified (like \xintAdd and \xintSub) at 1.3 to use a l.c.m for final +% denominator.| % \begin{macrocode} \def\xintMod {\romannumeral0\xintmod }% \def\xintmod #1{\expandafter\XINT_mod_a\romannumeral0\xintraw{#1}.}% @@ -27632,10 +27724,35 @@ They will get removed at some future release.}}% \def\XINT_mod_bpos #1#2/#3[#4]#5/#6[#7].% {% \expandafter\XINT_mod_bpos_a - \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.\expandafter - {\romannumeral0\xintiimul {#6}{#3}}% - {\xintiiE{\xintiiMul {#1#5}{#3}}{#7-#4}}% - {\xintiiE{\xintiiMul {#2}{#6}}{#4-#7}}% + \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.% + \romannumeral0\expandafter\XINT_mod_D_b + \romannumeral0\XINT_div_prepare{#3}{#6}{#3}{#3}{#6}% + {#1#5}{#7-#4}{#2}{#4-#7}% +}% +\def\XINT_mod_D_a #1#2% +{% + \expandafter\XINT_mod_D_b + \romannumeral0\XINT_div_prepare {#1}{#2}{#1}% +}% +\def\XINT_mod_D_b #1#2{\XINT_mod_D_c #2\Z}% +\def\XINT_mod_D_c #1#2\Z +{% + \xint_gob_til_zero #1\XINT_mod_D_exit0\XINT_mod_D_a {#1#2}% +}% +\def\XINT_mod_D_exit0\XINT_mod_D_a #1#2#3% +{% + \expandafter\XINT_mod_E + \romannumeral0\xintiiquo {#3}{#2}.{#2}% +}% +\def\XINT_mod_E #1.#2#3% +{% + \expandafter\XINT_mod_F + \romannumeral0\xintiimul{#1}{#3}.{\xintiiQuo{#3}{#2}}{#1}% +}% +\def\XINT_mod_F #1.#2#3#4#5#6#7% +{% + {#1}{\xintiiE{\xintiiMul{#4}{#3}}{#5}}% + {\xintiiE{\xintiiMul{#6}{#2}}{#7}}% }% \def\XINT_mod_bpos_a #1.#2#3#4{\xintiirem {#3}{#4}/#2[#1]}% % \end{macrocode} @@ -30063,7 +30180,7 @@ They will get removed at some future release.}}% % \end{macrocode} % \subsection*{At End of \LaTeX\ Document deprecation message} % \addcontentsline{toc}{subsection}{At End of \LaTeX\ Document deprecation message} -% \lverb|1.2o| +% \lverb|1.2o. Updated at 1.3 which actually removed the macros.| % \begin{macrocode} \ifdefined\documentclass\ifdefined\AtEndDocument \AtEndDocument{% @@ -30074,7 +30191,7 @@ They will get removed at some future release.}}% %\XINT_ifFlagRaised{xintNeq}{% \string\xintNeq\space(use \string\xintNotEq\space or xint's \string\xintiiNotEq!)\MessageBreak %}{}% -It will get removed at some future release.}}% +This is impossible as it has been removed at 1.3!}}% {% no deprecated macro used (at top level...) }% }\fi\fi @@ -30153,7 +30270,7 @@ It will get removed at some future release.}}% % \begin{macrocode} \XINT_providespackage \ProvidesPackage{xintseries}% - [2018/02/06 1.2q Expandable partial sums with xint package (JFB)]% + [2018/03/01 1.3 Expandable partial sums with xint package (JFB)]% % \end{macrocode} % \subsection{\csh{xintSeries}} % \begin{macrocode} @@ -30654,7 +30771,7 @@ It will get removed at some future release.}}% % \begin{macrocode} \XINT_providespackage \ProvidesPackage{xintcfrac}% - [2018/02/06 1.2q Expandable continued fractions with xint package (JFB)]% + [2018/03/01 1.3 Expandable continued fractions with xint package (JFB)]% % \end{macrocode} % \subsection{\csh{xintCFrac}} % \begin{macrocode} @@ -31905,7 +32022,7 @@ It will get removed at some future release.}}% % \begin{macrocode} \XINT_providespackage \ProvidesPackage{xintexpr}% - [2018/02/06 1.2q Expandable expression parser (JFB)]% + [2018/03/01 1.3 Expandable expression parser (JFB)]% \catcode`! 11 \let\XINT_Cmp \xintiiCmp % \end{macrocode} @@ -32121,6 +32238,14 @@ It will get removed at some future release.}}% \def\xintifboolfloatexpr #1{\romannumeral0\xintifnotzero {\xintthefloatexpr #1\relax}}% \def\xintifbooliiexpr #1{\romannumeral0\xintifnotzero {\xinttheiiexpr #1\relax}}% % \end{macrocode} +% \subsection{Hooks for the functioning of \csh{xintNewExpr} and +% \csh{xintdeffunc}} +% \lverb|This is new with 1.3. See \XINT_expr_redefinemacros.| +% \begin{macrocode} +\let\XINT:NEhook:two\empty +\let\XINT:NEhook:one\empty +\let\XINT:NEhook:csv\empty +% \end{macrocode} % \subsection{Macros handling csv lists on output (for \csh{XINT_expr_print} et % al. routines)} % \localtableofcontents @@ -32891,7 +33016,7 @@ It will get removed at some future release.}}% % \begin{macrocode} \expandafter\def\csname XINT_#1_op_++)\endcsname ##1##2\relax {\expandafter\XINT_expr_foundend \expandafter - {\expandafter\.=+\csname .=\xintiCeil{\XINT_expr_unlock ##1}\endcsname }}% + {\expandafter\.=+\csname .=\XINT:NEhook:one\xintiCeil{\XINT_expr_unlock ##1}\endcsname }}% }% \catcode`. 12 \catcode`= 12 \catcode`+ 12 % \end{macrocode} @@ -32912,7 +33037,7 @@ It will get removed at some future release.}}% % \lverb|1.2d needed some room between /, * and ^. Hence precedence for ^ % is now at 9| % \begin{macrocode} -\def\XINT_expr_defbin_c #1#2#3#4#5#6#7#8% +\def\XINT_expr_defbin_c #1#2#3#4#5#6#7#8#9% {% \def #1##1% \XINT_expr_op_<op> ou flexpr ou iiexpr {% keep value, get next number and operator, then do until @@ -32928,7 +33053,7 @@ It will get removed at some future release.}}% \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral`&&@% \csname XINT_#8_op_##3\endcsname {##4}}% \else \xint_afterfi {\expandafter ##2\expandafter ##3% - \csname .=#6{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname }% + \csname .=#9#6{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname }% \fi }% \let #7#5% }% @@ -32941,7 +33066,7 @@ It will get removed at some future release.}}% \csname XINT_#1_op_-#4\expandafter\endcsname \csname xint_c_#3\expandafter\endcsname \csname #5\expandafter\endcsname - \csname XINT_expr_precedence_#2\endcsname {#1}% + \csname XINT_expr_precedence_#2\endcsname {#1}\XINT:NEhook:two }% \XINT_expr_defbin_b {expr} | {iii}{vi} {xintOR}% \XINT_expr_defbin_b {flexpr} | {iii}{vi} {xintOR}% @@ -32970,9 +33095,6 @@ It will get removed at some future release.}}% \XINT_expr_defbin_b {expr} {!=} {v}{vi} {xintNotEq}% \XINT_expr_defbin_b {flexpr}{!=} {v}{vi} {xintNotEq}% \XINT_expr_defbin_b {iiexpr}{!=} {v}{vi} {xintiiNotEq}% -\XINT_expr_defbin_b {expr} {..} {iii}{vi} {xintSeq::csv}% -\XINT_expr_defbin_b {flexpr}{..} {iii}{vi} {xintSeq::csv}% -\XINT_expr_defbin_b {iiexpr}{..} {iii}{vi} {xintiiSeq::csv}% \XINT_expr_defbin_b {expr} {//} {vii}{vii}{xintDivFloor}% CHANGED IN 1.2p! \XINT_expr_defbin_b {flexpr}{//} {vii}{vii}{XINTinFloatDivFloor}% " \XINT_expr_defbin_b {iiexpr}{//} {vii}{vii}{xintiiDivFloor}% " @@ -32997,6 +33119,20 @@ It will get removed at some future release.}}% \XINT_expr_defbin_b {expr} {..[}{iii}{vi} {xintSeqA::csv}% \XINT_expr_defbin_b {flexpr}{..[}{iii}{vi} {XINTinFloatSeqA::csv}% \XINT_expr_defbin_b {iiexpr}{..[}{iii}{vi} {xintiiSeqA::csv}% +\def\XINT_expr_defbin_b #1#2#3#4#5% +{% + \expandafter\XINT_expr_defbin_c + \csname XINT_#1_op_#2\expandafter\endcsname + \csname XINT_#1_until_#2_a\expandafter\endcsname + \csname XINT_#1_until_#2_b\expandafter\endcsname + \csname XINT_#1_op_-#4\expandafter\endcsname + \csname xint_c_#3\expandafter\endcsname + \csname #5\expandafter\endcsname + \csname XINT_expr_precedence_#2\endcsname {#1}{}% +}% +\XINT_expr_defbin_b {expr} {..} {iii}{vi} {xintSeq::csv}% +\XINT_expr_defbin_b {flexpr}{..} {iii}{vi} {xintSeq::csv}% +\XINT_expr_defbin_b {iiexpr}{..} {iii}{vi} {xintiiSeq::csv}% \XINT_expr_defbin_b {expr} {]..}{iii}{vi} {xintSeqB::csv}% \XINT_expr_defbin_b {flexpr}{]..}{iii}{vi} {XINTinFloatSeqB::csv}% \XINT_expr_defbin_b {iiexpr}{]..}{iii}{vi} {xintiiSeqB::csv}% @@ -33007,6 +33143,8 @@ It will get removed at some future release.}}% % \lverb|This handles acting on comma separated values (no need to bother % about spaces in this context; expansion in a \csname...\endcsname.| % \begin{macrocode} +\def\XINT_expr_binop_inline#1% + {\XINT_expr_binop_inline_a{\expandafter\XINT:NEhook:two\expandafter#1}}% \def\XINT_expr_binop_inline_a {\expandafter\xint_gobble_i\romannumeral`&&@\XINT_expr_binop_inline_b }% \def\XINT_expr_binop_inline_b #1#2,{\XINT_expr_binop_inline_c #2,{#1}}% @@ -33033,9 +33171,8 @@ It will get removed at some future release.}}% \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral`&&@% \csname XINT_#8_op_##3\endcsname {##4}}% \else \xint_afterfi {\expandafter ##2\expandafter ##3% - \csname .=\expandafter\XINT_expr_binop_inline_a\expandafter - {\expandafter\expandafter\expandafter#6\expandafter - \xint_exchangetwo_keepbraces\expandafter + \csname .=\expandafter\XINT_expr_binop_inline\expandafter + {\expandafter#6\expandafter\xint_exchangetwo_keepbraces\expandafter {\expandafter\XINT_expr_unlock\expandafter ##4\expandafter}\expandafter}% \romannumeral`&&@\XINT_expr_unlock ##1,^,\endcsname }% \fi }% @@ -33081,7 +33218,7 @@ It will get removed at some future release.}}% \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral`&&@% \csname XINT_#7_op_##3\endcsname {##4}}% \else \xint_afterfi {\expandafter ##2\expandafter ##3% - \csname .=\expandafter\XINT_expr_binop_inline_a\expandafter + \csname .=\expandafter\XINT_expr_binop_inline\expandafter {\expandafter#5\expandafter {\expandafter\XINT_expr_unlock\expandafter ##1\expandafter}\expandafter}% \romannumeral`&&@\XINT_expr_unlock ##4,^,\endcsname }% @@ -33244,7 +33381,8 @@ It will get removed at some future release.}}% \else \xint_afterfi {\expandafter ##2\expandafter ##3\csname - .=:\xintNum{\XINT_expr_unlock ##1};\xintNum{\XINT_expr_unlock ##4}% + .=:\XINT:NEhook:one\xintNum{\XINT_expr_unlock ##1};% + \XINT:NEhook:one\xintNum{\XINT_expr_unlock ##4}% \endcsname }% \fi @@ -33264,7 +33402,7 @@ It will get removed at some future release.}}% \def\XINT_expr_op_:] #1% {% \expandafter\xint_c_i\expandafter )% - \csname .=]\xintNum{\XINT_expr_unlock #1}\endcsname + \csname .=]\XINT:NEhook:one\xintNum{\XINT_expr_unlock #1}\endcsname }% \let\XINT_flexpr_op_:] \XINT_expr_op_:] \let\XINT_iiexpr_op_:] \XINT_expr_op_:] @@ -33697,7 +33835,8 @@ It will get removed at some future release.}}% \csname XINT_#5_op_##2\endcsname {##3}}% \else \xint_afterfi {\expandafter ##1\expandafter ##2% - \csname .=#6{\XINT_expr_unlock ##3}\endcsname }% + \csname .=% + \XINT:NEhook:one#6{\XINT_expr_unlock ##3}\endcsname }% \fi }% }% @@ -33754,11 +33893,11 @@ It will get removed at some future release.}}% % \begin{macrocode} \let\XINT_expr_precedence_! \xint_c_x \def\XINT_expr_op_! #1{\expandafter\XINT_expr_getop - \csname .=\xintFac{\XINT_expr_unlock #1}\endcsname }% + \csname .=\XINT:NEhook:one\xintFac{\XINT_expr_unlock #1}\endcsname }% \def\XINT_flexpr_op_! #1{\expandafter\XINT_expr_getop - \csname .=\XINTinFloatFac{\XINT_expr_unlock #1}\endcsname }% + \csname .=\XINT:NEhook:one\XINTinFloatFac{\XINT_expr_unlock #1}\endcsname }% \def\XINT_iiexpr_op_! #1{\expandafter\XINT_expr_getop - \csname .=\xintiiFac{\XINT_expr_unlock #1}\endcsname }% + \csname .=\XINT:NEhook:one\xintiiFac{\XINT_expr_unlock #1}\endcsname }% % \end{macrocode} % \subsection{The A/B[N] mechanism} % \lverb|Releases earlier than 1.1 required the use of braces around A/B[N] @@ -33945,7 +34084,7 @@ It will get removed at some future release.}}% \edef\XINT_expr_tmpb{\romannumeral0#1#3\relax}% \XINT_expr_defvar_one\XINT_expr_tmpa\XINT_expr_tmpb \else - \edef\XINT_expr_tmpb + \edef\XINT_expr_tmpb {\expandafter\XINT_expr_unlock\romannumeral0#1#3\relax}% \edef\XINT_expr_tmpd{\xintCSVLength{\XINT_expr_tmpb}}% \ifnum\XINT_expr_tmpc=\XINT_expr_tmpd\space @@ -34397,10 +34536,11 @@ It will get removed at some future release.}}% \if ^#4\xint_dothis\XINT_expr_op:_end\fi \xint_orthat{\expandafter\XINT_expr_op:_c}\csname.=#4#5\endcsname {#3}#1{#2}% }% -\def\XINT_expr_op:_c #1#2#3#4{\expandafter\XINT_expr_op:_d\romannumeral0#2#1#3{#4}{#2}}% +\def\XINT_expr_op:_c #1#2#3#4% + {\expandafter\XINT_expr_op:_d\romannumeral0#2#1#3{#4}{#2}}% \def\XINT_expr_op:_d #1!#2#3#4#5% {\expandafter\XINT_expr_op:_b\expandafter #4\expandafter - {\romannumeral`&&@#4{\XINT_expr_unlock#1}{#5}}}% + {\romannumeral`&&@\XINT:NEhook:two#4{\XINT_expr_unlock#1}{#5}}}% % \end{macrocode} % \lverb|The replacement text had expr_seq:_b rather than expr_op:_b due to a % left-over from copy-paste. This made add and mul fail with an empty range @@ -34930,61 +35070,107 @@ It will get removed at some future release.}}% \def\XINTinFloatPrd:csv #1{\expandafter\XINT_oncsv:_a\expandafter\XINTinfloatmul \expandafter\XINTinFloatdigits\romannumeral`&&@#1,^,{1[0]}}% % \end{macrocode} -% \subsection{The num, reduce, abs, sgn, frac, floor, ceil, sqr, sqrt, sqrtr, float, -% round, trunc, mod, quo, rem, divmod, gcd, lcm, max, min, \textasciigrave -% +\textasciigrave, \textasciigrave -% \texorpdfstring{\protect\lowast}{*}\textasciigrave, ?, !, not, all, any, -% xor, if, ifsgn, even, odd, first, last, len, reversed, factorial and binomial functions} -% \localtableofcontents +% \subsection{Auxiliary wrappers for function macros} % \begin{macrocode} -\def\XINT_expr_twoargs #1,#2,{{#1}{#2}}% -\def\XINT_expr_totwoargs #1#2{#1,#2}% -\def\XINT_expr_argandopt #1,#2,#3.#4#5% +\def\XINT:expr:one:and:opt #1,#2,#3!#4#5% {% \if\relax#3\relax\expandafter\xint_firstoftwo\else \expandafter\xint_secondoftwo\fi - {#4}{#5[\xintNum {#2}]}{#1}% + {#4}{#5[\xintNum{#2}]}{#1}% }% -\def\XINT_expr_oneortwo #1#2#3,#4,#5.% +\def\XINT:expr:one:or:two #1,#2,#3!#4#5% {% - \if\relax#5\relax\expandafter\xint_firstoftwo\else + \if\relax#3\relax\expandafter\xint_firstoftwo\else \expandafter\xint_secondoftwo\fi - {#1{0}}{#2{\xintNum {#4}}}{#3}% + {#4{0}}{#5{\xintNum{#2}}}{#1}% }% -\def\XINT_iiexpr_oneortwo #1#2,#3,#4.% +\def\XINT:iiexpr:one:or:two #1,#2,#3!#4% {% - \if\relax#4\relax\expandafter\xint_firstoftwo\else + \if\relax#3\relax\expandafter\xint_firstoftwo\else \expandafter\xint_secondoftwo\fi - {#1{0}}{#1{#3}}{#2}% + {#4{0}}{#4{#2}}{#1}% +}% +\def\XINT:expr:totwo #1#2{#1,#2}% +\def\XINT:expr:two:to:two #1,#2,!#3% +{% + \expandafter\XINT:expr:totwo\romannumeral`&&@% + #3{#1}{#2}% +}% +\def\XINT:expr:two:to:one #1,#2,!#3% +{% + #3{#1}{#2}% +}% +\def\XINT:flexpr:two:to:one #1,#2,!#3% +{% + #3{#1}{#2}% }% +\let\XINT:flexpr:two:to:two\XINT:flexpr:two:to:one +% \end{macrocode} +% \subsection{The num, reduce, preduce, abs, sgn, frac, floor, ceil, sqr, sqrt, sqrtr, float, +% round, trunc, mod, quo, rem, divmod, gcd, lcm, max, min, \textasciigrave +% +\textasciigrave, \textasciigrave +% \texorpdfstring{\protect\lowast}{*}\textasciigrave, ?, !, not, all, any, +% xor, if, ifsgn, even, odd, first, last, len, reversed, factorial and binomial functions} +% \begin{macrocode} \def\XINT_expr_func_num #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintNum {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintNum{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_num\XINT_expr_func_num \let\XINT_iiexpr_func_num\XINT_expr_func_num -% [0] added Oct 25. For interaction with SPRaw::csv \def\XINT_expr_func_reduce #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintIrr {\XINT_expr_unlock #3}[0]\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintIrr{\XINT_expr_unlock #3}[0]\endcsname +}% \let\XINT_flexpr_func_reduce\XINT_expr_func_reduce -% no \XINT_iiexpr_func_reduce +\def\XINT_expr_func_preduce #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintPIrr{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_preduce\XINT_expr_func_preduce \def\XINT_expr_func_abs #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintAbs {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintAbs{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_abs\XINT_expr_func_abs \def\XINT_iiexpr_func_abs #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiAbs {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiAbs{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_sgn #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintSgn {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintSgn{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_sgn\XINT_expr_func_sgn \def\XINT_iiexpr_func_sgn #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiSgn {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiSgn{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_frac #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintTFrac {\XINT_expr_unlock #3}\endcsname }% -\def\XINT_flexpr_func_frac #1#2#3{\expandafter #1\expandafter #2\csname - .=\XINTinFloatFracdigits {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintTFrac{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_flexpr_func_frac #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\XINTinFloatFracdigits{\XINT_expr_unlock #3}\endcsname +}% % \end{macrocode} % \lverb|no \XINT_iiexpr_func_frac| % \begin{macrocode} \def\XINT_expr_func_floor #1#2#3% - {\expandafter #1\expandafter #2\csname .=\xintFloor {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintFloor{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_floor\XINT_expr_func_floor % \end{macrocode} % \lverb|The floor and ceil functions in \xintiiexpr require protect(a/b) or, @@ -34993,300 +35179,388 @@ It will get removed at some future release.}}% % \begin{macrocode} \def\XINT_iiexpr_func_floor #1#2#3% {% - \expandafter #1\expandafter #2\csname.=\xintiFloor {\XINT_expr_unlock #3}\endcsname }% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiFloor{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_ceil #1#2#3% - {\expandafter #1\expandafter #2\csname .=\xintCeil {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintCeil{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_ceil\XINT_expr_func_ceil \def\XINT_iiexpr_func_ceil #1#2#3% {% - \expandafter #1\expandafter #2\csname.=\xintiCeil {\XINT_expr_unlock #3}\endcsname }% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiCeil{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_sqr #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintSqr {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintSqr{\XINT_expr_unlock #3}\endcsname +}% +\def\XINTinFloatSqr#1{\XINTinFloatMul{#1}{#1}}% revoir après \def\XINT_flexpr_func_sqr #1#2#3% {% - \expandafter #1\expandafter #2\csname - .=\XINTinFloatMul{\XINT_expr_unlock #3}{\XINT_expr_unlock #3}\endcsname + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\XINTinFloatSqr{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_iiexpr_func_sqr #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiSqr{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_expr_func_? #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiIsNotZero{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_? \XINT_expr_func_? +\let\XINT_iiexpr_func_? \XINT_expr_func_? +\def\XINT_expr_func_! #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiIsZero{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_! \XINT_expr_func_! +\let\XINT_iiexpr_func_! \XINT_expr_func_! +\def\XINT_expr_func_not #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiIsZero{\XINT_expr_unlock #3}\endcsname }% +\let\XINT_flexpr_func_not \XINT_expr_func_not +\let\XINT_iiexpr_func_not \XINT_expr_func_not +\def\XINT_expr_func_odd #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintOdd{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_odd\XINT_expr_func_odd +\def\XINT_iiexpr_func_odd #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiOdd{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_expr_func_even #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintEven{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_even\XINT_expr_func_even +\def\XINT_iiexpr_func_even #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiEven{\XINT_expr_unlock #3}\endcsname +}% +% REVOIR nuple +\def\XINT_expr_func_nuple #1#2#3% + {\expandafter #1\expandafter #2\csname.=\XINT_expr_unlock #3\endcsname }% +\let\XINT_flexpr_func_nuple\XINT_expr_func_nuple +\let\XINT_iiexpr_func_nuple\XINT_expr_func_nuple \def\XINT_expr_func_factorial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_argandopt - \romannumeral`&&@\XINT_expr_unlock#3,,.\xintFac\XINTinFloatFac + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:one:and:opt + \romannumeral`&&@\XINT_expr_unlock#3,,!\xintFac\XINTinFloatFac \endcsname }% \def\XINT_flexpr_func_factorial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_argandopt - \romannumeral`&&@\XINT_expr_unlock#3,,.\XINTinFloatFacdigits\XINTinFloatFac + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:one:and:opt + \romannumeral`&&@\XINT_expr_unlock#3,,!\XINTinFloatFacdigits\XINTinFloatFac \endcsname }% \def\XINT_iiexpr_func_factorial #1#2#3% {% - \expandafter #1\expandafter #2\csname.=\xintiiFac{\XINT_expr_unlock #3}\endcsname + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiFac{\XINT_expr_unlock #3}\endcsname }% -\def\XINT_iiexpr_func_sqr #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiSqr {\XINT_expr_unlock #3}\endcsname }% \def\XINT_expr_func_sqrt #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_argandopt - \romannumeral`&&@\XINT_expr_unlock#3,,.\XINTinFloatSqrtdigits\XINTinFloatSqrt + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:one:and:opt + \romannumeral`&&@\XINT_expr_unlock#3,,!\XINTinFloatSqrtdigits\XINTinFloatSqrt \endcsname }% \let\XINT_flexpr_func_sqrt\XINT_expr_func_sqrt \def\XINT_iiexpr_func_sqrt #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiSqrt {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiSqrt{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_iiexpr_func_sqrtr #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiSqrtR {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiSqrtR{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_round #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_oneortwo - \expandafter\xintiRound\expandafter\xintRound - \romannumeral`&&@\XINT_expr_unlock #3,,.\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:one:or:two + \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiRound\xintRound + \endcsname }% \let\XINT_flexpr_func_round\XINT_expr_func_round \def\XINT_iiexpr_func_round #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_iiexpr_oneortwo\expandafter\xintiRound - \romannumeral`&&@\XINT_expr_unlock #3,,.\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:iiexpr:one:or:two + \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiRound + \endcsname }% \def\XINT_expr_func_trunc #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_oneortwo - \expandafter\xintiTrunc\expandafter\xintTrunc - \romannumeral`&&@\XINT_expr_unlock #3,,.\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:one:or:two + \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiTrunc\xintTrunc + \endcsname }% \let\XINT_flexpr_func_trunc\XINT_expr_func_trunc \def\XINT_iiexpr_func_trunc #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_iiexpr_oneortwo\expandafter\xintiTrunc - \romannumeral`&&@\XINT_expr_unlock #3,,.\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:iiexpr:one:or:two + \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiTrunc + \endcsname }% \def\XINT_expr_func_float #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_argandopt - \romannumeral`&&@\XINT_expr_unlock #3,,.\XINTinFloatdigits\XINTinFloat + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:one:and:opt + \romannumeral`&&@\XINT_expr_unlock #3,,!\XINTinFloatdigits\XINTinFloat \endcsname }% \let\XINT_flexpr_func_float\XINT_expr_func_float % \XINT_iiexpr_func_float not defined \def\XINT_expr_func_divmod #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_totwoargs - \romannumeral0\expandafter\xintdivmod - \romannumeral`&&@\expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:two + \romannumeral`&&@\XINT_expr_unlock #3,!\xintDivMod + \endcsname }% \def\XINT_flexpr_func_divmod #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINTinFloatDivMod - \romannumeral`&&@\expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:flexpr:two:to:two + \romannumeral`&&@\XINT_expr_unlock #3,!\XINTinFloatDivMod + \endcsname }% \def\XINT_iiexpr_func_divmod #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_totwoargs - \romannumeral0\expandafter\xintiidivmod - \romannumeral`&&@\expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:two + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiDivMod + \endcsname }% \def\XINT_expr_func_mod #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintMod - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintMod + \endcsname }% \def\XINT_flexpr_func_mod #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINTinFloatMod - \romannumeral`&&@\expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:flexpr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\XINTinFloatMod + \endcsname }% \def\XINT_iiexpr_func_mod #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiiMod - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiMod + \endcsname }% \def\XINT_expr_func_binomial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintBinomial - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintBinomial + \endcsname }% \def\XINT_flexpr_func_binomial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\XINTinFloatBinomial - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:flexpr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\XINTinFloatBinomial + \endcsname }% \def\XINT_iiexpr_func_binomial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiiBinomial - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiBinomial + \endcsname }% \def\XINT_expr_func_pfactorial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintPFactorial - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintPFactorial + \endcsname }% \def\XINT_flexpr_func_pfactorial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\XINTinFloatPFactorial - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:flexpr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\XINTinFloatPFactorial + \endcsname }% \def\XINT_iiexpr_func_pfactorial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiiPFactorial - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiPFactorial + \endcsname }% \def\XINT_expr_func_quo #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiQuo - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiQuo + \endcsname }% \let\XINT_flexpr_func_quo\XINT_expr_func_quo \def\XINT_iiexpr_func_quo #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiiQuo - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiQuo + \endcsname }% \def\XINT_expr_func_rem #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiRem - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiRem + \endcsname }% \let\XINT_flexpr_func_rem\XINT_expr_func_rem \def\XINT_iiexpr_func_rem #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiiRem - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiRem + \endcsname }% \def\XINT_expr_func_gcd #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintGCDof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintGCDof:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_gcd\XINT_expr_func_gcd \def\XINT_iiexpr_func_gcd #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintiiGCDof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintiiGCDof:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_lcm #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintLCMof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintLCMof:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_lcm\XINT_expr_func_lcm \def\XINT_iiexpr_func_lcm #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintiiLCMof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintiiLCMof:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_max #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintMaxof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintMaxof:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_iiexpr_func_max #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintiiMaxof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintiiMaxof:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_flexpr_func_max #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\XINTinFloatMaxof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\XINTinFloatMaxof:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_min #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintMinof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintMinof:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_iiexpr_func_min #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintiiMinof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintiiMinof:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_flexpr_func_min #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\XINTinFloatMinof:csv{\XINT_expr_unlock #3}\endcsname }% -\expandafter\def\csname XINT_expr_func_+\endcsname #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintSum:csv{\XINT_expr_unlock #3}\endcsname }% -\expandafter\def\csname XINT_flexpr_func_+\endcsname #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\XINTinFloatSum:csv{\XINT_expr_unlock #3}\endcsname }% -\expandafter\def\csname XINT_iiexpr_func_+\endcsname #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintiiSum:csv{\XINT_expr_unlock #3}\endcsname }% -\expandafter\def\csname XINT_expr_func_*\endcsname #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintPrd:csv{\XINT_expr_unlock #3}\endcsname }% -\expandafter\def\csname XINT_flexpr_func_*\endcsname #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\XINTinFloatPrd:csv{\XINT_expr_unlock #3}\endcsname }% -\expandafter\def\csname XINT_iiexpr_func_*\endcsname #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintiiPrd:csv{\XINT_expr_unlock #3}\endcsname }% -\def\XINT_expr_func_? #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintiiIsNotZero {\XINT_expr_unlock #3}\endcsname }% -\let\XINT_flexpr_func_? \XINT_expr_func_? -\let\XINT_iiexpr_func_? \XINT_expr_func_? -\def\XINT_expr_func_! #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiIsZero {\XINT_expr_unlock #3}\endcsname }% -\let\XINT_flexpr_func_! \XINT_expr_func_! -\let\XINT_iiexpr_func_! \XINT_expr_func_! -\def\XINT_expr_func_not #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiIsZero {\XINT_expr_unlock #3}\endcsname }% -\let\XINT_flexpr_func_not \XINT_expr_func_not -\let\XINT_iiexpr_func_not \XINT_expr_func_not +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\XINTinFloatMinof:csv{\XINT_expr_unlock #3}\endcsname +}% +\expandafter +\def\csname XINT_expr_func_+\endcsname #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintSum:csv{\XINT_expr_unlock #3}\endcsname +}% +\expandafter +\def\csname XINT_flexpr_func_+\endcsname #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\XINTinFloatSum:csv{\XINT_expr_unlock #3}\endcsname +}% +\expandafter +\def\csname XINT_iiexpr_func_+\endcsname #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintiiSum:csv{\XINT_expr_unlock #3}\endcsname +}% +\expandafter +\def\csname XINT_expr_func_*\endcsname #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintPrd:csv{\XINT_expr_unlock #3}\endcsname +}% +\expandafter +\def\csname XINT_flexpr_func_*\endcsname #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\XINTinFloatPrd:csv{\XINT_expr_unlock #3}\endcsname +}% +\expandafter +\def\csname XINT_iiexpr_func_*\endcsname #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintiiPrd:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_all #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintANDof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintANDof:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_all\XINT_expr_func_all \let\XINT_iiexpr_func_all\XINT_expr_func_all \def\XINT_expr_func_any #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintORof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintORof:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_any\XINT_expr_func_any \let\XINT_iiexpr_func_any\XINT_expr_func_any \def\XINT_expr_func_xor #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintXORof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintXORof:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_xor\XINT_expr_func_xor \let\XINT_iiexpr_func_xor\XINT_expr_func_xor -\def\xintifNotZero: #1,#2,#3,{\xintiiifNotZero{#1}{#2}{#3}}% -\def\XINT_expr_func_if #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\expandafter\xintifNotZero:\romannumeral`&&@\XINT_expr_unlock #3,\endcsname }% -\let\XINT_flexpr_func_if\XINT_expr_func_if -\let\XINT_iiexpr_func_if\XINT_expr_func_if -\def\xintifSgn: #1,#2,#3,#4,{\xintiiifSgn{#1}{#2}{#3}{#4}}% -\def\XINT_expr_func_ifsgn #1#2#3% +\def\XINT_expr_func_len #1#2#3% {% - \expandafter #1\expandafter #2\csname - .=\expandafter\xintifSgn:\romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter#1\expandafter#2\csname.=% + \XINT:NEhook:csv\xintLength:f:csv{\XINT_expr_unlock#3}\endcsname }% -\let\XINT_flexpr_func_ifsgn\XINT_expr_func_ifsgn -\let\XINT_iiexpr_func_ifsgn\XINT_expr_func_ifsgn -\def\XINT_expr_func_len #1#2#3% - {\expandafter#1\expandafter#2% - \csname.=\xintLength:f:csv {\XINT_expr_unlock#3}\endcsname }% \let\XINT_flexpr_func_len \XINT_expr_func_len \let\XINT_iiexpr_func_len \XINT_expr_func_len % \end{macrocode} @@ -35294,8 +35568,10 @@ It will get removed at some future release.}}% % \xintNewExpr compatibility.| % \begin{macrocode} \def\XINT_expr_func_first #1#2#3% - {\expandafter #1\expandafter #2\csname.=% - \xintFirstItem:f:csv{\XINT_expr_unlock #3}\endcsname}% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintFirstItem:f:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_first\XINT_expr_func_first \let\XINT_iiexpr_func_first\XINT_expr_func_first % \end{macrocode} @@ -35303,24 +35579,12 @@ It will get removed at some future release.}}% % \xintNewExpr compatibility.| % \begin{macrocode} \def\XINT_expr_func_last #1#2#3% - {\expandafter #1\expandafter #2\csname.=% - \xintLastItem:f:csv{\XINT_expr_unlock #3}\endcsname}% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintLastItem:f:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_last\XINT_expr_func_last \let\XINT_iiexpr_func_last\XINT_expr_func_last -\def\XINT_expr_func_odd #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintOdd{\XINT_expr_unlock #3}\endcsname}% -\let\XINT_flexpr_func_odd\XINT_expr_func_odd -\def\XINT_iiexpr_func_odd #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiOdd{\XINT_expr_unlock #3}\endcsname}% -\def\XINT_expr_func_even #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintEven{\XINT_expr_unlock #3}\endcsname}% -\let\XINT_flexpr_func_even\XINT_expr_func_even -\def\XINT_iiexpr_func_even #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiEven{\XINT_expr_unlock #3}\endcsname}% -\def\XINT_expr_func_nuple #1#2#3% - {\expandafter #1\expandafter #2\csname .=\XINT_expr_unlock #3\endcsname }% -\let\XINT_flexpr_func_nuple\XINT_expr_func_nuple -\let\XINT_iiexpr_func_nuple\XINT_expr_func_nuple % \end{macrocode} % \lverb|1.2c I hesitated but left the function "reversed" from 1.1 with % this name, not "reverse". But the inner not public macro got renamed @@ -35328,10 +35592,30 @@ It will get removed at some future release.}}% % rewrites it for direct handling of csv lists. 2016/03/17.| % \begin{macrocode} \def\XINT_expr_func_reversed #1#2#3% - {\expandafter #1\expandafter #2\csname .=% - \xintReverse:f:csv {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintReverse:f:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_reversed\XINT_expr_func_reversed \let\XINT_iiexpr_func_reversed\XINT_expr_func_reversed +\def\xintifNotZero: #1,#2,#3,{\xintiiifNotZero{#1}{#2}{#3}}% +\def\XINT_expr_func_if #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \expandafter\xintifNotZero:% + \romannumeral`&&@\XINT_expr_unlock #3,\endcsname +}% +\let\XINT_flexpr_func_if\XINT_expr_func_if +\let\XINT_iiexpr_func_if\XINT_expr_func_if +\def\xintifSgn: #1,#2,#3,#4,{\xintiiifSgn{#1}{#2}{#3}{#4}}% +\def\XINT_expr_func_ifsgn #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \expandafter\xintifSgn:% + \romannumeral`&&@\XINT_expr_unlock #3,\endcsname +}% +\let\XINT_flexpr_func_ifsgn\XINT_expr_func_ifsgn +\let\XINT_iiexpr_func_ifsgn\XINT_expr_func_ifsgn % \end{macrocode} % \subsection{f-expandable versions of the \csh{xintSeqB::csv} and alike % routines, for \csh{xintNewExpr}} @@ -35465,6 +35749,7 @@ It will get removed at some future release.}}% % | % \begin{macrocode} \catcode`: 12 +\catcode`~ 12 \def\XINT_tmpa #1#2#3#4% {% \def #1##1(##2)##3=##4;{% @@ -35477,11 +35762,11 @@ It will get removed at some future release.}}% \edef\XINT_expr_tmpc {subs(\unexpanded\expandafter{\XINT_expr_tmpc},% ####1=################\XINT_expr_tmpb)}% }% - \expandafter#3\csname XINT_#2_userfunc_\XINT_expr_tmpa\endcsname - [\XINT_expr_tmpb]{\XINT_expr_tmpc}% \expandafter\XINT_expr_defuserfunc \csname XINT_#2_func_\XINT_expr_tmpa\expandafter\endcsname - \csname XINT_#2_userfunc_\XINT_expr_tmpa\endcsname + \expandafter{\XINT_expr_tmpa}{#2}% + \expandafter#3\csname XINT_#2_userfunc_\XINT_expr_tmpa\endcsname + [\XINT_expr_tmpb]{\XINT_expr_tmpc}% \ifxintverbose\xintMessage {xintexpr}{Info} {Function \XINT_expr_tmpa\space for \string\xint #4 parser associated to \string\XINT_#2_userfunc_\XINT_expr_tmpa\space @@ -35494,11 +35779,17 @@ It will get removed at some future release.}}% \XINT_tmpa\xintdeffunc {expr} \XINT_NewFunc {expr}% \XINT_tmpa\xintdefiifunc {iiexpr}\XINT_NewIIFunc {iiexpr}% \XINT_tmpa\xintdeffloatfunc{flexpr}\XINT_NewFloatFunc{floatexpr}% -\def\XINT_expr_defuserfunc #1#2{% +\def\XINT_expr_defuserfunc #1#2#3% +{% \def #1##1##2##3{\expandafter ##1\expandafter ##2% - \csname .=\expandafter #2\romannumeral`&&@\XINT_expr_unlock ##3,\endcsname + \csname .=\XINT:expr:userfunc{#3}{#2}{\XINT_expr_unlock ##3}\endcsname }% }% +\def\XINT:expr:userfunc #1#2#3% + {\csname XINT_#1_userfunc_#2\expandafter\endcsname + \romannumeral0\xintcsvtolistnonstripped{#3}}% +\def\XINT:newexpr:userfunc #1#2#3% + {~csname XINT_#1_userfunc_#2~endcsname\xintCSVtoListNonStripped{#3}}% % \end{macrocode} % \subsection{\csh{xintNewFunction}} % \lverb|1.2h (2016/11/20). Syntax is \xintNewFunction{<name>}[nb of @@ -35516,16 +35807,16 @@ It will get removed at some future release.}}% \def\XINT_expr_tmpb ##1##2##3##4##5##6##7##8##9{#4}% \begingroup \ifcase #3\relax - \toks0{,}% - \or \toks0{##1,}% - \or \toks0{##1,##2,}% - \or \toks0{##1,##2,##3,}% - \or \toks0{##1,##2,##3,##4,}% - \or \toks0{##1,##2,##3,##4,##5,}% - \or \toks0{##1,##2,##3,##4,##5,##6,}% - \or \toks0{##1,##2,##3,##4,##5,##6,##7,}% - \or \toks0{##1,##2,##3,##4,##5,##6,##7,##8,}% - \else \toks0{##1,##2,##3,##4,##5,##6,##7,##8,##9,}% + \toks0{}% + \or \toks0{##1}% + \or \toks0{##1##2}% + \or \toks0{##1##2##3}% + \or \toks0{##1##2##3##4}% + \or \toks0{##1##2##3##4##5}% + \or \toks0{##1##2##3##4##5##6}% + \or \toks0{##1##2##3##4##5##6##7}% + \or \toks0{##1##2##3##4##5##6##7##8}% + \else \toks0{##1##2##3##4##5##6##7##8##9}% \fi \expandafter \endgroup @@ -35537,13 +35828,13 @@ It will get removed at some future release.}}% {\XINT_expr_wrapit{##7}}{\XINT_expr_wrapit{##8}}{\XINT_expr_wrapit{##9}}}% \expandafter\XINT_expr_newfunction \csname XINT_expr_func_\XINT_expr_tmpa\expandafter\endcsname - \csname XINT_expr_macrofunc_\XINT_expr_tmpa\endcsname\xintbareeval + \expandafter{\XINT_expr_tmpa}{eval}\xintbareeval \expandafter\XINT_expr_newfunction \csname XINT_iiexpr_func_\XINT_expr_tmpa\expandafter\endcsname - \csname XINT_expr_macrofunc_\XINT_expr_tmpa\endcsname\xintbareiieval + \expandafter{\XINT_expr_tmpa}{iieval}\xintbareiieval \expandafter\XINT_expr_newfunction \csname XINT_flexpr_func_\XINT_expr_tmpa\expandafter\endcsname - \csname XINT_expr_macrofunc_\XINT_expr_tmpa\endcsname\xintbarefloateval + \expandafter{\XINT_expr_tmpa}{floateval}\xintbarefloateval \ifxintverbose \xintMessage {xintexpr}{Info} {Function \XINT_expr_tmpa\space for the expression parsers is @@ -35552,10 +35843,27 @@ It will get removed at some future release.}}% \csname XINT_expr_macrofunc_\XINT_expr_tmpa\endcsname}% \fi }% -\def\XINT_expr_newfunction #1#2#3% +\def\XINT_expr_newfunction #1#2#3#4% +{% + \def#1##1##2##3{\expandafter ##1\expandafter ##2\romannumeral0% + \XINT:expr:macrofunc{#4}{#3}{#2}{\XINT_expr_unlock##3}}% +}% +\def\XINT:expr:macrofunc #1#2#3#4% +{% + #1\csname XINT_expr_macrofunc_#3\expandafter\endcsname + \romannumeral0\xintcsvtolistnonstripped{#4}\relax +}% +\def\XINT:newexpr:macrofunc #1{% +\def\XINT:newexpr:macrofunc ##1##2##3##4% {% - \def#1##1##2##3{\expandafter ##1\expandafter ##2\romannumeral`&&@% - #3\expandafter#2\romannumeral`&&@\XINT_expr_unlock##3,\relax}% + \expandafter#1\csname.=~XINT:newexpr:macrofunc:a{##2}{##3}% + {\xintCSVtoListNonStripped{##4}}\endcsname +}% +}\XINT:newexpr:macrofunc { }% +\def\XINT:newexpr:macrofunc:a #1#2#3% +{% + \expandafter\XINT_expr_unlock\romannumeral0\csname xintbare#1\endcsname + \csname XINT_expr_macrofunc_#2\endcsname#3\relax }% % \end{macrocode} % \subsection{\csh{xintNewExpr}, \csh{xintNewIExpr}, \csh{xintNewFloatExpr}, @@ -35595,8 +35903,59 @@ It will get removed at some future release.}}% % them. It does work when the macro parameters (or variables for \xintdeffunc) % do not intervene in the list of values to iterate over. But we can not delay % expansion of dummy variables. +% +% Comments added 2018/02/28: +% +% At 1.3 of February 2018, there was important refactoring. Earlier, +% \XINT_expr_redefinemacros was a very big macro which made aliases of the +% dozens of macros (most from xintfrac and some defined especially by xintexpr +% for acting on csv lists primarily) involved in the expression rendering and +% then redefined them all to expand to their original selves only when applied +% to purely numeric arguments. At 1.3 only very few such re-definitions are +% made, as what is redefined are a limited number of core wrapper macros. +% +% Only when the original macros have one or two arguments is it examined if +% they can expand immediately (this includes case of function having possibly +% only one, or possibly two arguments). For macros applying to three or more +% or an undefined number of arguments, we don't complicate matters into +% checking if expansion is possible, and we delay that expansion +% automatically (but if() and ifsgn() do check if first argument is numeric +% and expand to suitable branch in that case). +% +% In particular any function defined by \xintdeffunc or \xintNewFunction (it +% is then basically only a macro abstraction) when used in new function +% definitions will never be expanded immediately, because the detection of +% whether they are applied to only numerical data has not yet been added. +% (this might be added in future). +% +% Some aspects of the 1.3 refactoring have made recursive definition via +% \xintdeffunc possible (of course they always were via \xintNewFunction as +% the latter is but a wrapper of a standard TeX macro definition, where +% \xintexpr parsing is not at all involved). +% +% A somewhat complicated layer (not modified at 1.3) is devoted to making +% possible the parsing of constructs such as [#1..[#2]..#3][#4:#5] or +% [#1..#2]*#3 and it seems to work. At 1.3, even esoteric construct such as +% [divmod(#1,#2)]*#3 is parsable by \xintNewExpr. (In \xintNewFloatExpr, don't +% forget \empty token so that square brackets are not mistaken for optional +% argument of \xintthefloatexpr; same for \xintdeffloatfunc.) +% +% Side note: I wonder if I really had a good idea to define these list +% operations [..]*foo or foo^[...] which do not seem to occur in other +% languages with the meanings I used. And they caused me lots of efforts for +% support at \xintNewExpr level... +% +% The catcode 12 dollar sign is used to signal when a macro can not be +% expanded but would produce a csv list. Furthermore some cases require +% f-expandable macros as the original code expanding in \xintexpr is in +% \csname context and did not need f-expandability. +% +% As mentioned above, currently syntax with dummy variables can not go through +% where the values iterated over are not explicit; and omit, abort, break +% mechanisms are not parsable with non purely numerical data, in part because +% they are not implemented internally via pure f-expansion. % | -% \subsubsection{\csh{xintApply::csv}} +% \subsubsection{\csh{xintApply::csv} and \csh{xintApply:::csv}} % \begin{macrocode} \def\xintApply::csv #1#2% {\expandafter\XINT_applyon::_a\expandafter {\romannumeral`&&@#2}{#1}}% @@ -35607,9 +35966,6 @@ It will get removed at some future release.}}% \def\XINT_applyon::_d #1,#2{\expandafter\XINT_applyon::_e\romannumeral`&&@#2{#1},{#2}}% \def\XINT_applyon::_e #1,#2#3{\XINT_applyon::_b {#2}{#3, #1}}% \def\XINT_applyon::_end #1,#2#3{\xint_secondoftwo #3}% -% \end{macrocode} -% \subsubsection{\csh{xintApply:::csv}} -% \begin{macrocode} \def\xintApply:::csv #1#2#3% {\expandafter\XINT_applyon:::_a\expandafter{\romannumeral`&&@#2}{#1}{#3}}% \def\XINT_applyon:::_a #1#2#3{\XINT_applyon:::_b {#2}{#3}{}#1,,}% @@ -35623,168 +35979,156 @@ It will get removed at some future release.}}% \def\XINT_applyon:::_e #1,#2#3#4{\XINT_applyon:::_b {#2}{#3}{#4, #1}}% \def\XINT_applyon:::_end #1,#2#3#4{\xint_secondoftwo #4}% % \end{macrocode} -% \subsubsection{\csh{XINT_expr_RApply::csv}, \csh{XINT_expr_LApply::csv}, -% \csh{XINT_expr_RLApply:::csv}} -% \lverb|The #1 in _Rapply will start with a ~. No risk of glueing to previous -% ~expandafter during the \scantokens. -% -% Attention here and next ~ has catcode 12 and not 3 like elsewhere in -% xintexpr.| -% \begin{macrocode} -\catcode`~ 12 -\def\XINT_expr_RApply::csv #1#2#3#4% - {~xintApply::csv{~expandafter#1~xint_exchangetwo_keepbraces{#4}}{#3}}% -\def\XINT_expr_LApply::csv #1#2#3#4{~xintApply::csv{#1{#3}}{#4}}% -\def\XINT_expr_RLApply:::csv #1#2{~xintApply:::csv{#1}}% -% \end{macrocode} % \subsubsection{Mysterious stuff} % \lverb|~ and $$ of catcode 12 in what follows.| % \begin{macrocode} +\catcode`~ 12 \catcode`$ 12 % $ -\def\XINT_xptwo_getab_b #1#2!#3% - {\expandafter\XINT_xptwo_getab_c\romannumeral`&&@#3!#1{#1#2}}% -\def\XINT_xptwo_getab_c #1#2!#3#4#5#6{#1#3{#5}{#6}{#1#2}{#4}}% \def\xint_ddfork #1$$#2#3\krof {#2}% $$ -\def\XINT_NEfork #1#2{\xint_ddfork - #1#2\XINT_expr_RLApply:::csv - #1$\XINT_expr_RApply::csv% $ - $#2\XINT_expr_LApply::csv% $ - $${\XINT_NEfork_nn #1#2}% $$ - \krof }% -\def\XINT_NEfork_nn #1#2#3#4{% - \if #1##\xint_dothis{#3}\fi - \if #1~\xint_dothis{#3}\fi - \if #2##\xint_dothis{#3}\fi - \if #2~\xint_dothis{#3}\fi - \xint_orthat {\csname #4NE\endcsname }% - }% -\def\XINT_NEfork_one #1#2!#3#4#5#6{% - \if ###1\xint_dothis {#3}\fi - \if ~#1\xint_dothis {#3}\fi - \if $#1\xint_dothis {~xintApply::csv{#3#5}}\fi %$ - \xint_orthat {\csname #4NE\endcsname #6}{#1#2}% -}% -\toks0 {}% -\xintFor #1 in - {DivFloor,Mod,Round,Trunc,iRound,iTrunc,iQuo,iRem, - iiDivFloor,iiDivRound,iiMod,iiQuo,iiRem,% - Lt,Gt,Eq,LtorEq,GtorEq,NotEq,% - iiLt,iiGt,iiEq,iiLtorEq,iiGtorEq,iiNotEq,% - Add,Sub,Mul,Div,Pow,E,% - iiAdd,iiSub,iiMul,iiPow,iiE,% - AND,OR,XOR,% - SeqA::csv,iiSeqA::csv}\do - {\toks0 - \expandafter{\the\toks0% no space! - \expandafter\let\csname xint#1NE\expandafter\endcsname\csname xint#1\expandafter - \endcsname\expandafter\def\csname xint#1\endcsname ####1####2{% - \expandafter\XINT_NEfork - \romannumeral`&&@\expandafter\XINT_xptwo_getab_b - \romannumeral`&&@####2!{####1}{~xint#1}{xint#1}}% - }% +\def\XINT:NE:RApply::csv #1#2#3#4% + {~xintApply::csv{~expandafter #2~xint_exchangetwo_keepbraces{#4}}{#3}}% +\def\XINT:NE:LApply::csv #1#2#3{~xintApply::csv{#2{#3}}}% +\def\XINT:NE:RLApply:::csv #1{~xintApply:::csv}% +\def\XINT:NE:two#1{\XINT:NE:two_{#1}{\detokenize{#1}}}% +\def\XINT:NE:two_#1#2#3#4% + {\expandafter\XINT:NE:two_a\romannumeral`&&@#4!{#3}{#1}{#2}}% +\def\XINT:NE:two_a#1#2!#3#4#5% + {\expandafter\XINT:NE:two_b\romannumeral`&&@#3!#1{#4}{#5}{#1#2}}% +\def\XINT:NE:two_b#1#2!#3#4#5{\XINT:NE:two_fork_dd#1#3{#4}{#5}{#1#2}}% +\def\XINT:NE:two_fork_dd #1#2{% + \xint_ddfork + #1#2\XINT:NE:RLApply:::csv + #1$\XINT:NE:RApply::csv% $ + $#2\XINT:NE:LApply::csv% $ + $${\XINT:NE:two_fork_nn #1#2}% $$ + \krof }% -% cela aurait-il un sens d'ajouter Raw et iNum (à cause de qint, qfrac, -% qfloat?). Pas le temps d'y réfléchir. Je ne fais rien. -\xintFor #1 in {Num,Irr,Abs,iiAbs,Sgn,iiSgn,TFrac,Floor,iFloor,Ceil,iCeil,% - Sqr,iiSqr,iiSqrt,iiSqrtR,iiIsZero,iiIsNotZero,iiifNotZero,iiifSgn,% - Odd,Even,iiOdd,iiEven,Opp,iiOpp,iiifZero,Fac,Binomial,% - PFactorial,iiFac,iiBinomial,iiPFactorial,Bool,Toggle}\do -{\toks0 \expandafter{\the\toks0% - \expandafter\let\csname xint#1NE\expandafter\endcsname\csname - xint#1\expandafter - \endcsname\expandafter\def\csname xint#1\endcsname ####1{% - \expandafter\XINT_NEfork_one\romannumeral`&&@####1!{~xint#1}{xint#1}{}{}}% - }% +\def\XINT:NE:two_fork_nn #1#2#3#4{% + \if #1##\xint_dothis{#4}\fi + \if #1~\xint_dothis{#4}\fi + \if #2##\xint_dothis{#4}\fi + \if #2~\xint_dothis{#4}\fi + \xint_orthat{#3}% +}% +\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}% +}% +\def\XINT:NE:oneopt#1[#2]#3% + {\expandafter\XINT:NE:oneopt_a\romannumeral`&&@#3!{#2}#1}% +\def\XINT:NE:oneopt_a#1#2!#3#4% + {\expandafter\XINT:NE:oneopt_b\romannumeral`&&@#3!#1#4{#1#2}}% +\def\XINT:NE:oneopt_b#1#2!#3#4% + {\expandafter\XINT:NE:oneopt_fork#1#3#4{#1#2}}% +\def\XINT:NE:oneopt_fork#1#2#3#4{% + \if1\if###11\else\if~#11\else\if###21\else\if~#21\else0\fi\fi\fi\fi + \xint_dothis {\detokenize{#3}[#4]}\fi + \if $#2\xint_dothis {~xintApply::csv{\detokenize{#3}[#4]}}\fi %$ + \xint_orthat{#3[#4]}% +}% pas complétement général, mais bon +\def\XINT:NE:csv #1{\detokenize{#1}}% radicalement fainéant +\def\XINT:newexpr:one:and:opt #1,#2,#3!#4#5% +{% + \if\relax#3\relax\expandafter\xint_firstoftwo\else + \expandafter\xint_secondoftwo\fi + {\XINT:NE:one#4}{\XINT:NE:oneopt#5[\XINT:NE:one\xintNum{#2}]}{#1}% }% -\toks0 - \expandafter{\the\toks0 - \let\XINTinFloatFacNE\XINTinFloatFac - \def\XINTinFloatFac ##1{% - \expandafter\XINT_NEfork_one - \romannumeral`&&@##1!{~XINTinFloatFac}{XINTinFloatFac}{}{}}% - }% -\xintFor #1 in {Add,Sub,Mul,Div,Binomial,PFactorial,PowerH,E,% - Mod,DivFloor,DivMod,SeqA::csv}\do -{\toks0 - \expandafter{\the\toks0% - \expandafter\let\csname XINTinFloat#1NE\expandafter\endcsname - \csname XINTinFloat#1\expandafter\endcsname - \expandafter\def\csname XINTinFloat#1\endcsname ####1####2{% - \expandafter\XINT_NEfork - \romannumeral`&&@\expandafter\XINT_xptwo_getab_b - \romannumeral`&&@####2!{####1}{~XINTinFloat#1}{XINTinFloat#1}}% - }% +\def\XINT:newexpr:one:or:two #1,#2,#3!#4#5% +{% + \if\relax#3\relax\expandafter\xint_firstoftwo\else + \expandafter\xint_secondoftwo\fi + {\XINT:NE:two#4{0}}{\XINT:NE:two#5{\XINT:NE:one\xintNum{#2}}}{#1}% }% -\xintFor #1 in {XINTinFloatdigits,XINTinFloatFracdigits,XINTinFloatSqrtdigits,XINTinFloatFacdigits}\do -{\toks0 - \expandafter{\the\toks0% - \expandafter\let\csname #1NE\expandafter\endcsname\csname #1\expandafter - \endcsname\expandafter\def\csname #1\endcsname ####1{\expandafter - \XINT_NEfork_one\romannumeral`&&@####1!{~#1}{#1}{}{}}% - }% +\def\XINT:newiiexpr:one:or:two #1,#2,#3!#4% +{% + \if\relax#3\relax\expandafter\xint_firstoftwo\else + \expandafter\xint_secondoftwo\fi + {\XINT:NE:two#4{0}}{\XINT:NE:two#4{#2}}{#1}% }% -\xintFor #1 in {xintSeq::csv,xintiiSeq::csv,XINTinFloatSeq::csv}\do - {\toks0 - \expandafter{\the\toks0% no space - \expandafter\let\csname #1NE\expandafter\endcsname\csname #1\expandafter - \endcsname\expandafter\def\csname #1\endcsname ####1####2{% - \expandafter\XINT_NEfork - \romannumeral`&&@\expandafter\XINT_xptwo_getab_b - \romannumeral`&&@####2!{####1}{$noexpand$#1}{#1}}% - }% +\def\XINT:newexpr:insertdollar~{$noexpand$}% +\def\XINT:newexpr:two:to:two #1,#2,!#3% +{% + \XINT:NE:two_ + {\expandafter\XINT:expr:totwo\romannumeral`&&@#3}% + {$noexpand$expandafter~XINT:expr:totwo~romannumeral-`0\detokenize{#3}}% + {#1}{#2}% }% -\xintFor #1 in {xintSeqB,xintiiSeqB,XINTinFloatSeqB}\do - {\toks0 - \expandafter{\the\toks0% no space - \expandafter\let\csname #1::csvNE\expandafter\endcsname\csname #1::csv\expandafter - \endcsname\expandafter\def\csname #1::csv\endcsname ####1####2{% - \expandafter\XINT_NEfork - \romannumeral`&&@\expandafter\XINT_xptwo_getab_b - \romannumeral`&&@####2!{####1}{$noexpand$#1:f:csv}{#1::csv}}% - }% +\def\XINT:newflexpr:two:to:two #1,#2,!#3% +{% + \XINT:NE:two_ + {#3}% + {\expandafter\XINT:newexpr:insertdollar\detokenize{#3}}% + {#1}{#2}% }% -\toks0 - \expandafter{\the\toks0 - \let\XINTinFloatNE\XINTinFloat - \def\XINTinFloat [##1]##2{% not ultimately general, but got tired - \expandafter\XINT_NEfork_one - \romannumeral`&&@##2!{~XINTinFloat[##1]}{XINTinFloat}{}{[##1]}}% - \let\XINTinFloatSqrtNE\XINTinFloatSqrt - \def\XINTinFloatSqrt [##1]##2{% - \expandafter\XINT_NEfork_one - \romannumeral`&&@##2!{~XINTinFloatSqrt[##1]}{XINTinFloatSqrt}{}{[##1]}}% - \let\XINTinFloatFacNE\XINTinFloatFac - \def\XINTinFloatFac [##1]##2{% - \expandafter\XINT_NEfork_one - \romannumeral`&&@##2!{~XINTinFloatFac[##1]}{XINTinFloatFac}{}{[##1]}}% -}% -% \end{macrocode} -% \lverb|\xintNewExpr has difficulties with handling lists, hence all these -% macros are set-up to simply not attempt to do anything immediately, they -% will not try to check if the list is completely explicit.| -% \begin{macrocode} -\xintFor #1 in {ANDof,ORof,XORof,iiMaxof,iiMinof,iiSum,iiPrd, - GCDof,LCMof,Sum,Prd,Maxof,Minof, - Reverse:f,FirstItem:f,LastItem:f}\do -{\toks0 - \expandafter{\the\toks0\expandafter\def\csname xint#1:csv\endcsname {~xint#1:csv}}% -}% -\xintFor #1 in - {XINTinFloatMaxof,XINTinFloatMinof,XINTinFloatSum,XINTinFloatPrd}\do -{\toks0 - \expandafter{\the\toks0\expandafter\def\csname #1:csv\endcsname {~#1:csv}}% -}% -% \end{macrocode} -% \lverb|~xintListSel:f:csv must have space after it, the reason being in -% that \XINT_expr_until_:_b inserts a : to signal Python slice type or -% argument hence this : would end up following immediately ~xintListSel:f:csv -% and scantokens will get confused after that. Since 1.2j -% there is initially \xintListSel:x:csv.| -% \begin{macrocode} -\toks0 \expandafter{\the\toks0 - \def\xintListSel:x:csv {~xintListSel:f:csv }% -}% -\odef\XINT_expr_redefinemacros {\the\toks0}% +\def\XINT:newexpr:two:to:one #1,#2,!#3% +{% + \XINT:NE:two#3{#1}{#2}% +}% +\let\XINT:newflexpr:two:to:one\XINT:newexpr:two:to:one +\def\xintifNotZeroNE:#1#2,#3,#4,% +{% + \if1\if###11\else\if~#11\else\if$#11\else0%$ + \fi\fi\fi + \xint_dothis{~xintifNotZero}\fi + \xint_orthat\xintifNotZero + {#1#2}{#3}{#4}% +}% +\def\xintifSgnNE:#1#2,#3,#4,#5,% +{% + \if1\if###11\else\if~#11\else\if$#11\else0%$ + \fi\fi\fi + \xint_dothis{~xintifSgn}\fi + \xint_orthat\xintifSgn + {#1#2}{#3}{#4}{#5}% +}% +% \end{macrocode} +% \subsubsection{\csh{XINT_expr_redefinemacros}} +% \lverb|Completely refactored at 1.3.| +% \begin{macrocode} +\def\XINT_expr_redefinemacros {% + \let\XINT:NEhook:one\XINT:NE:one + \let\XINT:NEhook:two\XINT:NE:two + \let\XINT:NEhook:csv\XINT:NE:csv + \let\XINT:expr:one:and:opt \XINT:newexpr:one:and:opt + \let\XINT:expr:one:or:two \XINT:newexpr:one:or:two + \let\XINT:iiexpr:one:or:two \XINT:newiiexpr:one:or:two + \let\XINT:expr:two:to:two \XINT:newexpr:two:to:two + \let\XINT:expr:two:to:one \XINT:newexpr:two:to:one + \let\XINT:flexpr:two:to:one \XINT:newflexpr:two:to:one + \let\XINT:expr:two:to:one \XINT:newexpr:two:to:one + \let\XINT:flexpr:two:to:two \XINT:newflexpr:two:to:two + \let\XINT:flexpr:two:to:one \XINT:newflexpr:two:to:one + \let\xintifNotZero: \xintifNotZeroNE: + \let\xintifSgn: \xintifSgnNE: + \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 + \def\xintSeq::csv + {\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 + {\XINT:NE:two_\xintiiSeqBNumeric::csv{$noexpand$xintiiSeqB:f:csv}}% + \def\XINTinFloatSeqB::csv + {\XINT:NE:two_\XINTinFloatSeqBNumeric::csv{$noexpand$XINTinFloatSeqB:f:csv}}% + \def\xintListSel:x:csv {~xintListSel:f:csv }% + \let\XINT:expr:userfunc \XINT:newexpr:userfunc + \let\XINT:expr:macrofunc\XINT:newexpr:macrofunc +}% +% \end{macrocode} +% \subsubsection{\csh{XINT_expr_redefineprints}} +% \lverb|This is used by \xintNewExpr but not by \xintdeffunc.| +% \begin{macrocode} \def\XINT_expr_redefineprints {% \def\XINT_flexpr_noopt @@ -35794,88 +36138,82 @@ It will get removed at some future release.}}% \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}}% -% \end{macrocode} -% \begin{macrocode} + \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}}% \def\xintCSV::csv {~xintCSV::csv }% \def\xintSPRaw::csv {~xintSPRaw::csv }% \def\xintPFloat::csv {~xintPFloat::csv }% \def\xintIsTrue::csv {~xintIsTrue::csv }% \def\xintRound::csv {~xintRound::csv }% }% -\toks0 {}% % \end{macrocode} % \subsubsection{\csh{xintNewExpr}, ..., at last.} % \lverb|& % 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.| % \begin{macrocode} -\def\xintNewExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone +\def\xintNewExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone \xinttheexpr\XINT_newexpr_clean}% -\def\xintNewFloatExpr{\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone +\def\xintNewFloatExpr{\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone \xintthefloatexpr\XINT_newexpr_clean}% -\def\xintNewIExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone +\def\xintNewIExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone \xinttheiexpr\XINT_newexpr_clean}% -\def\xintNewIIExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone +\def\xintNewIIExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone \xinttheiiexpr\XINT_newexpr_clean}% -\def\xintNewBoolExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone +\def\xintNewBoolExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone \xinttheboolexpr\XINT_newexpr_clean}% \def\XINT_newexpr_clean #1>{\noexpand\romannumeral`&&@}% % \end{macrocode} -% \lverb|1.2c for \xintdeffunc, \xintdefiifunc, \xintdeffloatfunc.| +% \lverb|1.2c for \xintdeffunc, \xintdefiifunc, \xintdeffloatfunc. +% +% At 1.3, NewFunc does not use a comma delimited pattern anymore.| % \begin{macrocode} \def\XINT_NewFunc - {\XINT_NewExpr,{}\xint_gobble_i\xintthebareeval \XINT_newfunc_clean }% + {\XINT_NewExpr{}\xint_gobble_i\xintthebareeval\XINT_newfunc_clean}% \def\XINT_NewFloatFunc - {\XINT_NewExpr,{}\xint_gobble_i\xintthebarefloateval\XINT_newfunc_clean }% + {\XINT_NewExpr{}\xint_gobble_i\xintthebarefloateval\XINT_newfunc_clean}% \def\XINT_NewIIFunc - {\XINT_NewExpr,{}\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 -% macro name as parameter. And _NewExpr itself receives two new parameters to -% treat both \xintNewExpr and \xintdeffunc. +% macro name as parameter. % % Up to and including 1.2c the definition was global. Starting with 1.2d it is % done locally. % | % \begin{macrocode} -\def\XINT_NewExpr #1#2#3#4#5#6#7[#8]% +\def\XINT_NewExpr #1#2#3#4#5#6[#7]% {% \begingroup - \ifcase #8\relax - \toks0 {\endgroup\def#6}% - \or \toks0 {\endgroup\def#6##1#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1##3#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1##7#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1##7#1##8#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1##7#1##8#1##9#1}% + \ifcase #7\relax + \toks0 {\endgroup\def#5}% + \or \toks0 {\endgroup\def#5##1}% + \or \toks0 {\endgroup\def#5##1##2}% + \or \toks0 {\endgroup\def#5##1##2##3}% + \or \toks0 {\endgroup\def#5##1##2##3##4}% + \or \toks0 {\endgroup\def#5##1##2##3##4##5}% + \or \toks0 {\endgroup\def#5##1##2##3##4##5##6}% + \or \toks0 {\endgroup\def#5##1##2##3##4##5##6##7}% + \or \toks0 {\endgroup\def#5##1##2##3##4##5##6##7##8}% + \or \toks0 {\endgroup\def#5##1##2##3##4##5##6##7##8##9}% \fi \xintexprSafeCatcodes \XINT_expr_redefinemacros - #2% - \XINT_NewExpr_a #3#4#5#6% + #1% + \XINT_NewExpr_a #2#3#4#5% }% % \end{macrocode} % \lverb|& attention que & est de catcode 14 -% $catcode38 12 -% For the 1.2a release I replaced all \romannumeral-`0 by a fancier -% \romannumeral`&&@ (with & of catcode 7). I got lucky here that it worked, -% despite @ being of catcode comment (anyhow \input xintexpr.sty would not -% have compiled if not, and I would have realized immediately). But to be -% honest I wouldn't have been 100$% sure -% beforehand that &&@ worked also with @ comment character. I now know. % % 1.2d's \xintNewExpr makes a local definition. In earlier releases, the % definition was global.| @@ -35889,13 +36227,14 @@ It will get removed at some future release.}}% \catcode`# 12 \catcode`~ 13 \escapechar 126 \endlinechar -1 \everyeof {\noexpand }@ \edef\XINT_tmpb - {\scantokens\expandafter - {\romannumeral`&&@\expandafter%2\XINT_tmpa {#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}\relax}@ + {\scantokens\expandafter{\romannumeral`&&@\expandafter + %2\XINT_tmpa{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}\relax}@ }@ \escapechar 92 \catcode`# 6 \catcode`$ 0 @ $ \edef\XINT_tmpa %%1%%2%%3%%4%%5%%6%%7%%8%%9@ - {\scantokens\expandafter{\expandafter%3\meaning\XINT_tmpb}}@ - \the\toks0\expandafter{\XINT_tmpa{%%1}{%%2}{%%3}{%%4}{%%5}{%%6}{%%7}{%%8}{%%9}}@ + {\scantokens\expandafter{\expandafter%3\meaning\XINT_tmpb}}@ + \the\toks0\expandafter + {\XINT_tmpa{%%1}{%%2}{%%3}{%%4}{%%5}{%%6}{%%7}{%%8}{%%9}}@ %1{\ifxintverbose \xintMessage{xintexpr}{Info}@ {\string%4\space now with meaning \meaning%4}@ @@ -35928,6 +36267,7 @@ It will get removed at some future release.}}% \catcode45=\the\catcode45 % - \catcode44=\the\catcode44 % , \catcode61=\the\catcode61 % = + \catcode96=\the\catcode96 % ` \catcode32=\the\catcode32\relax % space }% \catcode59=12 % ; @@ -35952,6 +36292,7 @@ It will get removed at some future release.}}% \catcode45=12 % - \catcode44=12 % , \catcode61=12 % = + \catcode96=12 % ` \catcode32=10 % space }% \let\XINT_tmpa\relax \let\XINT_tmpb\relax \let\XINT_tmpc\relax @@ -35965,34 +36306,34 @@ It will get removed at some future release.}}% %<*dtx>----------------------------------------------------------- \iffalse % grep -c -e "^{%" xint*sty -xint.sty:178 +xint.sty:161 xintbinhex.sty:53 xintcfrac.sty:183 -xintcore.sty:282 -xintexpr.sty:173 -xintfrac.sty:453 +xintcore.sty:275 +xintexpr.sty:235 +xintfrac.sty:467 xintgcd.sty:49 xintkernel.sty:13 xintseries.sty:48 xinttools.sty:140 \fi % grep -o "^{%" xint*sty | wc -l -\def\totala{ 1572} +\def\totala{ 1624} \iffalse % grep -c -e "^}%" xint*sty -xint.sty:177 +xint.sty:160 xintbinhex.sty:52 xintcfrac.sty:183 -xintcore.sty:279 -xintexpr.sty:203 -xintfrac.sty:451 +xintcore.sty:272 +xintexpr.sty:260 +xintfrac.sty:468 xintgcd.sty:51 xintkernel.sty:14 xintseries.sty:48 xinttools.sty:139 \fi % grep -o "^}%" xint*sty | wc -l -\def\totalb{ 1597} +\def\totalb{ 1647} \DeleteShortVerb{\|} \def\mymacro #1{\mymacroaux #1} \def\mymacroaux #1#2{\strut \csname #1nameimp\endcsname:& \dtt{ #2.}\tabularnewline } @@ -36029,7 +36370,7 @@ xinttools.sty:139 Right bracket \] Circumflex \^ Underscore \_ Grave accent \` Left brace \{ Vertical bar \| Right brace \} Tilde \~} -\CheckSum {30988}% 30982 pour 1.2p +\CheckSum {30621}% 30988 pour 1.2q, 30982 pour 1.2p % 30524 pour 1.2o, 30303 pour 1.2h, 30403 pour 1.2i, 30750 pour 1.2j, % 30677 pour 1.2k, 30931 pour 1.2l, 30439 pour 1.2m, 30253 pour 1.2n \makeatletter\check@checksum\makeatother diff --git a/Master/texmf-dist/source/generic/xint/xint.ins b/Master/texmf-dist/source/generic/xint/xint.ins index 9f7caf643f9..98288e16bb7 100644 --- a/Master/texmf-dist/source/generic/xint/xint.ins +++ b/Master/texmf-dist/source/generic/xint/xint.ins @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2q 2018/02/06 +%% The xint bundle 1.3 2018/03/01 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% --------------------------------------------------------------- %% diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty index 9e898833096..4cebabc2f3f 100644 --- a/Master/texmf-dist/tex/generic/xint/xint.sty +++ b/Master/texmf-dist/tex/generic/xint/xint.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2q 2018/02/06 +%% The xint bundle 1.3 2018/03/01 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xint: Expandable operations on big integers %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty (loaded by xintcore.sty) \XINT_providespackage \ProvidesPackage{xint}% - [2018/02/06 1.2q Expandable operations on big integers (JFB)]% + [2018/03/01 1.3 Expandable operations on big integers (JFB)]% \long\def\xint_firstofthree #1#2#3{#1}% \long\def\xint_secondofthree #1#2#3{#2}% \long\def\xint_thirdofthree #1#2#3{#3}% @@ -335,13 +335,8 @@ {\romannumeral0\XINT_num {#1}}% }% \def\XINT_dsx_end #1#2{\expandafter{#2}{#1}}% -\def\xintEq {\romannumeral0\XINT_signaldeprecated{xint}{xintEq}\xinteq }% -\def\xinteq #1#2{\xintifeq{#1}{#2}{1}{0}}% \def\xintiiEq #1#2{\romannumeral0\xintiiifeq{#1}{#2}{1}{0}}% -\def\xintNeq #1#2{\romannumeral0\XINT_signaldeprecated{xint}{xintNeq}\xintifeq {#1}{#2}{0}{1}}% \def\xintiiNotEq #1#2{\romannumeral0\xintiiifeq {#1}{#2}{0}{1}}% -\def\xintGeq {\romannumeral0\XINT_signaldeprecated{xint}{xintGeq}\xintgeq }% -\def\xintgeq #1{\expandafter\XINT_geq\romannumeral0\xintnum{#1}\xint:}% \def\xintiiGeq {\romannumeral0\xintiigeq }% \def\xintiigeq #1{\expandafter\XINT_iigeq\romannumeral`&&@#1\xint:}% \def\XINT_iigeq #1#2\xint:#3% @@ -378,30 +373,17 @@ \else\expandafter\XINT_geq_yes\fi}% \def\XINT_geq_no 1{ 0}% \def\XINT_geq_yes { 1}% -\def\xintGt {\romannumeral0\XINT_signaldeprecated{xint}{xintGt}\xintgt }% -\def\xintgt #1#2{\xintifgt{#1}{#2}{1}{0}}% \def\xintiiGt #1#2{\romannumeral0\xintiiifgt{#1}{#2}{1}{0}}% -\def\xintLt {\romannumeral0\XINT_signaldeprecated{xint}{xintLt}\xintlt }% -\def\xintlt #1#2{\xintiflt{#1}{#2}{1}{0}}% \def\xintiiLt #1#2{\romannumeral0\xintiiiflt{#1}{#2}{1}{0}}% -\def\xintGtorEq #1#2{\romannumeral0\XINT_signaldeprecated{xint}{xintGtorEq}\xintiflt {#1}{#2}{0}{1}}% \def\xintiiGtorEq #1#2{\romannumeral0\xintiiiflt {#1}{#2}{0}{1}}% -\def\xintLtorEq #1#2{\romannumeral0\XINT_signaldeprecated{xint}{xintLtorEq}\xintifgt {#1}{#2}{0}{1}}% \def\xintiiLtorEq #1#2{\romannumeral0\xintiiifgt {#1}{#2}{0}{1}}% -\def\xintIsZero {\romannumeral0\XINT_signaldeprecated{xint}{xintIsZero}\xintiszero }% -\def\xintiszero #1{\if0\xintSgn{#1}\xint_afterfi{ 1}\else\xint_afterfi{ 0}\fi}% \def\xintiiIsZero {\romannumeral0\xintiiiszero }% \def\xintiiiszero #1{\if0\xintiiSgn{#1}\xint_afterfi{ 1}\else\xint_afterfi{ 0}\fi}% -\def\xintIsNotZero {\romannumeral0\XINT_signaldeprecated{xint}{xintIsNotZero}\xintisnotzero }% -\def\xintisnotzero - #1{\if0\xintSgn{#1}\xint_afterfi{ 0}\else\xint_afterfi{ 1}\fi}% \def\xintiiIsNotZero {\romannumeral0\xintiiisnotzero }% \def\xintiiisnotzero #1{\if0\xintiiSgn{#1}\xint_afterfi{ 0}\else\xint_afterfi{ 1}\fi}% \def\xintiiIsOne {\romannumeral0\xintiiisone }% \def\xintiiisone #1{\expandafter\XINT_isone\romannumeral`&&@#1XY}% -\def\xintIsOne {\romannumeral0\XINT_signaldeprecated{xint}{xintIsOne}\xintisone }% -\def\xintisone #1{\expandafter\XINT_isone\romannumeral0\xintnum{#1}XY}% \def\XINT_isone #1#2#3Y% {% \unless\if#2X\xint_dothis{ 0}\fi @@ -424,15 +406,6 @@ \xint_afterfi{ 0}% \fi }% -\def\xintOdd {\romannumeral0\XINT_signaldeprecated{xint}{xintOdd}\xintodd }% -\def\xintodd #1% -{% - \ifodd\xintLDg{\xintNum{#1}} %<- intentional space - \xint_afterfi{ 1}% - \else - \xint_afterfi{ 0}% - \fi -}% \def\xintiiEven {\romannumeral0\xintiieven }% \def\xintiieven #1% {% @@ -442,15 +415,6 @@ \xint_afterfi{ 1}% \fi }% -\def\xintEven {\romannumeral0\XINT_signaldeprecated{xint}{xintEven}\xinteven }% -\def\xinteven #1% -{% - \ifodd\xintLDg{\xintNum{#1}} %<- intentional space - \xint_afterfi{ 0}% - \else - \xint_afterfi{ 1}% - \fi -}% \def\xintiiMON {\romannumeral0\xintiimon }% \def\xintiimon #1% {% @@ -460,15 +424,6 @@ \xint_afterfi{ 1}% \fi }% -\def\xintMON {\romannumeral0\XINT_signaldeprecated{xint}{xintMON}\xintmon }% -\def\xintmon #1% -{% - \ifodd\xintLDg{\xintNum{#1}} %<- intentional space - \xint_afterfi{ -1}% - \else - \xint_afterfi{ 1}% - \fi -}% \def\xintiiMMON {\romannumeral0\xintiimmon }% \def\xintiimmon #1% {% @@ -478,15 +433,6 @@ \xint_afterfi{ -1}% \fi }% -\def\xintMMON {\romannumeral0\XINT_signaldeprecated{xint}{xintMMON}\xintmmon }% -\def\xintmmon #1% -{% - \ifodd\xintLDg{\xintNum{#1}} %<- intentional space - \xint_afterfi{ 1}% - \else - \xint_afterfi{ -1}% - \fi -}% \def\xintSgnFork {\romannumeral0\xintsgnfork }% \def\xintsgnfork #1% {% @@ -495,15 +441,6 @@ \else\expandafter\xint_firstofthree_thenstop \fi }% -\def\xintifSgn {\romannumeral0\XINT_signaldeprecated{xint}{xintifSgn}\xintifsgn }% -\def\xintifsgn #1% -{% - \ifcase \xintSgn{#1} - \expandafter\xint_secondofthree_thenstop - \or\expandafter\xint_thirdofthree_thenstop - \else\expandafter\xint_firstofthree_thenstop - \fi -}% \def\xintiiifSgn {\romannumeral0\xintiiifsgn }% \def\xintiiifsgn #1% {% @@ -513,15 +450,6 @@ \else\expandafter\xint_firstofthree_thenstop \fi }% -\def\xintifCmp {\romannumeral0\XINT_signaldeprecated{xint}{xintifCmp}\xintifcmp }% -\def\xintifcmp #1#2% -{% - \ifcase\xintCmp {#1}{#2} - \expandafter\xint_secondofthree_thenstop - \or\expandafter\xint_thirdofthree_thenstop - \else\expandafter\xint_firstofthree_thenstop - \fi -}% \def\xintiiifCmp {\romannumeral0\xintiiifcmp }% \def\xintiiifcmp #1#2% {% @@ -531,14 +459,6 @@ \else\expandafter\xint_firstofthree_thenstop \fi }% -\def\xintifEq {\romannumeral0\XINT_signaldeprecated{xint}{xintifEq}\xintifeq }% -\def\xintifeq #1#2% -{% - \if0\xintCmp{#1}{#2}% - \expandafter\xint_firstoftwo_thenstop - \else\expandafter\xint_secondoftwo_thenstop - \fi -}% \def\xintiiifEq {\romannumeral0\xintiiifeq }% \def\xintiiifeq #1#2% {% @@ -547,14 +467,6 @@ \else\expandafter\xint_secondoftwo_thenstop \fi }% -\def\xintifGt {\romannumeral0\XINT_signaldeprecated{xint}{xintifGt}\xintifgt }% -\def\xintifgt #1#2% -{% - \if1\xintCmp{#1}{#2}% - \expandafter\xint_firstoftwo_thenstop - \else\expandafter\xint_secondoftwo_thenstop - \fi -}% \def\xintiiifGt {\romannumeral0\xintiiifgt }% \def\xintiiifgt #1#2% {% @@ -563,14 +475,6 @@ \else\expandafter\xint_secondoftwo_thenstop \fi }% -\def\xintifLt {\romannumeral0\XINT_signaldeprecated{xint}{xintifLt}\xintiflt }% -\def\xintiflt #1#2% -{% - \ifnum\xintCmp{#1}{#2}<\xint_c_ - \expandafter\xint_firstoftwo_thenstop - \else \expandafter\xint_secondoftwo_thenstop - \fi -}% \def\xintiiifLt {\romannumeral0\xintiiiflt }% \def\xintiiiflt #1#2% {% @@ -579,15 +483,6 @@ \else \expandafter\xint_secondoftwo_thenstop \fi }% -\def\xintifZero {\romannumeral0\XINT_signaldeprecated{xint}{xintifZero}\xintifzero }% -\def\xintifzero #1% -{% - \if0\xintSgn{#1}% - \expandafter\xint_firstoftwo_thenstop - \else - \expandafter\xint_secondoftwo_thenstop - \fi -}% \def\xintiiifZero {\romannumeral0\xintiiifzero }% \def\xintiiifzero #1% {% @@ -597,15 +492,6 @@ \expandafter\xint_secondoftwo_thenstop \fi }% -\def\xintifNotZero {\romannumeral0\XINT_signaldeprecated{xint}{xintifNotZero}\xintifnotzero }% -\def\xintifnotzero #1% -{% - \if0\xintSgn{#1}% - \expandafter\xint_secondoftwo_thenstop - \else - \expandafter\xint_firstoftwo_thenstop - \fi -}% \def\xintiiifNotZero {\romannumeral0\xintiiifnotzero }% \def\xintiiifnotzero #1% {% @@ -624,15 +510,6 @@ \expandafter\xint_secondoftwo_thenstop \fi }% -\def\xintifOne {\romannumeral0\XINT_signaldeprecated{xint}{xintifOne}\xintifone }% -\def\xintifone #1% -{% - \if1\xintIsOne{#1}% - \expandafter\xint_firstoftwo_thenstop - \else - \expandafter\xint_secondoftwo_thenstop - \fi -}% \def\xintiiifOdd {\romannumeral0\xintiiifodd }% \def\xintiiifodd #1% {% @@ -642,18 +519,8 @@ \expandafter\xint_secondoftwo_thenstop \fi }% -\def\xintifOdd {\romannumeral0\XINT_signaldeprecated{xint}{xintifOdd}\xintifodd }% -\def\xintifodd #1% -{% - \if\xintOdd{#1}1% - \expandafter\xint_firstoftwo_thenstop - \else - \expandafter\xint_secondoftwo_thenstop - \fi -}% \def\xintifTrueAelseB {\romannumeral0\xintiiifnotzero}% \def\xintifFalseAelseB{\romannumeral0\xintiiifzero}% -\def\xintNot{\romannumeral0\XINT_signaldeprecated{xint}{xintNot}\xintiiiszero}% \def\xintNOT{\romannumeral0\xintiiiszero}% \def\xintAND {\romannumeral0\xintand }% \def\xintand #1#2{\if0\xintiiSgn{#1}\expandafter\xint_firstoftwo @@ -696,15 +563,6 @@ {\XINT_xorof_a #2}% }% \def\XINT_xorof_e #1!#2{ #2}% -\def\xintiMax {\romannumeral0\XINT_signaldeprecated{xint}{xintiMax}\xintimax }% -\def\xintimax #1% -{% - \expandafter\xint_max\romannumeral0\xintnum{#1}\xint: -}% -\def\xint_max #1\xint:#2% -{% - \expandafter\XINT_max_fork\romannumeral0\xintnum{#2}\xint:#1\xint: -}% \def\xintiiMax {\romannumeral0\xintiimax }% \def\xintiimax #1% {% @@ -747,15 +605,6 @@ {% \unless\if1\romannumeral0\XINT_geq_plusplus{}{}% }% -\def\xintiMin {\romannumeral0\XINT_signaldeprecated{xint}{xintiMin}\xintimin }% -\def\xintimin #1% -{% - \expandafter\xint_min\romannumeral0\xintnum{#1}\xint: -}% -\def\xint_min #1\xint:#2% -{% - \expandafter\XINT_min_fork\romannumeral0\xintnum{#2}\xint:#1\xint: -}% \def\xintiiMin {\romannumeral0\xintiimin }% \def\xintiimin #1% {% @@ -798,17 +647,6 @@ {% \unless\if1\romannumeral0\XINT_geq_plusplus{}{}% }% -\def\xintiMaxof {\romannumeral0\XINT_signaldeprecated{xint}{xintiMaxof}\xintimaxof }% -\def\xintimaxof #1{\expandafter\XINT_imaxof_a\romannumeral`&&@#1\xint:}% -\def\XINT_imaxof_a -#1{\expandafter\XINT_imaxof_b\romannumeral0\xintnum{#1}!}% -\def\XINT_imaxof_b #1!#2% - {\expandafter\XINT_imaxof_c\romannumeral`&&@#2!{#1}!}% -\def\XINT_imaxof_c #1% - {\xint_gob_til_xint: #1\XINT_imaxof_e\xint:\XINT_imaxof_d #1}% -\def\XINT_imaxof_d #1!% - {\expandafter\XINT_imaxof_b\romannumeral0\xintimax {#1}}% -\def\XINT_imaxof_e #1!#2!{ #2}% \def\xintiiMaxof {\romannumeral0\xintiimaxof }% \def\xintiimaxof #1{\expandafter\XINT_iimaxof_a\romannumeral`&&@#1\xint:}% \def\XINT_iimaxof_a #1{\expandafter\XINT_iimaxof_b\romannumeral`&&@#1!}% @@ -819,16 +657,6 @@ \def\XINT_iimaxof_d #1!% {\expandafter\XINT_iimaxof_b\romannumeral0\xintiimax {#1}}% \def\XINT_iimaxof_e #1!#2!{ #2}% -\def\xintiMinof {\romannumeral0\XINT_signaldeprecated{xint}{xintiMinof}\xintiminof }% -\def\xintiminof #1{\expandafter\XINT_iminof_a\romannumeral`&&@#1\xint:}% -\def\XINT_iminof_a #1{\expandafter\XINT_iminof_b\romannumeral0\xintnum{#1}!}% -\def\XINT_iminof_b #1!#2% - {\expandafter\XINT_iminof_c\romannumeral`&&@#2!{#1}!}% -\def\XINT_iminof_c #1% - {\xint_gob_til_xint: #1\XINT_iminof_e\xint:\XINT_iminof_d #1}% -\def\XINT_iminof_d #1!% - {\expandafter\XINT_iminof_b\romannumeral0\xintimin {#1}}% -\def\XINT_iminof_e #1!#2!{ #2}% \def\xintiiMinof {\romannumeral0\xintiiminof }% \def\xintiiminof #1{\expandafter\XINT_iiminof_a\romannumeral`&&@#1\xint:}% \def\XINT_iiminof_a #1{\expandafter\XINT_iiminof_b\romannumeral`&&@#1!}% @@ -860,9 +688,6 @@ {\expandafter\XINT_prod_loop_a\romannumeral0\XINT_mul_fork }% \def\XINT_prod_finished\xint:\XINT_prod_loop_c\xint:\xint:#1\xint:\Z { #1}% \def\xintiiSquareRoot {\romannumeral0\xintiisquareroot }% -\def\xintiSquareRoot{\romannumeral0\XINT_signaldeprecated{xint}{xintiSquareRoot}\xintisquareroot}% -\def\xintisquareroot #1% - {\expandafter\XINT_sqrt_checkin\romannumeral0\xintnum{#1}\xint:}% \def\xintiisquareroot #1{\expandafter\XINT_sqrt_checkin\romannumeral`&&@#1\xint:}% \def\XINT_sqrt_checkin #1% {% @@ -1152,10 +977,6 @@ \def\xintiisqrtr {\expandafter\XINT_sqrtr_post\romannumeral0\xintiisquareroot }% \def\XINT_sqrtr_post #1#2% {\xintiiifLt {#2}{#1}{ #1}{\XINT_dec #1\XINT_dec_bye234567890\xint_bye}}% -\def\xintiSqrt {\romannumeral0\XINT_signaldeprecated{xint}{xintiSqrt}\xintisqrt}% -\def\xintisqrt {\expandafter\XINT_sqrt_post\romannumeral0\xintisquareroot }% -\def\xintiSqrtR{\romannumeral0\XINT_signaldeprecated{xint}{xintiSqrtr}\xintisqrtr}% -\def\xintisqrtr {\expandafter\XINT_sqrtr_post\romannumeral0\xintisquareroot }% \def\xintiiBinomial {\romannumeral0\xintiibinomial }% \def\xintiibinomial #1#2% {% @@ -1165,8 +986,6 @@ {% \expandafter\XINT_binom_fork \the\numexpr#1-#2.#2.#1.% }% -\def\xintiBinomial{\romannumeral0\XINT_signaldeprecated{xint}{xintiBinomial}\xintibinomial}% -\let\xintibinomial\xintiibinomial \def\XINT_binom_fork #1#2.#3#4.#5#6.% {% \if-#5\xint_dothis{\XINT_signalcondition{InvalidOperation}{Binomial with @@ -1412,8 +1231,6 @@ {% \expandafter\XINT_pfac_fork\the\numexpr#1\expandafter.\the\numexpr #2.% }% -\def\xintiPFactorial{\romannumeral0\XINT_signaldeprecated{xint}{xintiPFactorial}\xintipfactorial}% -\let\xintipfactorial\xintiipfactorial \def\xintPFactorial{\romannumeral0\xintpfactorial}% \let\xintpfactorial\xintiipfactorial \def\XINT_pfac_fork #1#2.#3#4.% @@ -1596,7 +1413,7 @@ \XINT_ifFlagRaised{xintiSqrtR}{\string\xintiSqrtR\MessageBreak}{}% \XINT_ifFlagRaised{xintiBinomial}{\string\xintiBinomial\MessageBreak}{}% \XINT_ifFlagRaised{xintiPFactorial}{\string\xintiPFactorial\MessageBreak}{}% -They will get removed at some future release.}}% +This is not possible because they all got removed at 1.3!}}% {% no deprecated macro used (at top level...) }% }\fi\fi diff --git a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty index 9e495dc600e..1391e129f79 100644 --- a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty +++ b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2q 2018/02/06 +%% The xint bundle 1.3 2018/03/01 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintbinhex: Expandable binary and hexadecimal conversions %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintbinhex}% - [2018/02/06 1.2q Expandable binary and hexadecimal conversions (JFB)]% + [2018/03/01 1.3 Expandable binary and hexadecimal conversions (JFB)]% \newcount\xint_c_ii^xv \xint_c_ii^xv 32768 \newcount\xint_c_ii^xvi \xint_c_ii^xvi 65536 \def\XINT_tmpa #1{\ifx\relax#1\else diff --git a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty index 0c536b714b1..6eea46114c3 100644 --- a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty +++ b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2q 2018/02/06 +%% The xint bundle 1.3 2018/03/01 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintcfrac: Expandable continued fractions with xint package %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintcfrac}% - [2018/02/06 1.2q Expandable continued fractions with xint package (JFB)]% + [2018/03/01 1.3 Expandable continued fractions with xint package (JFB)]% \def\xintCFrac {\romannumeral0\xintcfrac }% \def\xintcfrac #1% {% diff --git a/Master/texmf-dist/tex/generic/xint/xintcore.sty b/Master/texmf-dist/tex/generic/xint/xintcore.sty index 9e1219f0ab2..d947fbc48fe 100644 --- a/Master/texmf-dist/tex/generic/xint/xintcore.sty +++ b/Master/texmf-dist/tex/generic/xint/xintcore.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2q 2018/02/06 +%% The xint bundle 1.3 2018/03/01 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintcore: Expandable arithmetic on big integers %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintcore}% - [2018/02/06 1.2q Expandable arithmetic on big integers (JFB)]% + [2018/03/01 1.3 Expandable arithmetic on big integers (JFB)]% \csname XINT_Clamped_istrapped\endcsname \csname XINT_ConversionSyntax_istrapped\endcsname \csname XINT_DivisionByZero_istrapped\endcsname @@ -183,11 +183,6 @@ {% \expandafter\XINT_sgn \romannumeral`&&@#1\xint: }% -\def\xintSgn {\romannumeral0\XINT_signaldeprecated{xintcore}{xintSgn}\xintsgn }% -\def\xintsgn #1% -{% - \expandafter\XINT_sgn \romannumeral0\xintnum{#1}\xint: -}% \def\XINT_sgn #1#2\xint: {% \xint_UDzerominusfork @@ -217,11 +212,6 @@ {% \expandafter\XINT_opp \romannumeral`&&@#1% }% -\def\xintiOpp {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiOpp}\xintiopp }% -\def\xintiopp #1% -{% - \expandafter\XINT_opp \romannumeral0\xintnum{#1}% -}% \def\XINT_Opp #1{\romannumeral0\XINT_opp #1}% \def\XINT_opp #1% {% @@ -236,11 +226,6 @@ {% \expandafter\XINT_abs \romannumeral`&&@#1% }% -\def\xintiAbs {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiAbs}\xintiabs }% -\def\xintiabs #1% -{% - \expandafter\XINT_abs \romannumeral0\xintnum{#1}% -}% \def\XINT_abs #1% {% \xint_UDsignfork @@ -250,8 +235,6 @@ }% \def\xintFDg {\romannumeral0\xintfdg }% \def\xintfdg #1{\expandafter\XINT_fdg \romannumeral`&&@#1\xint:\Z}% -\def\xintiiFDg {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiiFDg}\xintiifdg }% -\let\xintiifdg\xintfdg \def\XINT_FDg #1% {\romannumeral0\expandafter\XINT_fdg\romannumeral`&&@\xintnum{#1}\xint:\Z }% \def\XINT_fdg #1#2#3\Z @@ -265,8 +248,6 @@ \def\xintLDg {\romannumeral0\xintldg }% \def\xintldg #1{\expandafter\XINT_ldg_fork\romannumeral`&&@#1% \XINT_ldg_c{}{}{}{}{}{}{}{}\xint_bye\relax}% -\def\xintiiLDg {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiiLDg}\xintiildg }% -\let\xintiildg\xintldg \def\XINT_ldg_fork #1% {% \xint_UDsignfork @@ -571,8 +552,6 @@ {% \expandafter\XINT_cuz_small\xint_gob_til_sc #8#7#6#5#4#3#2#1% }% -\def\xintiAdd {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiAdd}\xintiadd }% -\def\xintiadd #1{\expandafter\XINT_iadd\romannumeral0\xintnum{#1}\xint:}% \def\xintiiAdd {\romannumeral0\xintiiadd }% \def\xintiiadd #1{\expandafter\XINT_iiadd\romannumeral`&&@#1\xint:}% \def\XINT_iiadd #1#2\xint:#3% @@ -726,8 +705,6 @@ \def\XINT_add_m #1!{\expandafter\XINT_add_n\the\numexpr\xint_c_i+#1\xint:}% \def\XINT_add_n #1#2\xint:{1#2\expandafter!\the\numexpr\XINT_add_o #1}% \def\XINT_add_o #1{\if #12\expandafter\XINT_add_l\else\expandafter\XINT_add_ke \fi}% -\def\xintCmp {\romannumeral0\XINT_signaldeprecated{xintcore}{xintCmp}\xintcmp }% -\def\xintcmp #1{\expandafter\XINT_icmp\romannumeral0\xintnum{#1}\xint:}% \def\xintiiCmp {\romannumeral0\xintiicmp }% \def\xintiicmp #1{\expandafter\XINT_iicmp\romannumeral`&&@#1\xint:}% \def\XINT_iicmp #1#2\xint:#3% @@ -837,8 +814,6 @@ \expandafter\XINT_sub_nfork\expandafter #1\romannumeral`&&@#3\xint:#2\xint: }% -\def\xintiSub {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiSub}\xintisub }% -\def\xintisub #1{\expandafter\XINT_isub\romannumeral0\xintnum{#1}\xint:}% \def\XINT_isub #1#2\xint:#3% {% \expandafter\XINT_sub_nfork\expandafter @@ -1035,15 +1010,6 @@ \the\numexpr \xint_c_xi_e_viii_mone-#1#2#3#4#5#6#7#8\XINT_sub_comp_loop }% \def\XINT_sub_comp_clean 1#1{+#1\relax}% -\def\xintiMul {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiMul}\xintimul }% -\def\xintimul #1% -{% - \expandafter\XINT_imul\romannumeral0\xintnum{#1}\xint: -}% -\def\XINT_imul #1#2\xint:#3% -{% - \expandafter\XINT_mul_nfork\expandafter #1\romannumeral0\xintnum{#3}\xint:#2\xint: -}% \def\xintiiMul {\romannumeral0\xintiimul }% \def\xintiimul #1% {% @@ -1211,10 +1177,6 @@ {% 1#6#7\expandafter!\the\numexpr \xint_c_x^viii+#1#2#3#4#5+#8!% }% -\def\xintiDivision {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiDivision}\xintidivision }% -\def\xintidivision #1{\expandafter\XINT_idivision\romannumeral0\xintnum{#1}\xint:}% -\def\XINT_idivision #1#2\xint:#3{\expandafter\XINT_iidivision_a\expandafter #1% - \romannumeral0\xintnum{#3}\xint:#2\xint:}% \def\xintiiDivision {\romannumeral0\xintiidivision }% \def\xintiidivision #1{\expandafter\XINT_iidivision \romannumeral`&&@#1\xint:}% \def\XINT_iidivision #1#2\xint:#3{\expandafter\XINT_iidivision_a\expandafter #1% @@ -1814,15 +1776,6 @@ {\expandafter\xint_firstoftwo_thenstop\romannumeral0\xintiidivision }% \def\xintiirem {\expandafter\xint_secondoftwo_thenstop\romannumeral0\xintiidivision }% -\def\xintiQuo {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiQuo}\xintiquo }% -\def\xintiRem {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiRem}\xintirem }% -\def\xintiquo - {\expandafter\xint_firstoftwo_thenstop\romannumeral0\xintidivision }% -\def\xintirem - {\expandafter\xint_secondoftwo_thenstop\romannumeral0\xintidivision }% -\def\xintiDivRound {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiDivRound}\xintidivround }% -\def\xintidivround #1% - {\expandafter\XINT_idivround\romannumeral0\xintnum{#1}\xint:}% \def\xintiiDivRound {\romannumeral0\xintiidivround }% \def\xintiidivround #1{\expandafter\XINT_iidivround\romannumeral`&&@#1\xint:}% \def\XINT_idivround #1#2\xint:#3% @@ -1861,8 +1814,6 @@ \romannumeral0\XINT_div_prepare {#2}{#1#30}% \xint_bye\xint_Bye3456789\xint_bye/\xint_c_x\relax }% -\def\xintiDivTrunc {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiDivTrunc}\xintidivtrunc }% -\def\xintidivtrunc #1{\expandafter\XINT_iidivtrunc\romannumeral0\xintnum{#1}\xint:}% \def\xintiiDivTrunc {\romannumeral0\xintiidivtrunc }% \def\xintiidivtrunc #1{\expandafter\XINT_iidivtrunc\romannumeral`&&@#1\xint:}% \def\XINT_iidivtrunc #1#2\xint:#3{\expandafter\XINT_iidivtrunc_a\expandafter #1% @@ -1893,8 +1844,6 @@ \def\XINT_iidivtrunc_pos #1#2\xint:#3\xint: {\expandafter\xint_firstoftwo_thenstop \romannumeral0\XINT_div_prepare {#2}{#1#3}}% -\def\xintiMod {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiMod}\xintimod }% -\def\xintimod #1{\expandafter\XINT_iimodtrunc\romannumeral0\xintnum{#1}\xint:}% \def\xintiiModTrunc {\romannumeral0\xintiimodtrunc }% \def\xintiimodtrunc #1{\expandafter\XINT_iimodtrunc\romannumeral`&&@#1\xint:}% \def\XINT_iimodtrunc #1#2\xint:#3{\expandafter\XINT_iimodtrunc_a\expandafter #1% @@ -1967,11 +1916,6 @@ {% \expandafter\XINT_sqr\romannumeral0\xintiiabs{#1}\xint: }% -\def\xintiSqr {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiSqr}\xintisqr }% -\def\xintisqr #1% -{% - \expandafter\XINT_sqr\romannumeral0\xintiabs{#1}\xint: -}% \def\XINT_sqr #1\xint: {% \expandafter\XINT_sqr_a @@ -2016,12 +1960,6 @@ \expandafter\xint_pow\the\numexpr #2\expandafter .\romannumeral`&&@#1\xint: }% -\def\xintiPow {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiPow}\xintipow }% -\def\xintipow #1#2% -{% - \expandafter\xint_pow\the\numexpr #2\expandafter - .\romannumeral0\xintnum{#1}\xint: -}% \def\xint_pow #1.#2%#3\xint: {% \xint_UDzerominusfork @@ -2155,8 +2093,6 @@ }% \def\xintiiFac {\romannumeral0\xintiifac }% \def\xintiifac #1{\expandafter\XINT_fac_fork\the\numexpr#1.}% -\def\xintiFac {\romannumeral0\XINT_signaldeprecated{xintcore}{xintiFac}\xintifac }% -\let\xintifac \xintiifac % redefined by xintfrac \def\XINT_fac_fork #1#2.% {% \xint_UDzerominusfork @@ -2292,7 +2228,7 @@ \XINT_ifFlagRaised{xintiSqr}{\string\xintiSqr\MessageBreak}{}% \XINT_ifFlagRaised{xintiPow}{\string\xintiPow\MessageBreak}{}% \XINT_ifFlagRaised{xintiFac}{\string\xintiFac\MessageBreak}{}% -They will get removed at some future release.}}% +This is not possible because they all got removed from xintcore at 1.3!}}% {% no deprecated macro used (at top level...) }% }\fi\fi diff --git a/Master/texmf-dist/tex/generic/xint/xintexpr.sty b/Master/texmf-dist/tex/generic/xint/xintexpr.sty index 7916b026cc8..979511d5410 100644 --- a/Master/texmf-dist/tex/generic/xint/xintexpr.sty +++ b/Master/texmf-dist/tex/generic/xint/xintexpr.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2q 2018/02/06 +%% The xint bundle 1.3 2018/03/01 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintexpr: Expandable expression parser %% --------------------------------------------------------------- @@ -81,7 +81,7 @@ \XINTsetupcatcodes% \XINT_providespackage \ProvidesPackage{xintexpr}% - [2018/02/06 1.2q Expandable expression parser (JFB)]% + [2018/03/01 1.3 Expandable expression parser (JFB)]% \catcode`! 11 \let\XINT_Cmp \xintiiCmp \def\xint_gob_til_! #1!{}% ! with catcode 11 @@ -202,6 +202,9 @@ \def\xintifboolexpr #1{\romannumeral0\xintifnotzero {\xinttheexpr #1\relax}}% \def\xintifboolfloatexpr #1{\romannumeral0\xintifnotzero {\xintthefloatexpr #1\relax}}% \def\xintifbooliiexpr #1{\romannumeral0\xintifnotzero {\xinttheiiexpr #1\relax}}% +\let\XINT:NEhook:two\empty +\let\XINT:NEhook:one\empty +\let\XINT:NEhook:csv\empty \def\XINT_::_end #1,#2{\xint_gobble_i #2}% \def\xintCSV::csv #1{\expandafter\XINT_csv::_a\romannumeral`&&@#1,^,}% \def\XINT_csv::_a {\XINT_csv::_b {}}% @@ -674,7 +677,7 @@ \expandafter\let\csname XINT_#1_op_a\endcsname \XINT_expr_getop \expandafter\def\csname XINT_#1_op_++)\endcsname ##1##2\relax {\expandafter\XINT_expr_foundend \expandafter - {\expandafter\.=+\csname .=\xintiCeil{\XINT_expr_unlock ##1}\endcsname }}% + {\expandafter\.=+\csname .=\XINT:NEhook:one\xintiCeil{\XINT_expr_unlock ##1}\endcsname }}% }% \catcode`. 12 \catcode`= 12 \catcode`+ 12 \catcode`& 12 @@ -684,7 +687,7 @@ \do {\expandafter\def\csname XINT_expr_itself_#1\endcsname {#1}}% \catcode`& 7 \expandafter\let\csname XINT_expr_precedence_***\endcsname \xint_c_viii -\def\XINT_expr_defbin_c #1#2#3#4#5#6#7#8% +\def\XINT_expr_defbin_c #1#2#3#4#5#6#7#8#9% {% \def #1##1% \XINT_expr_op_<op> ou flexpr ou iiexpr {% keep value, get next number and operator, then do until @@ -700,7 +703,7 @@ \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral`&&@% \csname XINT_#8_op_##3\endcsname {##4}}% \else \xint_afterfi {\expandafter ##2\expandafter ##3% - \csname .=#6{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname }% + \csname .=#9#6{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname }% \fi }% \let #7#5% }% @@ -713,7 +716,7 @@ \csname XINT_#1_op_-#4\expandafter\endcsname \csname xint_c_#3\expandafter\endcsname \csname #5\expandafter\endcsname - \csname XINT_expr_precedence_#2\endcsname {#1}% + \csname XINT_expr_precedence_#2\endcsname {#1}\XINT:NEhook:two }% \XINT_expr_defbin_b {expr} | {iii}{vi} {xintOR}% \XINT_expr_defbin_b {flexpr} | {iii}{vi} {xintOR}% @@ -742,9 +745,6 @@ \XINT_expr_defbin_b {expr} {!=} {v}{vi} {xintNotEq}% \XINT_expr_defbin_b {flexpr}{!=} {v}{vi} {xintNotEq}% \XINT_expr_defbin_b {iiexpr}{!=} {v}{vi} {xintiiNotEq}% -\XINT_expr_defbin_b {expr} {..} {iii}{vi} {xintSeq::csv}% -\XINT_expr_defbin_b {flexpr}{..} {iii}{vi} {xintSeq::csv}% -\XINT_expr_defbin_b {iiexpr}{..} {iii}{vi} {xintiiSeq::csv}% \XINT_expr_defbin_b {expr} {//} {vii}{vii}{xintDivFloor}% CHANGED IN 1.2p! \XINT_expr_defbin_b {flexpr}{//} {vii}{vii}{XINTinFloatDivFloor}% " \XINT_expr_defbin_b {iiexpr}{//} {vii}{vii}{xintiiDivFloor}% " @@ -769,9 +769,25 @@ \XINT_expr_defbin_b {expr} {..[}{iii}{vi} {xintSeqA::csv}% \XINT_expr_defbin_b {flexpr}{..[}{iii}{vi} {XINTinFloatSeqA::csv}% \XINT_expr_defbin_b {iiexpr}{..[}{iii}{vi} {xintiiSeqA::csv}% +\def\XINT_expr_defbin_b #1#2#3#4#5% +{% + \expandafter\XINT_expr_defbin_c + \csname XINT_#1_op_#2\expandafter\endcsname + \csname XINT_#1_until_#2_a\expandafter\endcsname + \csname XINT_#1_until_#2_b\expandafter\endcsname + \csname XINT_#1_op_-#4\expandafter\endcsname + \csname xint_c_#3\expandafter\endcsname + \csname #5\expandafter\endcsname + \csname XINT_expr_precedence_#2\endcsname {#1}{}% +}% +\XINT_expr_defbin_b {expr} {..} {iii}{vi} {xintSeq::csv}% +\XINT_expr_defbin_b {flexpr}{..} {iii}{vi} {xintSeq::csv}% +\XINT_expr_defbin_b {iiexpr}{..} {iii}{vi} {xintiiSeq::csv}% \XINT_expr_defbin_b {expr} {]..}{iii}{vi} {xintSeqB::csv}% \XINT_expr_defbin_b {flexpr}{]..}{iii}{vi} {XINTinFloatSeqB::csv}% \XINT_expr_defbin_b {iiexpr}{]..}{iii}{vi} {xintiiSeqB::csv}% +\def\XINT_expr_binop_inline#1% + {\XINT_expr_binop_inline_a{\expandafter\XINT:NEhook:two\expandafter#1}}% \def\XINT_expr_binop_inline_a {\expandafter\xint_gobble_i\romannumeral`&&@\XINT_expr_binop_inline_b }% \def\XINT_expr_binop_inline_b #1#2,{\XINT_expr_binop_inline_c #2,{#1}}% @@ -798,9 +814,8 @@ \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral`&&@% \csname XINT_#8_op_##3\endcsname {##4}}% \else \xint_afterfi {\expandafter ##2\expandafter ##3% - \csname .=\expandafter\XINT_expr_binop_inline_a\expandafter - {\expandafter\expandafter\expandafter#6\expandafter - \xint_exchangetwo_keepbraces\expandafter + \csname .=\expandafter\XINT_expr_binop_inline\expandafter + {\expandafter#6\expandafter\xint_exchangetwo_keepbraces\expandafter {\expandafter\XINT_expr_unlock\expandafter ##4\expandafter}\expandafter}% \romannumeral`&&@\XINT_expr_unlock ##1,^,\endcsname }% \fi }% @@ -842,7 +857,7 @@ \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral`&&@% \csname XINT_#7_op_##3\endcsname {##4}}% \else \xint_afterfi {\expandafter ##2\expandafter ##3% - \csname .=\expandafter\XINT_expr_binop_inline_a\expandafter + \csname .=\expandafter\XINT_expr_binop_inline\expandafter {\expandafter#5\expandafter {\expandafter\XINT_expr_unlock\expandafter ##1\expandafter}\expandafter}% \romannumeral`&&@\XINT_expr_unlock ##4,^,\endcsname }% @@ -970,7 +985,8 @@ \else \xint_afterfi {\expandafter ##2\expandafter ##3\csname - .=:\xintNum{\XINT_expr_unlock ##1};\xintNum{\XINT_expr_unlock ##4}% + .=:\XINT:NEhook:one\xintNum{\XINT_expr_unlock ##1};% + \XINT:NEhook:one\xintNum{\XINT_expr_unlock ##4}% \endcsname }% \fi @@ -990,7 +1006,7 @@ \def\XINT_expr_op_:] #1% {% \expandafter\xint_c_i\expandafter )% - \csname .=]\xintNum{\XINT_expr_unlock #1}\endcsname + \csname .=]\XINT:NEhook:one\xintNum{\XINT_expr_unlock #1}\endcsname }% \let\XINT_flexpr_op_:] \XINT_expr_op_:] \let\XINT_iiexpr_op_:] \XINT_expr_op_:] @@ -1335,7 +1351,8 @@ \csname XINT_#5_op_##2\endcsname {##3}}% \else \xint_afterfi {\expandafter ##1\expandafter ##2% - \csname .=#6{\XINT_expr_unlock ##3}\endcsname }% + \csname .=% + \XINT:NEhook:one#6{\XINT_expr_unlock ##3}\endcsname }% \fi }% }% @@ -1362,11 +1379,11 @@ }% \let\XINT_expr_precedence_! \xint_c_x \def\XINT_expr_op_! #1{\expandafter\XINT_expr_getop - \csname .=\xintFac{\XINT_expr_unlock #1}\endcsname }% + \csname .=\XINT:NEhook:one\xintFac{\XINT_expr_unlock #1}\endcsname }% \def\XINT_flexpr_op_! #1{\expandafter\XINT_expr_getop - \csname .=\XINTinFloatFac{\XINT_expr_unlock #1}\endcsname }% + \csname .=\XINT:NEhook:one\XINTinFloatFac{\XINT_expr_unlock #1}\endcsname }% \def\XINT_iiexpr_op_! #1{\expandafter\XINT_expr_getop - \csname .=\xintiiFac{\XINT_expr_unlock #1}\endcsname }% + \csname .=\XINT:NEhook:one\xintiiFac{\XINT_expr_unlock #1}\endcsname }% \catcode`[ 11 \catcode`* 11 \let\XINT_expr_precedence_[ \xint_c_vii @@ -1691,10 +1708,11 @@ \if ^#4\xint_dothis\XINT_expr_op:_end\fi \xint_orthat{\expandafter\XINT_expr_op:_c}\csname.=#4#5\endcsname {#3}#1{#2}% }% -\def\XINT_expr_op:_c #1#2#3#4{\expandafter\XINT_expr_op:_d\romannumeral0#2#1#3{#4}{#2}}% +\def\XINT_expr_op:_c #1#2#3#4% + {\expandafter\XINT_expr_op:_d\romannumeral0#2#1#3{#4}{#2}}% \def\XINT_expr_op:_d #1!#2#3#4#5% {\expandafter\XINT_expr_op:_b\expandafter #4\expandafter - {\romannumeral`&&@#4{\XINT_expr_unlock#1}{#5}}}% + {\romannumeral`&&@\XINT:NEhook:two#4{\XINT_expr_unlock#1}{#5}}}% \def\XINT_expr_op:_noop\csname.=,#1\endcsname #2#3#4{\XINT_expr_op:_b #3{#4}{#2}#1,}% \def\XINT_expr_op:_end \csname.=^\endcsname #1#2#3{#3}% \def\XINT_expr_onliteral_subs @@ -2030,376 +2048,519 @@ \expandafter\XINTinFloatdigits\romannumeral`&&@#1,^,{0[0]}}% \def\XINTinFloatPrd:csv #1{\expandafter\XINT_oncsv:_a\expandafter\XINTinfloatmul \expandafter\XINTinFloatdigits\romannumeral`&&@#1,^,{1[0]}}% -\def\XINT_expr_twoargs #1,#2,{{#1}{#2}}% -\def\XINT_expr_totwoargs #1#2{#1,#2}% -\def\XINT_expr_argandopt #1,#2,#3.#4#5% +\def\XINT:expr:one:and:opt #1,#2,#3!#4#5% {% \if\relax#3\relax\expandafter\xint_firstoftwo\else \expandafter\xint_secondoftwo\fi - {#4}{#5[\xintNum {#2}]}{#1}% + {#4}{#5[\xintNum{#2}]}{#1}% }% -\def\XINT_expr_oneortwo #1#2#3,#4,#5.% +\def\XINT:expr:one:or:two #1,#2,#3!#4#5% {% - \if\relax#5\relax\expandafter\xint_firstoftwo\else + \if\relax#3\relax\expandafter\xint_firstoftwo\else \expandafter\xint_secondoftwo\fi - {#1{0}}{#2{\xintNum {#4}}}{#3}% + {#4{0}}{#5{\xintNum{#2}}}{#1}% }% -\def\XINT_iiexpr_oneortwo #1#2,#3,#4.% +\def\XINT:iiexpr:one:or:two #1,#2,#3!#4% {% - \if\relax#4\relax\expandafter\xint_firstoftwo\else + \if\relax#3\relax\expandafter\xint_firstoftwo\else \expandafter\xint_secondoftwo\fi - {#1{0}}{#1{#3}}{#2}% + {#4{0}}{#4{#2}}{#1}% +}% +\def\XINT:expr:totwo #1#2{#1,#2}% +\def\XINT:expr:two:to:two #1,#2,!#3% +{% + \expandafter\XINT:expr:totwo\romannumeral`&&@% + #3{#1}{#2}% +}% +\def\XINT:expr:two:to:one #1,#2,!#3% +{% + #3{#1}{#2}% }% +\def\XINT:flexpr:two:to:one #1,#2,!#3% +{% + #3{#1}{#2}% +}% +\let\XINT:flexpr:two:to:two\XINT:flexpr:two:to:one \def\XINT_expr_func_num #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintNum {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintNum{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_num\XINT_expr_func_num \let\XINT_iiexpr_func_num\XINT_expr_func_num \def\XINT_expr_func_reduce #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintIrr {\XINT_expr_unlock #3}[0]\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintIrr{\XINT_expr_unlock #3}[0]\endcsname +}% \let\XINT_flexpr_func_reduce\XINT_expr_func_reduce +\def\XINT_expr_func_preduce #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintPIrr{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_preduce\XINT_expr_func_preduce \def\XINT_expr_func_abs #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintAbs {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintAbs{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_abs\XINT_expr_func_abs \def\XINT_iiexpr_func_abs #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiAbs {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiAbs{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_sgn #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintSgn {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintSgn{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_sgn\XINT_expr_func_sgn \def\XINT_iiexpr_func_sgn #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiSgn {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiSgn{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_frac #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintTFrac {\XINT_expr_unlock #3}\endcsname }% -\def\XINT_flexpr_func_frac #1#2#3{\expandafter #1\expandafter #2\csname - .=\XINTinFloatFracdigits {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintTFrac{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_flexpr_func_frac #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\XINTinFloatFracdigits{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_floor #1#2#3% - {\expandafter #1\expandafter #2\csname .=\xintFloor {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintFloor{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_floor\XINT_expr_func_floor \def\XINT_iiexpr_func_floor #1#2#3% {% - \expandafter #1\expandafter #2\csname.=\xintiFloor {\XINT_expr_unlock #3}\endcsname }% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiFloor{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_ceil #1#2#3% - {\expandafter #1\expandafter #2\csname .=\xintCeil {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintCeil{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_ceil\XINT_expr_func_ceil \def\XINT_iiexpr_func_ceil #1#2#3% {% - \expandafter #1\expandafter #2\csname.=\xintiCeil {\XINT_expr_unlock #3}\endcsname }% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiCeil{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_sqr #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintSqr {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintSqr{\XINT_expr_unlock #3}\endcsname +}% +\def\XINTinFloatSqr#1{\XINTinFloatMul{#1}{#1}}% revoir après \def\XINT_flexpr_func_sqr #1#2#3% {% - \expandafter #1\expandafter #2\csname - .=\XINTinFloatMul{\XINT_expr_unlock #3}{\XINT_expr_unlock #3}\endcsname + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\XINTinFloatSqr{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_iiexpr_func_sqr #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiSqr{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_expr_func_? #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiIsNotZero{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_? \XINT_expr_func_? +\let\XINT_iiexpr_func_? \XINT_expr_func_? +\def\XINT_expr_func_! #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiIsZero{\XINT_expr_unlock #3}\endcsname }% +\let\XINT_flexpr_func_! \XINT_expr_func_! +\let\XINT_iiexpr_func_! \XINT_expr_func_! +\def\XINT_expr_func_not #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiIsZero{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_not \XINT_expr_func_not +\let\XINT_iiexpr_func_not \XINT_expr_func_not +\def\XINT_expr_func_odd #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintOdd{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_odd\XINT_expr_func_odd +\def\XINT_iiexpr_func_odd #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiOdd{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_expr_func_even #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintEven{\XINT_expr_unlock #3}\endcsname +}% +\let\XINT_flexpr_func_even\XINT_expr_func_even +\def\XINT_iiexpr_func_even #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiEven{\XINT_expr_unlock #3}\endcsname +}% +\def\XINT_expr_func_nuple #1#2#3% + {\expandafter #1\expandafter #2\csname.=\XINT_expr_unlock #3\endcsname }% +\let\XINT_flexpr_func_nuple\XINT_expr_func_nuple +\let\XINT_iiexpr_func_nuple\XINT_expr_func_nuple \def\XINT_expr_func_factorial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_argandopt - \romannumeral`&&@\XINT_expr_unlock#3,,.\xintFac\XINTinFloatFac + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:one:and:opt + \romannumeral`&&@\XINT_expr_unlock#3,,!\xintFac\XINTinFloatFac \endcsname }% \def\XINT_flexpr_func_factorial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_argandopt - \romannumeral`&&@\XINT_expr_unlock#3,,.\XINTinFloatFacdigits\XINTinFloatFac + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:one:and:opt + \romannumeral`&&@\XINT_expr_unlock#3,,!\XINTinFloatFacdigits\XINTinFloatFac \endcsname }% \def\XINT_iiexpr_func_factorial #1#2#3% {% - \expandafter #1\expandafter #2\csname.=\xintiiFac{\XINT_expr_unlock #3}\endcsname + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiFac{\XINT_expr_unlock #3}\endcsname }% -\def\XINT_iiexpr_func_sqr #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiSqr {\XINT_expr_unlock #3}\endcsname }% \def\XINT_expr_func_sqrt #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_argandopt - \romannumeral`&&@\XINT_expr_unlock#3,,.\XINTinFloatSqrtdigits\XINTinFloatSqrt + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:one:and:opt + \romannumeral`&&@\XINT_expr_unlock#3,,!\XINTinFloatSqrtdigits\XINTinFloatSqrt \endcsname }% \let\XINT_flexpr_func_sqrt\XINT_expr_func_sqrt \def\XINT_iiexpr_func_sqrt #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiSqrt {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiSqrt{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_iiexpr_func_sqrtr #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiSqrtR {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:one\xintiiSqrtR{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_round #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_oneortwo - \expandafter\xintiRound\expandafter\xintRound - \romannumeral`&&@\XINT_expr_unlock #3,,.\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:one:or:two + \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiRound\xintRound + \endcsname }% \let\XINT_flexpr_func_round\XINT_expr_func_round \def\XINT_iiexpr_func_round #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_iiexpr_oneortwo\expandafter\xintiRound - \romannumeral`&&@\XINT_expr_unlock #3,,.\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:iiexpr:one:or:two + \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiRound + \endcsname }% \def\XINT_expr_func_trunc #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_oneortwo - \expandafter\xintiTrunc\expandafter\xintTrunc - \romannumeral`&&@\XINT_expr_unlock #3,,.\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:one:or:two + \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiTrunc\xintTrunc + \endcsname }% \let\XINT_flexpr_func_trunc\XINT_expr_func_trunc \def\XINT_iiexpr_func_trunc #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_iiexpr_oneortwo\expandafter\xintiTrunc - \romannumeral`&&@\XINT_expr_unlock #3,,.\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:iiexpr:one:or:two + \romannumeral`&&@\XINT_expr_unlock #3,,!\xintiTrunc + \endcsname }% \def\XINT_expr_func_float #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_argandopt - \romannumeral`&&@\XINT_expr_unlock #3,,.\XINTinFloatdigits\XINTinFloat + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:one:and:opt + \romannumeral`&&@\XINT_expr_unlock #3,,!\XINTinFloatdigits\XINTinFloat \endcsname }% \let\XINT_flexpr_func_float\XINT_expr_func_float \def\XINT_expr_func_divmod #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_totwoargs - \romannumeral0\expandafter\xintdivmod - \romannumeral`&&@\expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:two + \romannumeral`&&@\XINT_expr_unlock #3,!\xintDivMod + \endcsname }% \def\XINT_flexpr_func_divmod #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINTinFloatDivMod - \romannumeral`&&@\expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:flexpr:two:to:two + \romannumeral`&&@\XINT_expr_unlock #3,!\XINTinFloatDivMod + \endcsname }% \def\XINT_iiexpr_func_divmod #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINT_expr_totwoargs - \romannumeral0\expandafter\xintiidivmod - \romannumeral`&&@\expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:two + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiDivMod + \endcsname }% \def\XINT_expr_func_mod #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintMod - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintMod + \endcsname }% \def\XINT_flexpr_func_mod #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\XINTinFloatMod - \romannumeral`&&@\expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:flexpr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\XINTinFloatMod + \endcsname }% \def\XINT_iiexpr_func_mod #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiiMod - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiMod + \endcsname }% \def\XINT_expr_func_binomial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintBinomial - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintBinomial + \endcsname }% \def\XINT_flexpr_func_binomial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\XINTinFloatBinomial - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:flexpr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\XINTinFloatBinomial + \endcsname }% \def\XINT_iiexpr_func_binomial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiiBinomial - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiBinomial + \endcsname }% \def\XINT_expr_func_pfactorial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintPFactorial - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintPFactorial + \endcsname }% \def\XINT_flexpr_func_pfactorial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\XINTinFloatPFactorial - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:flexpr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\XINTinFloatPFactorial + \endcsname }% \def\XINT_iiexpr_func_pfactorial #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiiPFactorial - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiPFactorial + \endcsname }% \def\XINT_expr_func_quo #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiQuo - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiQuo + \endcsname }% \let\XINT_flexpr_func_quo\XINT_expr_func_quo \def\XINT_iiexpr_func_quo #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiiQuo - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiQuo + \endcsname }% \def\XINT_expr_func_rem #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiRem - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiRem + \endcsname }% \let\XINT_flexpr_func_rem\XINT_expr_func_rem \def\XINT_iiexpr_func_rem #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiiRem - \expandafter\XINT_expr_twoargs - \romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname.=% + \expandafter\XINT:expr:two:to:one + \romannumeral`&&@\XINT_expr_unlock #3,!\xintiiRem + \endcsname }% \def\XINT_expr_func_gcd #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintGCDof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintGCDof:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_gcd\XINT_expr_func_gcd \def\XINT_iiexpr_func_gcd #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintiiGCDof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintiiGCDof:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_lcm #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintLCMof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintLCMof:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_lcm\XINT_expr_func_lcm \def\XINT_iiexpr_func_lcm #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintiiLCMof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintiiLCMof:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_max #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintMaxof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintMaxof:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_iiexpr_func_max #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintiiMaxof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintiiMaxof:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_flexpr_func_max #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\XINTinFloatMaxof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\XINTinFloatMaxof:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_min #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintMinof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintMinof:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_iiexpr_func_min #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintiiMinof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintiiMinof:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_flexpr_func_min #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\XINTinFloatMinof:csv{\XINT_expr_unlock #3}\endcsname }% -\expandafter\def\csname XINT_expr_func_+\endcsname #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintSum:csv{\XINT_expr_unlock #3}\endcsname }% -\expandafter\def\csname XINT_flexpr_func_+\endcsname #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\XINTinFloatSum:csv{\XINT_expr_unlock #3}\endcsname }% -\expandafter\def\csname XINT_iiexpr_func_+\endcsname #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintiiSum:csv{\XINT_expr_unlock #3}\endcsname }% -\expandafter\def\csname XINT_expr_func_*\endcsname #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintPrd:csv{\XINT_expr_unlock #3}\endcsname }% -\expandafter\def\csname XINT_flexpr_func_*\endcsname #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\XINTinFloatPrd:csv{\XINT_expr_unlock #3}\endcsname }% -\expandafter\def\csname XINT_iiexpr_func_*\endcsname #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintiiPrd:csv{\XINT_expr_unlock #3}\endcsname }% -\def\XINT_expr_func_? #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintiiIsNotZero {\XINT_expr_unlock #3}\endcsname }% -\let\XINT_flexpr_func_? \XINT_expr_func_? -\let\XINT_iiexpr_func_? \XINT_expr_func_? -\def\XINT_expr_func_! #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiIsZero {\XINT_expr_unlock #3}\endcsname }% -\let\XINT_flexpr_func_! \XINT_expr_func_! -\let\XINT_iiexpr_func_! \XINT_expr_func_! -\def\XINT_expr_func_not #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiIsZero {\XINT_expr_unlock #3}\endcsname }% -\let\XINT_flexpr_func_not \XINT_expr_func_not -\let\XINT_iiexpr_func_not \XINT_expr_func_not +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\XINTinFloatMinof:csv{\XINT_expr_unlock #3}\endcsname +}% +\expandafter +\def\csname XINT_expr_func_+\endcsname #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintSum:csv{\XINT_expr_unlock #3}\endcsname +}% +\expandafter +\def\csname XINT_flexpr_func_+\endcsname #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\XINTinFloatSum:csv{\XINT_expr_unlock #3}\endcsname +}% +\expandafter +\def\csname XINT_iiexpr_func_+\endcsname #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintiiSum:csv{\XINT_expr_unlock #3}\endcsname +}% +\expandafter +\def\csname XINT_expr_func_*\endcsname #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintPrd:csv{\XINT_expr_unlock #3}\endcsname +}% +\expandafter +\def\csname XINT_flexpr_func_*\endcsname #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\XINTinFloatPrd:csv{\XINT_expr_unlock #3}\endcsname +}% +\expandafter +\def\csname XINT_iiexpr_func_*\endcsname #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintiiPrd:csv{\XINT_expr_unlock #3}\endcsname +}% \def\XINT_expr_func_all #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintANDof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintANDof:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_all\XINT_expr_func_all \let\XINT_iiexpr_func_all\XINT_expr_func_all \def\XINT_expr_func_any #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintORof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintORof:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_any\XINT_expr_func_any \let\XINT_iiexpr_func_any\XINT_expr_func_any \def\XINT_expr_func_xor #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\xintXORof:csv{\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintXORof:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_xor\XINT_expr_func_xor \let\XINT_iiexpr_func_xor\XINT_expr_func_xor -\def\xintifNotZero: #1,#2,#3,{\xintiiifNotZero{#1}{#2}{#3}}% -\def\XINT_expr_func_if #1#2#3% - {\expandafter #1\expandafter #2\csname - .=\expandafter\xintifNotZero:\romannumeral`&&@\XINT_expr_unlock #3,\endcsname }% -\let\XINT_flexpr_func_if\XINT_expr_func_if -\let\XINT_iiexpr_func_if\XINT_expr_func_if -\def\xintifSgn: #1,#2,#3,#4,{\xintiiifSgn{#1}{#2}{#3}{#4}}% -\def\XINT_expr_func_ifsgn #1#2#3% +\def\XINT_expr_func_len #1#2#3% {% - \expandafter #1\expandafter #2\csname - .=\expandafter\xintifSgn:\romannumeral`&&@\XINT_expr_unlock #3,\endcsname + \expandafter#1\expandafter#2\csname.=% + \XINT:NEhook:csv\xintLength:f:csv{\XINT_expr_unlock#3}\endcsname }% -\let\XINT_flexpr_func_ifsgn\XINT_expr_func_ifsgn -\let\XINT_iiexpr_func_ifsgn\XINT_expr_func_ifsgn -\def\XINT_expr_func_len #1#2#3% - {\expandafter#1\expandafter#2% - \csname.=\xintLength:f:csv {\XINT_expr_unlock#3}\endcsname }% \let\XINT_flexpr_func_len \XINT_expr_func_len \let\XINT_iiexpr_func_len \XINT_expr_func_len \def\XINT_expr_func_first #1#2#3% - {\expandafter #1\expandafter #2\csname.=% - \xintFirstItem:f:csv{\XINT_expr_unlock #3}\endcsname}% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintFirstItem:f:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_first\XINT_expr_func_first \let\XINT_iiexpr_func_first\XINT_expr_func_first \def\XINT_expr_func_last #1#2#3% - {\expandafter #1\expandafter #2\csname.=% - \xintLastItem:f:csv{\XINT_expr_unlock #3}\endcsname}% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintLastItem:f:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_last\XINT_expr_func_last \let\XINT_iiexpr_func_last\XINT_expr_func_last -\def\XINT_expr_func_odd #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintOdd{\XINT_expr_unlock #3}\endcsname}% -\let\XINT_flexpr_func_odd\XINT_expr_func_odd -\def\XINT_iiexpr_func_odd #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiOdd{\XINT_expr_unlock #3}\endcsname}% -\def\XINT_expr_func_even #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintEven{\XINT_expr_unlock #3}\endcsname}% -\let\XINT_flexpr_func_even\XINT_expr_func_even -\def\XINT_iiexpr_func_even #1#2#3% - {\expandafter #1\expandafter #2\csname.=\xintiiEven{\XINT_expr_unlock #3}\endcsname}% -\def\XINT_expr_func_nuple #1#2#3% - {\expandafter #1\expandafter #2\csname .=\XINT_expr_unlock #3\endcsname }% -\let\XINT_flexpr_func_nuple\XINT_expr_func_nuple -\let\XINT_iiexpr_func_nuple\XINT_expr_func_nuple \def\XINT_expr_func_reversed #1#2#3% - {\expandafter #1\expandafter #2\csname .=% - \xintReverse:f:csv {\XINT_expr_unlock #3}\endcsname }% +{% + \expandafter #1\expandafter #2\csname.=% + \XINT:NEhook:csv\xintReverse:f:csv{\XINT_expr_unlock #3}\endcsname +}% \let\XINT_flexpr_func_reversed\XINT_expr_func_reversed \let\XINT_iiexpr_func_reversed\XINT_expr_func_reversed +\def\xintifNotZero: #1,#2,#3,{\xintiiifNotZero{#1}{#2}{#3}}% +\def\XINT_expr_func_if #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \expandafter\xintifNotZero:% + \romannumeral`&&@\XINT_expr_unlock #3,\endcsname +}% +\let\XINT_flexpr_func_if\XINT_expr_func_if +\let\XINT_iiexpr_func_if\XINT_expr_func_if +\def\xintifSgn: #1,#2,#3,#4,{\xintiiifSgn{#1}{#2}{#3}{#4}}% +\def\XINT_expr_func_ifsgn #1#2#3% +{% + \expandafter #1\expandafter #2\csname.=% + \expandafter\xintifSgn:% + \romannumeral`&&@\XINT_expr_unlock #3,\endcsname +}% +\let\XINT_flexpr_func_ifsgn\XINT_expr_func_ifsgn +\let\XINT_iiexpr_func_ifsgn\XINT_expr_func_ifsgn \def\xintSeqB:f:csv #1#2% {\expandafter\XINT_seqb:f:csv \expandafter{\romannumeral0\xintraw{#2}}{#1}}% \def\XINT_seqb:f:csv #1#2{\expandafter\XINT_seqb:f:csv_a\romannumeral`&&@#2#1!}% @@ -2486,6 +2647,7 @@ \XINT_seqb:f:csv_nc\XINT_seqb:f:csv_nb\XINT_flseqb:f:csv_na {#1}{#2}% }% \catcode`: 12 +\catcode`~ 12 \def\XINT_tmpa #1#2#3#4% {% \def #1##1(##2)##3=##4;{% @@ -2498,11 +2660,11 @@ \edef\XINT_expr_tmpc {subs(\unexpanded\expandafter{\XINT_expr_tmpc},% ####1=################\XINT_expr_tmpb)}% }% - \expandafter#3\csname XINT_#2_userfunc_\XINT_expr_tmpa\endcsname - [\XINT_expr_tmpb]{\XINT_expr_tmpc}% \expandafter\XINT_expr_defuserfunc \csname XINT_#2_func_\XINT_expr_tmpa\expandafter\endcsname - \csname XINT_#2_userfunc_\XINT_expr_tmpa\endcsname + \expandafter{\XINT_expr_tmpa}{#2}% + \expandafter#3\csname XINT_#2_userfunc_\XINT_expr_tmpa\endcsname + [\XINT_expr_tmpb]{\XINT_expr_tmpc}% \ifxintverbose\xintMessage {xintexpr}{Info} {Function \XINT_expr_tmpa\space for \string\xint #4 parser associated to \string\XINT_#2_userfunc_\XINT_expr_tmpa\space @@ -2515,11 +2677,17 @@ \XINT_tmpa\xintdeffunc {expr} \XINT_NewFunc {expr}% \XINT_tmpa\xintdefiifunc {iiexpr}\XINT_NewIIFunc {iiexpr}% \XINT_tmpa\xintdeffloatfunc{flexpr}\XINT_NewFloatFunc{floatexpr}% -\def\XINT_expr_defuserfunc #1#2{% +\def\XINT_expr_defuserfunc #1#2#3% +{% \def #1##1##2##3{\expandafter ##1\expandafter ##2% - \csname .=\expandafter #2\romannumeral`&&@\XINT_expr_unlock ##3,\endcsname + \csname .=\XINT:expr:userfunc{#3}{#2}{\XINT_expr_unlock ##3}\endcsname }% }% +\def\XINT:expr:userfunc #1#2#3% + {\csname XINT_#1_userfunc_#2\expandafter\endcsname + \romannumeral0\xintcsvtolistnonstripped{#3}}% +\def\XINT:newexpr:userfunc #1#2#3% + {~csname XINT_#1_userfunc_#2~endcsname\xintCSVtoListNonStripped{#3}}% \def\XINT_expr_wrapit #1{\expandafter\XINT_expr_wrap\csname.=#1\endcsname}% \def\xintNewFunction #1#2[#3]#4% {% @@ -2528,16 +2696,16 @@ \def\XINT_expr_tmpb ##1##2##3##4##5##6##7##8##9{#4}% \begingroup \ifcase #3\relax - \toks0{,}% - \or \toks0{##1,}% - \or \toks0{##1,##2,}% - \or \toks0{##1,##2,##3,}% - \or \toks0{##1,##2,##3,##4,}% - \or \toks0{##1,##2,##3,##4,##5,}% - \or \toks0{##1,##2,##3,##4,##5,##6,}% - \or \toks0{##1,##2,##3,##4,##5,##6,##7,}% - \or \toks0{##1,##2,##3,##4,##5,##6,##7,##8,}% - \else \toks0{##1,##2,##3,##4,##5,##6,##7,##8,##9,}% + \toks0{}% + \or \toks0{##1}% + \or \toks0{##1##2}% + \or \toks0{##1##2##3}% + \or \toks0{##1##2##3##4}% + \or \toks0{##1##2##3##4##5}% + \or \toks0{##1##2##3##4##5##6}% + \or \toks0{##1##2##3##4##5##6##7}% + \or \toks0{##1##2##3##4##5##6##7##8}% + \else \toks0{##1##2##3##4##5##6##7##8##9}% \fi \expandafter \endgroup @@ -2549,13 +2717,13 @@ {\XINT_expr_wrapit{##7}}{\XINT_expr_wrapit{##8}}{\XINT_expr_wrapit{##9}}}% \expandafter\XINT_expr_newfunction \csname XINT_expr_func_\XINT_expr_tmpa\expandafter\endcsname - \csname XINT_expr_macrofunc_\XINT_expr_tmpa\endcsname\xintbareeval + \expandafter{\XINT_expr_tmpa}{eval}\xintbareeval \expandafter\XINT_expr_newfunction \csname XINT_iiexpr_func_\XINT_expr_tmpa\expandafter\endcsname - \csname XINT_expr_macrofunc_\XINT_expr_tmpa\endcsname\xintbareiieval + \expandafter{\XINT_expr_tmpa}{iieval}\xintbareiieval \expandafter\XINT_expr_newfunction \csname XINT_flexpr_func_\XINT_expr_tmpa\expandafter\endcsname - \csname XINT_expr_macrofunc_\XINT_expr_tmpa\endcsname\xintbarefloateval + \expandafter{\XINT_expr_tmpa}{floateval}\xintbarefloateval \ifxintverbose \xintMessage {xintexpr}{Info} {Function \XINT_expr_tmpa\space for the expression parsers is @@ -2564,10 +2732,27 @@ \csname XINT_expr_macrofunc_\XINT_expr_tmpa\endcsname}% \fi }% -\def\XINT_expr_newfunction #1#2#3% +\def\XINT_expr_newfunction #1#2#3#4% +{% + \def#1##1##2##3{\expandafter ##1\expandafter ##2\romannumeral0% + \XINT:expr:macrofunc{#4}{#3}{#2}{\XINT_expr_unlock##3}}% +}% +\def\XINT:expr:macrofunc #1#2#3#4% +{% + #1\csname XINT_expr_macrofunc_#3\expandafter\endcsname + \romannumeral0\xintcsvtolistnonstripped{#4}\relax +}% +\def\XINT:newexpr:macrofunc #1{% +\def\XINT:newexpr:macrofunc ##1##2##3##4% {% - \def#1##1##2##3{\expandafter ##1\expandafter ##2\romannumeral`&&@% - #3\expandafter#2\romannumeral`&&@\XINT_expr_unlock##3,\relax}% + \expandafter#1\csname.=~XINT:newexpr:macrofunc:a{##2}{##3}% + {\xintCSVtoListNonStripped{##4}}\endcsname +}% +}\XINT:newexpr:macrofunc { }% +\def\XINT:newexpr:macrofunc:a #1#2#3% +{% + \expandafter\XINT_expr_unlock\romannumeral0\csname xintbare#1\endcsname + \csname XINT_expr_macrofunc_#2\endcsname#3\relax }% \def\xintApply::csv #1#2% {\expandafter\XINT_applyon::_a\expandafter {\romannumeral`&&@#2}{#1}}% @@ -2591,141 +2776,144 @@ \def\XINT_applyon:::_e #1,#2#3#4{\XINT_applyon:::_b {#2}{#3}{#4, #1}}% \def\XINT_applyon:::_end #1,#2#3#4{\xint_secondoftwo #4}% \catcode`~ 12 -\def\XINT_expr_RApply::csv #1#2#3#4% - {~xintApply::csv{~expandafter#1~xint_exchangetwo_keepbraces{#4}}{#3}}% -\def\XINT_expr_LApply::csv #1#2#3#4{~xintApply::csv{#1{#3}}{#4}}% -\def\XINT_expr_RLApply:::csv #1#2{~xintApply:::csv{#1}}% \catcode`$ 12 % $ -\def\XINT_xptwo_getab_b #1#2!#3% - {\expandafter\XINT_xptwo_getab_c\romannumeral`&&@#3!#1{#1#2}}% -\def\XINT_xptwo_getab_c #1#2!#3#4#5#6{#1#3{#5}{#6}{#1#2}{#4}}% \def\xint_ddfork #1$$#2#3\krof {#2}% $$ -\def\XINT_NEfork #1#2{\xint_ddfork - #1#2\XINT_expr_RLApply:::csv - #1$\XINT_expr_RApply::csv% $ - $#2\XINT_expr_LApply::csv% $ - $${\XINT_NEfork_nn #1#2}% $$ - \krof }% -\def\XINT_NEfork_nn #1#2#3#4{% - \if #1##\xint_dothis{#3}\fi - \if #1~\xint_dothis{#3}\fi - \if #2##\xint_dothis{#3}\fi - \if #2~\xint_dothis{#3}\fi - \xint_orthat {\csname #4NE\endcsname }% - }% -\def\XINT_NEfork_one #1#2!#3#4#5#6{% - \if ###1\xint_dothis {#3}\fi - \if ~#1\xint_dothis {#3}\fi - \if $#1\xint_dothis {~xintApply::csv{#3#5}}\fi %$ - \xint_orthat {\csname #4NE\endcsname #6}{#1#2}% -}% -\toks0 {}% -\xintFor #1 in - {DivFloor,Mod,Round,Trunc,iRound,iTrunc,iQuo,iRem, - iiDivFloor,iiDivRound,iiMod,iiQuo,iiRem,% - Lt,Gt,Eq,LtorEq,GtorEq,NotEq,% - iiLt,iiGt,iiEq,iiLtorEq,iiGtorEq,iiNotEq,% - Add,Sub,Mul,Div,Pow,E,% - iiAdd,iiSub,iiMul,iiPow,iiE,% - AND,OR,XOR,% - SeqA::csv,iiSeqA::csv}\do - {\toks0 - \expandafter{\the\toks0% no space! - \expandafter\let\csname xint#1NE\expandafter\endcsname\csname xint#1\expandafter - \endcsname\expandafter\def\csname xint#1\endcsname ####1####2{% - \expandafter\XINT_NEfork - \romannumeral`&&@\expandafter\XINT_xptwo_getab_b - \romannumeral`&&@####2!{####1}{~xint#1}{xint#1}}% - }% -}% -\xintFor #1 in {Num,Irr,Abs,iiAbs,Sgn,iiSgn,TFrac,Floor,iFloor,Ceil,iCeil,% - Sqr,iiSqr,iiSqrt,iiSqrtR,iiIsZero,iiIsNotZero,iiifNotZero,iiifSgn,% - Odd,Even,iiOdd,iiEven,Opp,iiOpp,iiifZero,Fac,Binomial,% - PFactorial,iiFac,iiBinomial,iiPFactorial,Bool,Toggle}\do -{\toks0 \expandafter{\the\toks0% - \expandafter\let\csname xint#1NE\expandafter\endcsname\csname - xint#1\expandafter - \endcsname\expandafter\def\csname xint#1\endcsname ####1{% - \expandafter\XINT_NEfork_one\romannumeral`&&@####1!{~xint#1}{xint#1}{}{}}% - }% -}% -\toks0 - \expandafter{\the\toks0 - \let\XINTinFloatFacNE\XINTinFloatFac - \def\XINTinFloatFac ##1{% - \expandafter\XINT_NEfork_one - \romannumeral`&&@##1!{~XINTinFloatFac}{XINTinFloatFac}{}{}}% - }% -\xintFor #1 in {Add,Sub,Mul,Div,Binomial,PFactorial,PowerH,E,% - Mod,DivFloor,DivMod,SeqA::csv}\do -{\toks0 - \expandafter{\the\toks0% - \expandafter\let\csname XINTinFloat#1NE\expandafter\endcsname - \csname XINTinFloat#1\expandafter\endcsname - \expandafter\def\csname XINTinFloat#1\endcsname ####1####2{% - \expandafter\XINT_NEfork - \romannumeral`&&@\expandafter\XINT_xptwo_getab_b - \romannumeral`&&@####2!{####1}{~XINTinFloat#1}{XINTinFloat#1}}% - }% -}% -\xintFor #1 in {XINTinFloatdigits,XINTinFloatFracdigits,XINTinFloatSqrtdigits,XINTinFloatFacdigits}\do -{\toks0 - \expandafter{\the\toks0% - \expandafter\let\csname #1NE\expandafter\endcsname\csname #1\expandafter - \endcsname\expandafter\def\csname #1\endcsname ####1{\expandafter - \XINT_NEfork_one\romannumeral`&&@####1!{~#1}{#1}{}{}}% - }% +\def\XINT:NE:RApply::csv #1#2#3#4% + {~xintApply::csv{~expandafter #2~xint_exchangetwo_keepbraces{#4}}{#3}}% +\def\XINT:NE:LApply::csv #1#2#3{~xintApply::csv{#2{#3}}}% +\def\XINT:NE:RLApply:::csv #1{~xintApply:::csv}% +\def\XINT:NE:two#1{\XINT:NE:two_{#1}{\detokenize{#1}}}% +\def\XINT:NE:two_#1#2#3#4% + {\expandafter\XINT:NE:two_a\romannumeral`&&@#4!{#3}{#1}{#2}}% +\def\XINT:NE:two_a#1#2!#3#4#5% + {\expandafter\XINT:NE:two_b\romannumeral`&&@#3!#1{#4}{#5}{#1#2}}% +\def\XINT:NE:two_b#1#2!#3#4#5{\XINT:NE:two_fork_dd#1#3{#4}{#5}{#1#2}}% +\def\XINT:NE:two_fork_dd #1#2{% + \xint_ddfork + #1#2\XINT:NE:RLApply:::csv + #1$\XINT:NE:RApply::csv% $ + $#2\XINT:NE:LApply::csv% $ + $${\XINT:NE:two_fork_nn #1#2}% $$ + \krof +}% +\def\XINT:NE:two_fork_nn #1#2#3#4{% + \if #1##\xint_dothis{#4}\fi + \if #1~\xint_dothis{#4}\fi + \if #2##\xint_dothis{#4}\fi + \if #2~\xint_dothis{#4}\fi + \xint_orthat{#3}% +}% +\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}% +}% +\def\XINT:NE:oneopt#1[#2]#3% + {\expandafter\XINT:NE:oneopt_a\romannumeral`&&@#3!{#2}#1}% +\def\XINT:NE:oneopt_a#1#2!#3#4% + {\expandafter\XINT:NE:oneopt_b\romannumeral`&&@#3!#1#4{#1#2}}% +\def\XINT:NE:oneopt_b#1#2!#3#4% + {\expandafter\XINT:NE:oneopt_fork#1#3#4{#1#2}}% +\def\XINT:NE:oneopt_fork#1#2#3#4{% + \if1\if###11\else\if~#11\else\if###21\else\if~#21\else0\fi\fi\fi\fi + \xint_dothis {\detokenize{#3}[#4]}\fi + \if $#2\xint_dothis {~xintApply::csv{\detokenize{#3}[#4]}}\fi %$ + \xint_orthat{#3[#4]}% +}% pas complétement général, mais bon +\def\XINT:NE:csv #1{\detokenize{#1}}% radicalement fainéant +\def\XINT:newexpr:one:and:opt #1,#2,#3!#4#5% +{% + \if\relax#3\relax\expandafter\xint_firstoftwo\else + \expandafter\xint_secondoftwo\fi + {\XINT:NE:one#4}{\XINT:NE:oneopt#5[\XINT:NE:one\xintNum{#2}]}{#1}% }% -\xintFor #1 in {xintSeq::csv,xintiiSeq::csv,XINTinFloatSeq::csv}\do - {\toks0 - \expandafter{\the\toks0% no space - \expandafter\let\csname #1NE\expandafter\endcsname\csname #1\expandafter - \endcsname\expandafter\def\csname #1\endcsname ####1####2{% - \expandafter\XINT_NEfork - \romannumeral`&&@\expandafter\XINT_xptwo_getab_b - \romannumeral`&&@####2!{####1}{$noexpand$#1}{#1}}% - }% +\def\XINT:newexpr:one:or:two #1,#2,#3!#4#5% +{% + \if\relax#3\relax\expandafter\xint_firstoftwo\else + \expandafter\xint_secondoftwo\fi + {\XINT:NE:two#4{0}}{\XINT:NE:two#5{\XINT:NE:one\xintNum{#2}}}{#1}% }% -\xintFor #1 in {xintSeqB,xintiiSeqB,XINTinFloatSeqB}\do - {\toks0 - \expandafter{\the\toks0% no space - \expandafter\let\csname #1::csvNE\expandafter\endcsname\csname #1::csv\expandafter - \endcsname\expandafter\def\csname #1::csv\endcsname ####1####2{% - \expandafter\XINT_NEfork - \romannumeral`&&@\expandafter\XINT_xptwo_getab_b - \romannumeral`&&@####2!{####1}{$noexpand$#1:f:csv}{#1::csv}}% - }% +\def\XINT:newiiexpr:one:or:two #1,#2,#3!#4% +{% + \if\relax#3\relax\expandafter\xint_firstoftwo\else + \expandafter\xint_secondoftwo\fi + {\XINT:NE:two#4{0}}{\XINT:NE:two#4{#2}}{#1}% +}% +\def\XINT:newexpr:insertdollar~{$noexpand$}% +\def\XINT:newexpr:two:to:two #1,#2,!#3% +{% + \XINT:NE:two_ + {\expandafter\XINT:expr:totwo\romannumeral`&&@#3}% + {$noexpand$expandafter~XINT:expr:totwo~romannumeral-`0\detokenize{#3}}% + {#1}{#2}% +}% +\def\XINT:newflexpr:two:to:two #1,#2,!#3% +{% + \XINT:NE:two_ + {#3}% + {\expandafter\XINT:newexpr:insertdollar\detokenize{#3}}% + {#1}{#2}% +}% +\def\XINT:newexpr:two:to:one #1,#2,!#3% +{% + \XINT:NE:two#3{#1}{#2}% +}% +\let\XINT:newflexpr:two:to:one\XINT:newexpr:two:to:one +\def\xintifNotZeroNE:#1#2,#3,#4,% +{% + \if1\if###11\else\if~#11\else\if$#11\else0%$ + \fi\fi\fi + \xint_dothis{~xintifNotZero}\fi + \xint_orthat\xintifNotZero + {#1#2}{#3}{#4}% +}% +\def\xintifSgnNE:#1#2,#3,#4,#5,% +{% + \if1\if###11\else\if~#11\else\if$#11\else0%$ + \fi\fi\fi + \xint_dothis{~xintifSgn}\fi + \xint_orthat\xintifSgn + {#1#2}{#3}{#4}{#5}% +}% +\def\XINT_expr_redefinemacros {% + \let\XINT:NEhook:one\XINT:NE:one + \let\XINT:NEhook:two\XINT:NE:two + \let\XINT:NEhook:csv\XINT:NE:csv + \let\XINT:expr:one:and:opt \XINT:newexpr:one:and:opt + \let\XINT:expr:one:or:two \XINT:newexpr:one:or:two + \let\XINT:iiexpr:one:or:two \XINT:newiiexpr:one:or:two + \let\XINT:expr:two:to:two \XINT:newexpr:two:to:two + \let\XINT:expr:two:to:one \XINT:newexpr:two:to:one + \let\XINT:flexpr:two:to:one \XINT:newflexpr:two:to:one + \let\XINT:expr:two:to:one \XINT:newexpr:two:to:one + \let\XINT:flexpr:two:to:two \XINT:newflexpr:two:to:two + \let\XINT:flexpr:two:to:one \XINT:newflexpr:two:to:one + \let\xintifNotZero: \xintifNotZeroNE: + \let\xintifSgn: \xintifSgnNE: + \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 + \def\xintSeq::csv + {\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 + {\XINT:NE:two_\xintiiSeqBNumeric::csv{$noexpand$xintiiSeqB:f:csv}}% + \def\XINTinFloatSeqB::csv + {\XINT:NE:two_\XINTinFloatSeqBNumeric::csv{$noexpand$XINTinFloatSeqB:f:csv}}% + \def\xintListSel:x:csv {~xintListSel:f:csv }% + \let\XINT:expr:userfunc \XINT:newexpr:userfunc + \let\XINT:expr:macrofunc\XINT:newexpr:macrofunc }% -\toks0 - \expandafter{\the\toks0 - \let\XINTinFloatNE\XINTinFloat - \def\XINTinFloat [##1]##2{% not ultimately general, but got tired - \expandafter\XINT_NEfork_one - \romannumeral`&&@##2!{~XINTinFloat[##1]}{XINTinFloat}{}{[##1]}}% - \let\XINTinFloatSqrtNE\XINTinFloatSqrt - \def\XINTinFloatSqrt [##1]##2{% - \expandafter\XINT_NEfork_one - \romannumeral`&&@##2!{~XINTinFloatSqrt[##1]}{XINTinFloatSqrt}{}{[##1]}}% - \let\XINTinFloatFacNE\XINTinFloatFac - \def\XINTinFloatFac [##1]##2{% - \expandafter\XINT_NEfork_one - \romannumeral`&&@##2!{~XINTinFloatFac[##1]}{XINTinFloatFac}{}{[##1]}}% -}% -\xintFor #1 in {ANDof,ORof,XORof,iiMaxof,iiMinof,iiSum,iiPrd, - GCDof,LCMof,Sum,Prd,Maxof,Minof, - Reverse:f,FirstItem:f,LastItem:f}\do -{\toks0 - \expandafter{\the\toks0\expandafter\def\csname xint#1:csv\endcsname {~xint#1:csv}}% -}% -\xintFor #1 in - {XINTinFloatMaxof,XINTinFloatMinof,XINTinFloatSum,XINTinFloatPrd}\do -{\toks0 - \expandafter{\the\toks0\expandafter\def\csname #1:csv\endcsname {~#1:csv}}% -}% -\toks0 \expandafter{\the\toks0 - \def\xintListSel:x:csv {~xintListSel:f:csv }% -}% -\odef\XINT_expr_redefinemacros {\the\toks0}% \def\XINT_expr_redefineprints {% \def\XINT_flexpr_noopt @@ -2735,56 +2923,58 @@ \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}}% + \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}}% \def\xintCSV::csv {~xintCSV::csv }% \def\xintSPRaw::csv {~xintSPRaw::csv }% \def\xintPFloat::csv {~xintPFloat::csv }% \def\xintIsTrue::csv {~xintIsTrue::csv }% \def\xintRound::csv {~xintRound::csv }% }% -\toks0 {}% -\def\xintNewExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone +\def\xintNewExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone \xinttheexpr\XINT_newexpr_clean}% -\def\xintNewFloatExpr{\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone +\def\xintNewFloatExpr{\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone \xintthefloatexpr\XINT_newexpr_clean}% -\def\xintNewIExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone +\def\xintNewIExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone \xinttheiexpr\XINT_newexpr_clean}% -\def\xintNewIIExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone +\def\xintNewIIExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone \xinttheiiexpr\XINT_newexpr_clean}% -\def\xintNewBoolExpr {\XINT_NewExpr{}\XINT_expr_redefineprints\xint_firstofone +\def\xintNewBoolExpr {\XINT_NewExpr\XINT_expr_redefineprints\xint_firstofone \xinttheboolexpr\XINT_newexpr_clean}% \def\XINT_newexpr_clean #1>{\noexpand\romannumeral`&&@}% \def\XINT_NewFunc - {\XINT_NewExpr,{}\xint_gobble_i\xintthebareeval \XINT_newfunc_clean }% + {\XINT_NewExpr{}\xint_gobble_i\xintthebareeval\XINT_newfunc_clean}% \def\XINT_NewFloatFunc - {\XINT_NewExpr,{}\xint_gobble_i\xintthebarefloateval\XINT_newfunc_clean }% + {\XINT_NewExpr{}\xint_gobble_i\xintthebarefloateval\XINT_newfunc_clean}% \def\XINT_NewIIFunc - {\XINT_NewExpr,{}\xint_gobble_i\xintthebareiieval \XINT_newfunc_clean }% + {\XINT_NewExpr{}\xint_gobble_i\xintthebareiieval\XINT_newfunc_clean}% \def\XINT_newfunc_clean #1>{}% -\def\XINT_NewExpr #1#2#3#4#5#6#7[#8]% +\def\XINT_NewExpr #1#2#3#4#5#6[#7]% {% \begingroup - \ifcase #8\relax - \toks0 {\endgroup\def#6}% - \or \toks0 {\endgroup\def#6##1#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1##3#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1##7#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1##7#1##8#1}% - \or \toks0 {\endgroup\def#6##1#1##2#1##3#1##4#1##5#1##6#1##7#1##8#1##9#1}% + \ifcase #7\relax + \toks0 {\endgroup\def#5}% + \or \toks0 {\endgroup\def#5##1}% + \or \toks0 {\endgroup\def#5##1##2}% + \or \toks0 {\endgroup\def#5##1##2##3}% + \or \toks0 {\endgroup\def#5##1##2##3##4}% + \or \toks0 {\endgroup\def#5##1##2##3##4##5}% + \or \toks0 {\endgroup\def#5##1##2##3##4##5##6}% + \or \toks0 {\endgroup\def#5##1##2##3##4##5##6##7}% + \or \toks0 {\endgroup\def#5##1##2##3##4##5##6##7##8}% + \or \toks0 {\endgroup\def#5##1##2##3##4##5##6##7##8##9}% \fi \xintexprSafeCatcodes \XINT_expr_redefinemacros - #2% - \XINT_NewExpr_a #3#4#5#6% + #1% + \XINT_NewExpr_a #2#3#4#5% }% \catcode`~ 13 \catcode`@ 14 \catcode`\% 6 \catcode`# 12 \catcode`$ 11 @ $ \def\XINT_NewExpr_a %1%2%3%4%5@ @@ -2795,13 +2985,14 @@ \catcode`# 12 \catcode`~ 13 \escapechar 126 \endlinechar -1 \everyeof {\noexpand }@ \edef\XINT_tmpb - {\scantokens\expandafter - {\romannumeral`&&@\expandafter%2\XINT_tmpa {#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}\relax}@ + {\scantokens\expandafter{\romannumeral`&&@\expandafter + %2\XINT_tmpa{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}\relax}@ }@ \escapechar 92 \catcode`# 6 \catcode`$ 0 @ $ \edef\XINT_tmpa %%1%%2%%3%%4%%5%%6%%7%%8%%9@ - {\scantokens\expandafter{\expandafter%3\meaning\XINT_tmpb}}@ - \the\toks0\expandafter{\XINT_tmpa{%%1}{%%2}{%%3}{%%4}{%%5}{%%6}{%%7}{%%8}{%%9}}@ + {\scantokens\expandafter{\expandafter%3\meaning\XINT_tmpb}}@ + \the\toks0\expandafter + {\XINT_tmpa{%%1}{%%2}{%%3}{%%4}{%%5}{%%6}{%%7}{%%8}{%%9}}@ %1{\ifxintverbose \xintMessage{xintexpr}{Info}@ {\string%4\space now with meaning \meaning%4}@ @@ -2834,6 +3025,7 @@ \catcode45=\the\catcode45 % - \catcode44=\the\catcode44 % , \catcode61=\the\catcode61 % = + \catcode96=\the\catcode96 % ` \catcode32=\the\catcode32\relax % space }% \catcode59=12 % ; @@ -2858,6 +3050,7 @@ \catcode45=12 % - \catcode44=12 % , \catcode61=12 % = + \catcode96=12 % ` \catcode32=10 % space }% \let\XINT_tmpa\relax \let\XINT_tmpb\relax \let\XINT_tmpc\relax diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty index e7181fc048a..8a5fec10550 100644 --- a/Master/texmf-dist/tex/generic/xint/xintfrac.sty +++ b/Master/texmf-dist/tex/generic/xint/xintfrac.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2q 2018/02/06 +%% The xint bundle 1.3 2018/03/01 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintfrac: Expandable operations on fractions %% --------------------------------------------------------------- @@ -39,6 +39,7 @@ \let\z\endgroup \expandafter\let\expandafter\x\csname ver@xintfrac.sty\endcsname \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname + \expandafter\let\expandafter\ww\csname ver@xintgcd.sty\endcsname \expandafter \ifx\csname PackageInfo\endcsname\relax \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% @@ -52,14 +53,18 @@ \else \ifx\x\relax % plain-TeX, first loading of xintfrac.sty \ifx\w\relax % but xint.sty not yet loaded. - \def\z{\endgroup\input xint.sty\relax}% + \def\z{\endgroup\input xint.sty\relax\input xintgcd.sty\relax}% \fi \else \def\empty {}% \ifx\x\empty % LaTeX, first loading, % variable is initialized, but \ProvidesPackage not yet seen \ifx\w\relax % xint.sty not yet loaded. - \def\z{\endgroup\RequirePackage{xint}}% + \def\z{\endgroup\RequirePackage{xint}\RequirePackage{xintgcd}}% + \else + \ifx\ww\relax + \def\z{\endgroup\RequirePackage{xintgcd}}% + \fi \fi \else \aftergroup\endinput % xintfrac already loaded. @@ -70,31 +75,119 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintfrac}% - [2018/02/06 1.2q Expandable operations on fractions (JFB)]% -\def\xintSgn {\romannumeral0\xintsgn }% deprecated from xintcore -\def\xintCmp {\romannumeral0\xintcmp }% deprecated from xintcore -\def\xintEq {\romannumeral0\xinteq }% deprecated from xint -\def\xintNeq #1#2% renamed into \xintNotEq - {\romannumeral0\XINT_signaldeprecated{xintfrac}{xintNeq}\xintifeq {#1}{#2}{0}{1}}% -\def\xintNotEq #1#2{\romannumeral0\xintifeq {#1}{#2}{0}{1}}% -\def\xintGt {\romannumeral0\xintgt }% + [2018/03/01 1.3 Expandable operations on fractions (JFB)]% +\def\xintEq {\romannumeral0\xinteq }% +\def\xinteq #1#2{\xintifeq{#1}{#2}{1}{0}}% +\def\xintNotEq#1#2{\romannumeral0\xintifeq {#1}{#2}{0}{1}}% +\def\xintGt {\romannumeral0\xintgt }% +\def\xintgt #1#2{\xintifgt{#1}{#2}{1}{0}}% \def\xintLt {\romannumeral0\xintlt }% +\def\xintlt #1#2{\xintiflt{#1}{#2}{1}{0}}% \def\xintGtorEq #1#2{\romannumeral0\xintiflt {#1}{#2}{0}{1}}% \def\xintLtorEq #1#2{\romannumeral0\xintifgt {#1}{#2}{0}{1}}% \def\xintIsZero {\romannumeral0\xintiszero }% +\def\xintiszero #1{\if0\xintSgn{#1}\xint_afterfi{ 1}\else\xint_afterfi{ 0}\fi}% \def\xintIsNotZero{\romannumeral0\xintisnotzero }% +\def\xintisnotzero + #1{\if0\xintSgn{#1}\xint_afterfi{ 0}\else\xint_afterfi{ 1}\fi}% \def\xintIsOne {\romannumeral0\xintisone }% +\def\xintisone #1{\expandafter\XINT_isone\romannumeral0\xintnum{#1}XY}% \def\xintOdd {\romannumeral0\xintodd }% +\def\xintodd #1% +{% + \ifodd\xintLDg{\xintNum{#1}} %<- intentional space + \xint_afterfi{ 1}% + \else + \xint_afterfi{ 0}% + \fi +}% \def\xintEven {\romannumeral0\xinteven }% +\def\xinteven #1% +{% + \ifodd\xintLDg{\xintNum{#1}} %<- intentional space + \xint_afterfi{ 0}% + \else + \xint_afterfi{ 1}% + \fi +}% \def\xintifSgn{\romannumeral0\xintifsgn }% +\def\xintifsgn #1% +{% + \ifcase \xintSgn{#1} + \expandafter\xint_secondofthree_thenstop + \or\expandafter\xint_thirdofthree_thenstop + \else\expandafter\xint_firstofthree_thenstop + \fi +}% \def\xintifCmp{\romannumeral0\xintifcmp }% +\def\xintifcmp #1#2% +{% + \ifcase\xintCmp {#1}{#2} + \expandafter\xint_secondofthree_thenstop + \or\expandafter\xint_thirdofthree_thenstop + \else\expandafter\xint_firstofthree_thenstop + \fi +}% \def\xintifEq {\romannumeral0\xintifeq }% +\def\xintifeq #1#2% +{% + \if0\xintCmp{#1}{#2}% + \expandafter\xint_firstoftwo_thenstop + \else\expandafter\xint_secondoftwo_thenstop + \fi +}% \def\xintifGt {\romannumeral0\xintifgt }% +\def\xintifgt #1#2% +{% + \if1\xintCmp{#1}{#2}% + \expandafter\xint_firstoftwo_thenstop + \else\expandafter\xint_secondoftwo_thenstop + \fi +}% \def\xintifLt {\romannumeral0\xintiflt }% +\def\xintiflt #1#2% +{% + \ifnum\xintCmp{#1}{#2}<\xint_c_ + \expandafter\xint_firstoftwo_thenstop + \else \expandafter\xint_secondoftwo_thenstop + \fi +}% \def\xintifZero {\romannumeral0\xintifzero }% +\def\xintifzero #1% +{% + \if0\xintSgn{#1}% + \expandafter\xint_firstoftwo_thenstop + \else + \expandafter\xint_secondoftwo_thenstop + \fi +}% \def\xintifNotZero{\romannumeral0\xintifnotzero }% +\def\xintifnotzero #1% +{% + \if0\xintSgn{#1}% + \expandafter\xint_secondoftwo_thenstop + \else + \expandafter\xint_firstoftwo_thenstop + \fi +}% \def\xintifOne {\romannumeral0\xintifone }% +\def\xintifone #1% +{% + \if1\xintIsOne{#1}% + \expandafter\xint_firstoftwo_thenstop + \else + \expandafter\xint_secondoftwo_thenstop + \fi +}% \def\xintifOdd {\romannumeral0\xintifodd }% +\def\xintifodd #1% +{% + \if\xintOdd{#1}1% + \expandafter\xint_firstoftwo_thenstop + \else + \expandafter\xint_secondoftwo_thenstop + \fi +}% \def\XINT_cntSgnFork #1% {% \ifcase #1\expandafter\xint_secondofthree @@ -412,6 +505,24 @@ \def\XINT_rawz_Ba -#1.#2#3{\expandafter\XINT_rawz_Bb \expandafter{\romannumeral0\XINT_dsx_addzeros{#1}#3;}{#2}}% \def\XINT_rawz_Bb #1#2{ #2/#1}% +\def\xintDecToString{\romannumeral0\xintdectostring}% +\def\xintdectostring#1{\expandafter\XINT_dectostr\romannumeral0\xintraw{#1}}% +\def\XINT_dectostr #1/#2[#3]{\xintiiifZero {#1}% + \XINT_dectostr_z + {\if1\XINT_isOne{#2}\expandafter\XINT_dectostr_a + \else\expandafter\XINT_dectostr_b + \fi}% + #1/#2[#3]% +}% +\def\XINT_dectostr_z#1[#2]{ 0}% +\def\XINT_dectostr_a#1/#2[#3]{% + \ifnum#3<\xint_c_\xint_dothis{\xinttrunc{-#3}{#1[#3]}}\fi + \xint_orthat{\xintiie{#1}{#3}}% +}% +\def\XINT_dectostr_b#1/#2[#3]{% just to handle this somehow + \ifnum#3<\xint_c_\xint_dothis{\xinttrunc{-#3}{#1[#3]}/#2}\fi + \xint_orthat{\xintiie{#1}{#3}/#2}% +}% \def\xintFloor {\romannumeral0\xintfloor }% \def\xintfloor #1% devrais-je faire \xintREZ? {\expandafter\XINT_ifloor \romannumeral0\xintrawwithzeros {#1}./1[0]}% @@ -599,10 +710,15 @@ }% \def\XINT_e_end #1.#2#3{ #2/#3[#1]}% \def\xintIrr {\romannumeral0\xintirr }% +\def\xintPIrr{\romannumeral0\xintpirr }% \def\xintirr #1% {% \expandafter\XINT_irr_start\romannumeral0\xintrawwithzeros {#1}\Z }% +\def\xintpirr #1% +{% + \expandafter\XINT_pirr_start\romannumeral0\xintraw{#1}% +}% \def\XINT_irr_start #1#2/#3\Z {% \if0\XINT_isOne {#3}% @@ -616,6 +732,19 @@ \fi #2\Z {#3}% }% +\def\XINT_pirr_start #1#2/#3[% +{% + \if0\XINT_isOne {#3}% + \xint_afterfi + {\xint_UDsignfork + #1\XINT_irr_negative + -{\XINT_irr_nonneg #1}% + \krof}% + \else + \xint_afterfi{\XINT_irr_denomisone #1}% + \fi + #2\Z {#3}[% +}% \def\XINT_irr_denomisone #1\Z #2{ #1/1}% changed in 1.08 \def\XINT_irr_negative #1\Z #2{\XINT_irr_D #1\Z #2\Z -}% \def\XINT_irr_nonneg #1\Z #2{\XINT_irr_D #1\Z #2\Z \space}% @@ -1201,65 +1330,40 @@ {\romannumeral0\XINT_dsx_addzeros {#1}#4;}% {#5}{#7}{#6}[#3]% }% +\def\XINT_fadd_iszero #1[#2]{ 0/1[0]}% ou [#2] originel? \def\XINT_fadd_C #1#2#3% {% - \ifcase\romannumeral0\xintiicmp {#2}{#3} %<- intentional space here. - \expandafter\XINT_fadd_eq - \or\expandafter\XINT_fadd_D - \else\expandafter\XINT_fadd_Da - \fi {#2}{#3}{#1}% -}% -\def\XINT_fadd_eq #1#2#3#4%#5% -{% - \expandafter\XINT_fadd_G - \romannumeral0\xintiiadd {#3}{#4}/#1%[#5]% -}% -\def\XINT_fadd_D #1#2% -{% - \expandafter\XINT_fadd_E\romannumeral0\XINT_div_prepare {#2}{#1}{#1}{#2}% + \expandafter\XINT_fadd_D_b + \romannumeral0\XINT_div_prepare{#2}{#3}{#2}{#2}{#3}{#1}% }% -\def\XINT_fadd_E #1#2% +\def\XINT_fadd_D_a #1#2% {% - \if0\XINT_Sgn #2\xint: - \expandafter\XINT_fadd_F - \else\expandafter\XINT_fadd_K - \fi {#1}% + \expandafter\XINT_fadd_D_b + \romannumeral0\XINT_div_prepare {#1}{#2}{#1}% }% -\def\XINT_fadd_F #1#2#3#4#5%#6% +\def\XINT_fadd_D_b #1#2{\XINT_fadd_D_c #2\Z}% +\def\XINT_fadd_D_c #1#2\Z {% - \expandafter\XINT_fadd_G - \romannumeral0\xintiiadd {\xintiiMul {#5}{#1}}{#4}/#2%[#6]% + \xint_gob_til_zero #1\XINT_fadd_D_exit0\XINT_fadd_D_a {#1#2}% }% -\def\XINT_fadd_Da #1#2% +\def\XINT_fadd_D_exit0\XINT_fadd_D_a #1#2#3% {% - \expandafter\XINT_fadd_Ea\romannumeral0\XINT_div_prepare {#1}{#2}{#1}{#2}% + \expandafter\XINT_fadd_E + \romannumeral0\xintiiquo {#3}{#2}.{#2}% }% -\def\XINT_fadd_Ea #1#2% +\def\XINT_fadd_E #1.#2#3% {% - \if0\XINT_Sgn #2\xint: - \expandafter\XINT_fadd_Fa - \else\expandafter\XINT_fadd_K - \fi {#1}% + \expandafter\XINT_fadd_F + \romannumeral0\xintiimul{#1}{#3}.{\xintiiQuo{#3}{#2}}{#1}% }% -\def\XINT_fadd_Fa #1#2#3#4#5%#6% +\def\XINT_fadd_F #1.#2#3#4#5% {% - \expandafter\XINT_fadd_G - \romannumeral0\xintiiadd {\xintiiMul {#4}{#1}}{#5}/#3%[#6]% + \expandafter\XINT_fadd_G + \romannumeral0\xintiiadd{\xintiiMul{#2}{#4}}{\xintiiMul{#3}{#5}}/#1% }% \def\XINT_fadd_G #1{% \def\XINT_fadd_G ##1{\if0##1\expandafter\XINT_fadd_iszero\fi#1##1}% }\XINT_fadd_G{ }% -\def\XINT_fadd_K #1#2#3#4#5% -{% - \expandafter\XINT_fadd_L - \romannumeral0\xintiiadd {\xintiiMul {#2}{#5}}{\xintiiMul {#3}{#4}}.% - {{#2}{#3}}% -}% -\def\XINT_fadd_L #1{\if0#1\expandafter\XINT_fadd_iszero\fi\XINT_fadd_M #1}% -\def\XINT_fadd_M #1.#2{\expandafter\XINT_fadd_N \expandafter - {\romannumeral0\xintiimul #2}{#1}}% -\def\XINT_fadd_N #1#2{ #2/#1}% -\def\XINT_fadd_iszero #1[#2]{ 0/1[0]}% ou [#2] originel? \def\xintSub {\romannumeral0\xintsub }% \def\xintsub #1{\expandafter\XINT_fsub\romannumeral0\xintraw {#1}}% \def\XINT_fsub #1{\xint_gob_til_zero #1\XINT_fsub_Azero 0\XINT_fsub_a #1}% @@ -1361,14 +1465,8 @@ \expandafter\XINT_fpow_pos_B\expandafter {#3}{#1}{#2}% }% \def\XINT_fpow_pos_B #1#2{\XINT_outfrac {#2}{#1}}% -\def\xintifac #1{\expandafter\XINT_fac_fork\the\numexpr\xintNum{#1}.}% \def\xintFac {\romannumeral0\xintfac}% \def\xintfac #1{\expandafter\XINT_fac_fork\the\numexpr\xintNum{#1}.[0]}% -\def\xintibinomial #1#2% -{% - \expandafter\XINT_binom_pre - \the\numexpr\xintNum{#1}\expandafter.\the\numexpr\xintNum{#2}.% -}% \def\xintBinomial {\romannumeral0\xintbinomial}% \def\xintbinomial #1#2% {% @@ -1461,10 +1559,10 @@ \def\XINT_modtrunc_pos #1#2/#3[#4]#5/#6[#7].% {% \expandafter\XINT_modtrunc_pos_a - \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.\expandafter - {\romannumeral0\xintiimul {#6}{#3}}% - {\xintiiE{\xintiiMul {#1#5}{#3}}{#7-#4}}% - {\xintiiE{\xintiiMul {#2}{#6}}{#4-#7}}% + \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.% + \romannumeral0\expandafter\XINT_mod_D_b + \romannumeral0\XINT_div_prepare{#3}{#6}{#3}{#3}{#6}% + {#1#5}{#7-#4}{#2}{#4-#7}% }% \def\XINT_modtrunc_pos_a #1.#2#3#4{\xintiirem {#3}{#4}/#2[#1]}% \def\xintDivMod {\romannumeral0\xintdivmod }% @@ -1500,10 +1598,10 @@ \def\XINT_divmod_bpos #1#2/#3[#4]#5/#6[#7].% {% \expandafter\XINT_divmod_bpos_a - \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.\expandafter - {\romannumeral0\xintiimul {#6}{#3}}% - {\xintiiE{\xintiiMul {#1#5}{#3}}{#7-#4}}% - {\xintiiE{\xintiiMul {#2}{#6}}{#4-#7}}% + \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.% + \romannumeral0\expandafter\XINT_mod_D_b + \romannumeral0\XINT_div_prepare{#3}{#6}{#3}{#3}{#6}% + {#1#5}{#7-#4}{#2}{#4-#7}% }% \def\XINT_divmod_bpos_a #1.#2#3#4% {% @@ -1534,10 +1632,35 @@ \def\XINT_mod_bpos #1#2/#3[#4]#5/#6[#7].% {% \expandafter\XINT_mod_bpos_a - \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.\expandafter - {\romannumeral0\xintiimul {#6}{#3}}% - {\xintiiE{\xintiiMul {#1#5}{#3}}{#7-#4}}% - {\xintiiE{\xintiiMul {#2}{#6}}{#4-#7}}% + \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.% + \romannumeral0\expandafter\XINT_mod_D_b + \romannumeral0\XINT_div_prepare{#3}{#6}{#3}{#3}{#6}% + {#1#5}{#7-#4}{#2}{#4-#7}% +}% +\def\XINT_mod_D_a #1#2% +{% + \expandafter\XINT_mod_D_b + \romannumeral0\XINT_div_prepare {#1}{#2}{#1}% +}% +\def\XINT_mod_D_b #1#2{\XINT_mod_D_c #2\Z}% +\def\XINT_mod_D_c #1#2\Z +{% + \xint_gob_til_zero #1\XINT_mod_D_exit0\XINT_mod_D_a {#1#2}% +}% +\def\XINT_mod_D_exit0\XINT_mod_D_a #1#2#3% +{% + \expandafter\XINT_mod_E + \romannumeral0\xintiiquo {#3}{#2}.{#2}% +}% +\def\XINT_mod_E #1.#2#3% +{% + \expandafter\XINT_mod_F + \romannumeral0\xintiimul{#1}{#3}.{\xintiiQuo{#3}{#2}}{#1}% +}% +\def\XINT_mod_F #1.#2#3#4#5#6#7% +{% + {#1}{\xintiiE{\xintiiMul{#4}{#3}}{#5}}% + {\xintiiE{\xintiiMul{#6}{#2}}{#7}}% }% \def\XINT_mod_bpos_a #1.#2#3#4{\xintiirem {#3}{#4}/#2[#1]}% \def\xintIsOne {\romannumeral0\xintisone }% @@ -3160,7 +3283,7 @@ {Usage of deprecated macros!} {This deprecated macro from xintfrac.sty has been detected:\MessageBreak \string\xintNeq\space(use \string\xintNotEq\space or xint's \string\xintiiNotEq!)\MessageBreak -It will get removed at some future release.}}% +This is impossible as it has been removed at 1.3!}}% {% no deprecated macro used (at top level...) }% }\fi\fi diff --git a/Master/texmf-dist/tex/generic/xint/xintgcd.sty b/Master/texmf-dist/tex/generic/xint/xintgcd.sty index fcfa6fba87e..d9afbfbdaff 100644 --- a/Master/texmf-dist/tex/generic/xint/xintgcd.sty +++ b/Master/texmf-dist/tex/generic/xint/xintgcd.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2q 2018/02/06 +%% The xint bundle 1.3 2018/03/01 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintgcd: Euclidean algorithm with xint package %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintgcd}% - [2018/02/06 1.2q Euclide algorithm with xint package (JFB)]% + [2018/03/01 1.3 Euclide algorithm with xint package (JFB)]% \def\xintGCD {\romannumeral0\xintgcd }% \def\xintgcd #1#2{\xintiigcd {\xintNum{#1}}{\xintNum{#2}}}% \def\xintiiGCD {\romannumeral0\xintiigcd }% diff --git a/Master/texmf-dist/tex/generic/xint/xintkernel.sty b/Master/texmf-dist/tex/generic/xint/xintkernel.sty index 3be64a42b94..480de731557 100644 --- a/Master/texmf-dist/tex/generic/xint/xintkernel.sty +++ b/Master/texmf-dist/tex/generic/xint/xintkernel.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2q 2018/02/06 +%% The xint bundle 1.3 2018/03/01 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintkernel: Paraphernalia for the xint packages %% --------------------------------------------------------------- @@ -156,7 +156,7 @@ \fi \XINT_providespackage \ProvidesPackage {xintkernel}% - [2018/02/06 1.2q Paraphernalia for the xint packages (JFB)]% + [2018/03/01 1.3 Paraphernalia for the xint packages (JFB)]% \chardef\xint_c_ 0 \chardef\xint_c_i 1 \chardef\xint_c_ii 2 diff --git a/Master/texmf-dist/tex/generic/xint/xintseries.sty b/Master/texmf-dist/tex/generic/xint/xintseries.sty index b03cffb5867..f6b41030087 100644 --- a/Master/texmf-dist/tex/generic/xint/xintseries.sty +++ b/Master/texmf-dist/tex/generic/xint/xintseries.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2q 2018/02/06 +%% The xint bundle 1.3 2018/03/01 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xintseries: Expandable partial sums with xint package %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintseries}% - [2018/02/06 1.2q Expandable partial sums with xint package (JFB)]% + [2018/03/01 1.3 Expandable partial sums with xint package (JFB)]% \def\xintSeries {\romannumeral0\xintseries }% \def\xintseries #1#2% {% diff --git a/Master/texmf-dist/tex/generic/xint/xinttools.sty b/Master/texmf-dist/tex/generic/xint/xinttools.sty index e5b071b107c..3909f0a056a 100644 --- a/Master/texmf-dist/tex/generic/xint/xinttools.sty +++ b/Master/texmf-dist/tex/generic/xint/xinttools.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2q 2018/02/06 +%% The xint bundle 1.3 2018/03/01 %% Copyright (C) 2013-2018 by Jean-Francois Burnol %% xinttools: Expandable and non-expandable utilities %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xinttools}% - [2018/02/06 1.2q Expandable and non-expandable utilities (JFB)]% + [2018/03/01 1.3 Expandable and non-expandable utilities (JFB)]% \newtoks\XINT_toks \xint_firstofone{\let\XINT_sptoken= } %<- space here! \def\xintgodef {\global\xintodef }% |