texlive[46002] Master/texmf-dist: bnumexpr (7dec17)

commits+karl at tug.org commits+karl at tug.org
Thu Dec 7 00:55:16 CET 2017


Revision: 46002
          http://tug.org/svn/texlive?view=revision&revision=46002
Author:   karl
Date:     2017-12-07 00:55:15 +0100 (Thu, 07 Dec 2017)
Log Message:
-----------
bnumexpr (7dec17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/bnumexpr/README
    trunk/Master/texmf-dist/doc/latex/bnumexpr/README.md
    trunk/Master/texmf-dist/doc/latex/bnumexpr/bnumexpr.pdf
    trunk/Master/texmf-dist/doc/latex/bnumexpr/bnumexpr.tex
    trunk/Master/texmf-dist/doc/latex/bnumexpr/bnumexprchanges.tex
    trunk/Master/texmf-dist/source/latex/bnumexpr/bnumexpr.dtx
    trunk/Master/texmf-dist/tex/latex/bnumexpr/bnumexpr.sty

Modified: trunk/Master/texmf-dist/doc/latex/bnumexpr/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bnumexpr/README	2017-12-06 23:55:02 UTC (rev 46001)
+++ trunk/Master/texmf-dist/doc/latex/bnumexpr/README	2017-12-06 23:55:15 UTC (rev 46002)
@@ -1,5 +1,5 @@
 Source: bnumexpr.dtx
-Version: v1.2b, 2017/07/09 (doc: 2017/07/09)
+Version: v1.2c, 2017/12/05 (doc: 2017/12/05)
 Author: Jean-Francois Burnol
 Info: Expressions with big integers
 License: LPPL 1.3c
@@ -16,12 +16,12 @@
 division) familiar from the \numexpr e-TeX parser.
 
 Besides extending the scope to arbitrarily big numbers (and having a
-more complete syntax, for example -(1) is legal input), it adds the
-truncated division operator //, and its associated modulo /:, the power
-operator ^ (or equivalently **), and the factorial post-fix operator !.
-The space character as well as the underscore character _ both may serve
-to optionally separate digits in long numbers, for better readability of
-the input.
+more complete syntax, for example -(1) is legal input), it adds the (by
+default) floored division operator //, and its associated modulo /:, the
+power operator ^ (or equivalently **), and the factorial post-fix
+operator !. The space character as well as the underscore character _
+both may serve to optionally separate digits in long numbers, for better
+readability of the input.
 
 For example:
 

Modified: trunk/Master/texmf-dist/doc/latex/bnumexpr/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bnumexpr/README.md	2017-12-06 23:55:02 UTC (rev 46001)
+++ trunk/Master/texmf-dist/doc/latex/bnumexpr/README.md	2017-12-06 23:55:15 UTC (rev 46002)
@@ -1,6 +1,6 @@
 
 | Source:  bnumexpr.dtx
-| Version: v1.2b, 2017/07/09 (doc: 2017/07/09)
+| Version: v1.2c, 2017/12/05 (doc: 2017/12/05)
 | Author:  Jean-Francois Burnol
 | Info:    Expressions with big integers
 | License: LPPL 1.3c
@@ -17,11 +17,11 @@
 
 Besides extending the scope to arbitrarily big numbers (and having a
 more complete syntax, for example `-(1)` is legal input), it adds the
-truncated division operator `//`, and its associated modulo `/:`, the
-power operator `^` (or equivalently `**`), and the factorial post-fix
-operator `!`. The space character as well as the underscore character
-`_` both may serve to optionally separate digits in long numbers, for
-better readability of the input.
+(by default) floored division operator `//`, and its associated modulo
+`/:`, the power operator `^` (or equivalently `**`), and the factorial
+post-fix operator `!`. The space character as well as the underscore
+character `_` both may serve to optionally separate digits in long
+numbers, for better readability of the input.
 
 For example:
 

Modified: trunk/Master/texmf-dist/doc/latex/bnumexpr/bnumexpr.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/bnumexpr/bnumexpr.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bnumexpr/bnumexpr.tex	2017-12-06 23:55:02 UTC (rev 46001)
+++ trunk/Master/texmf-dist/doc/latex/bnumexpr/bnumexpr.tex	2017-12-06 23:55:15 UTC (rev 46002)
@@ -21,9 +21,9 @@
 %% same distribution. (The sources need not necessarily be
 %% in the same archive or directory.)
 %% ---------------------------------------------------------------
-\def\bnedocdate {2017/07/09}% package bnumexpr documentation date
-\def\bnepackdate{2017/07/09}% package bnumexpr date
-\def\bneversion {1.2b}      % package bnumexpr version
+\def\bnedocdate {2017/12/05}% package bnumexpr documentation date
+\def\bnepackdate{2017/12/05}% package bnumexpr date
+\def\bneversion {1.2c}      % package bnumexpr version
 %% ---------------------------------------------------------------
 %% The bnumexpr package: Expressions with big integers
 %% Copyright (C) 2014-2017 by Jean-Francois Burnol

Modified: trunk/Master/texmf-dist/doc/latex/bnumexpr/bnumexprchanges.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bnumexpr/bnumexprchanges.tex	2017-12-06 23:55:02 UTC (rev 46001)
+++ trunk/Master/texmf-dist/doc/latex/bnumexpr/bnumexprchanges.tex	2017-12-06 23:55:15 UTC (rev 46002)
@@ -24,6 +24,19 @@
 %% The bnumexpr package: Expressions with big integers
 %% Copyright (C) 2014-2017 by Jean-Francois Burnol
 %%
+\item[1.2c (2017/12/05)] \textbf{Breaking changes:}
+  \begin{itemize}
+  \item requires \xintcorename |1.2p| or later (if not using option |custom|).
+  \item |divtrunc| key of |\bnumexprsetup| is renamed to |div|.
+  \item the |//| and |/:| operators are now by default associated to the
+    \emph{floored} division. This is to keep in sync with the change of
+    \xintcorename at |1.2p|.
+  \item for backwards compatibility, one
+    may add to existing document:\newline
+    \string\bnumexprsetup\{div=\string\xintiiDivTrunc,
+    mod=\string\xintiiModTrunc\}
+  \end{itemize}
+
 \item[1.2b (2017/07/09)]
   \begin{itemize}
   \item the |_| may be used to separate visually blocks of digits in long

Modified: trunk/Master/texmf-dist/source/latex/bnumexpr/bnumexpr.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/bnumexpr/bnumexpr.dtx	2017-12-06 23:55:02 UTC (rev 46001)
+++ trunk/Master/texmf-dist/source/latex/bnumexpr/bnumexpr.dtx	2017-12-06 23:55:15 UTC (rev 46002)
@@ -1,18 +1,18 @@
 % -*- coding: iso-latin-1; time-stamp-format: "%02d-%02m-%:y at %02H:%02M:%02S %Z" -*-
 %<*dtx>
-\def\bnedtxtimestamp  {Time-stamp: <26-07-2017 at 23:19:38 CEST>}
+\def\bnedtxtimestamp  {Time-stamp: <05-12-2017 at 15:54:19 CET>}
 \iffalse
 %</dtx>
 %<*drv>
 %% ---------------------------------------------------------------
-\def\bnedocdate {2017/07/09}% package bnumexpr documentation date
-\def\bnepackdate{2017/07/09}% package bnumexpr date
-\def\bneversion {1.2b}      % package bnumexpr version
+\def\bnedocdate {2017/12/05}% package bnumexpr documentation date
+\def\bnepackdate{2017/12/05}% package bnumexpr date
+\def\bneversion {1.2c}      % package bnumexpr version
 %</drv>
 %<*readme>--------------------------------------------------------
 
 | Source:  bnumexpr.dtx
-| Version: v1.2b, 2017/07/09 (doc: 2017/07/09)
+| Version: v1.2c, 2017/12/05 (doc: 2017/12/05)
 | Author:  Jean-Francois Burnol
 | Info:    Expressions with big integers
 | License: LPPL 1.3c
@@ -29,11 +29,11 @@
 
 Besides extending the scope to arbitrarily big numbers (and having a
 more complete syntax, for example `-(1)` is legal input), it adds the
-truncated division operator `//`, and its associated modulo `/:`, the
-power operator `^` (or equivalently `**`), and the factorial post-fix
-operator `!`. The space character as well as the underscore character
-`_` both may serve to optionally separate digits in long numbers, for
-better readability of the input.
+(by default) floored division operator `//`, and its associated modulo
+`/:`, the power operator `^` (or equivalently `**`), and the factorial
+post-fix operator `!`. The space character as well as the underscore
+character `_` both may serve to optionally separate digits in long
+numbers, for better readability of the input.
 
 For example:
 
@@ -147,6 +147,19 @@
 %%
 %</!readme>
 %<*changes>-------------------------------------------------------
+\item[1.2c (2017/12/05)] \textbf{Breaking changes:}
+  \begin{itemize}
+  \item requires \xintcorename |1.2p| or later (if not using option |custom|).
+  \item |divtrunc| key of |\bnumexprsetup| is renamed to |div|.
+  \item the |//| and |/:| operators are now by default associated to the
+    \emph{floored} division. This is to keep in sync with the change of
+    \xintcorename at |1.2p|.
+  \item for backwards compatibility, one
+    may add to existing document:\newline
+    \string\bnumexprsetup\{div=\string\xintiiDivTrunc,
+    mod=\string\xintiiModTrunc\}
+  \end{itemize}
+
 \item[1.2b (2017/07/09)]
   \begin{itemize}
   \item the |_| may be used to separate visually blocks of digits in long
@@ -502,9 +515,40 @@
    {\href{http://www.ctan.org/pkg/xint}{xintcore}\xspace }%
 \def\xintexprname
    {\href{http://www.ctan.org/pkg/xint}{xintexpr}\xspace }%
+\def\xintbinhexname
+   {\href{http://www.ctan.org/pkg/xint}{xintbinhex}\xspace }%
 
 
+% \centeredline: OUR OWN LITTLE MACRO FOR CENTERING LINES
+% =======================================================
 
+% 7 mars 2013
+% -----------
+%
+% This macro allows to conveniently center a line inside a paragraph and still
+% allow use therein of \verb or other macros changing catcodes.
+% A proposito, the \LaTeX \centerline uses \hsize and not \linewidth !
+% (which in my humble opinion is bad)
+
+% Actually my \centeredline works nicely in list environments.
+
+% \ignorespaces ajout\xE9 le 9 juin 2013.
+
+% Note: \centeredline creates a group
+
+\makeatletter
+\newcommand*\centeredline {%
+      \ifhmode \\\relax
+        \def\centeredline@{\hss\egroup\hskip\z at skip\ignorespaces }%
+      \else
+        \def\centeredline@{\hss\egroup }%
+      \fi
+      \afterassignment\@centeredline
+      \let\next=}
+\def\@centeredline
+    {\hbox to \linewidth \bgroup \hss \bgroup \aftergroup\centeredline@ }
+
+
 \frenchspacing
 \usepackage{bnumexpr}
 
@@ -540,7 +584,7 @@
 
 Package \bnumname provides |\thebnumexpr...\relax| which is analogous to
 |\the\numexpr...\relax|, while allowing arbitrarily big integers, powers,
-factorials, truncated division, modulo, and comma separated expressions.
+factorials, floored division, modulo, and comma separated expressions.
 Examples:
 
 \noindent\bneshow {1_208_637_867_168*(2_187_917_891_279+3_109_197_072_870)}%
@@ -560,7 +604,9 @@
 
 \begin{enumerate}
 \item one must use either |\thebnumexpr| or |\bnethe\bnumexpr| to get a
-  printable result, as |\bnumexpr...\relax| expands to a private format,  
+  printable result, as |\bnumexpr...\relax| expands to a private format (using
+  |\number| as prefix to |\bnumexpr| would only serve to trigger the expansion
+  to the \bnumname private format, hence will raise a \TeX\ error),
 
 \item one may embed directly (without |\bnethe|) a |\bnumexpr...\relax|
   in another one (or in a |\xintexpr...\relax|), but not in a
@@ -586,19 +632,37 @@
   |\numexpr...\relax| which, without |\the| (or |\number| or
   |\romannumeral|) as prefix would not expand inside an |\edef|,
 
-\item tacit multiplication applies in front of parenthesized sub-expressions,
-  or sub |\bnumexpr...\relax| (or |\numexpr...\relax|), or in front of a
-  |\count| or |\dimen| register.
-
 \item expressions may be comma separated. On input, spaces are ignored,
   naturally, and on output the values are comma separated with a space after
-  each comma.
+  each comma,
 
 \item |\bnumexpr -(1+1)\relax| is legal contrarily to |\numexpr -(1+1)\relax|
-  which raises an error.
+  which raises an error,
 
-\item the |_| is legal within the digits composing a number and is silently
-  ignored.
+\item |\numexpr 2\cnta\relax| is illegal (with |\cnta| a |\count|-variable.)
+  But |\bnumexpr 2\cnta\relax| is perfectly legal and will do the tacit
+  multiplication,
+% \newcount\cnta
+% \cnta 1111
+% \thebnumexpr 2\cnta\relax
+
+\item more generally, tacit multiplication applies in front of parenthesized
+  sub-expressions, or sub |\bnumexpr...\relax| (or |\numexpr...\relax|),
+
+\item the underscore |_| is accepted within the digits composing a number and
+  is silently ignored by |\bnumexpr|,
+
+\item |\numexpr| accepts \TeX\ syntax for hexadecimal input |"EF| (or octal
+  input |'377|), but currently |\bnumexpr| does not. This could possibly be
+  added in future%
+%
+\footnote{It is only a matter of copying pasting relevant code from
+  \xintexprname, so depends upon user demands addressed to the author |;-)|.}
+%
+  (hexadecimal prefix |"| is part of the recognized
+  |\xintiiexpr| syntax from \xintexprname if \xintbinhexname is loaded.) In
+  the meantime, one may encapsulate such inputs (obeying \TeX's bound on
+  numbers) into a sub |\numexpr...\relax|.
 \end{enumerate}
 
 An important thing to keep in mind is that if one has a calculation
@@ -662,39 +726,54 @@
 
 It is the expected one with infix operators and parentheses, the
 recognized operators being |+|, |-|, |*|, |/| (rounded division),
-|^| (power), |**| (power), |//| (truncated division), |/:| (modulo)
-and |!| (factorial).
+|^| (power), |**| (power), |//| (by default floored division),
+|/:| (the associated modulo) and |!| (factorial).%
+%
+\footnote{Releases |1.2b| and earlier associated in the default configuration
+  truncated division to |//|. This was changed at |1.2c| to stay in sync with
+  \xintcorename |1.2p|. For backwards compatibility, one may add to existing
+  document \string\bnumexprsetup\{div=\string\xintiiDivTrunc,
+  mod=\string\xintiiModTrunc\}.}
 
+The modulo |/:| is by default associated with the floored division |//|, but
+using |\bnumexprsetup{mod=...}| it can, like the other operators, be remapped
+to any macro of one's choice.
+
 Different computations may be separated by commas. The whole
 expression is handled token by token, any component (digit, operator,
 parenthesis... even the ending |\relax|) may arise on the spot from
 macro expansions.
 
-The precedence rules are the expected ones. Notice though that in case
-of equal precedence the operations are left-associative, hence:\newline
-\bneshow{2^3^4, (2^3)^4, 2^(3^4)}
+The precedence rules are the expected ones.
 
-The three operators |/|, |//|, |/:| are at the same level of
-precedence as the multiplication |*|. The modulo |/:| is associated
-with truncated division |//|.
+There is currently no user interface to change precedence levels. The
+three operators |/|, |//|, |/:| are at the same level of precedence as the
+multiplication |*|. The factorial postfix |!| has highest precedence. The
+minus signs inherit the precedence level of the previously encountered infix
+operators.
 
-The factorial postfix |!| has highest precedence. The minus signs
-inherit the precedence level of the previously encountered infix operators.
+In case of equal precedence the operations are left-associative,
+hence:\newline \bneshow{2^3^4, (2^3)^4, 2^(3^4)}
 
-The underscore |_| can be used to separated digits in long numbers, for
+The underscore |_| can be used to separate digits in long numbers, for
 readability of the input.
 
-\section{Option custom, \csh{bnumexprsetup}}\label{sec:options}
+\section{Options}
 
+The sole package option is |custom|: it tells \bnumname not to load
+package \xintcorename.
+
+\section{\csh{bnumexprsetup}}
+
 Package \bnumname needs that some big integer engine provides the macros
 doing the actual computations. By default, it loads package
 \xintcorename (a subset of \href{http://www.ctan.org/pkg/xint}{xint};
-version |1.2| is required) and uses \csa{bnumexprsetup} in the following
+version |1.2p| is required) and uses \csa{bnumexprsetup} in the following
 way:
 \begin{verbatim}
     \usepackage{xintcore}
     \bnumexprsetup{add=\xintiiAdd, sub=\xintiiSub, mul=\xintiiMul,
-                   divround=\xintiiDivRound, divtrunc=\xintiiDivTrunc,
+                   divround=\xintiiDivRound, div=\xintiiDivFloor,
                    mod=\xintiiMod, pow=\xintiiPow, fac=\xintiiFac}
 \end{verbatim}
 
@@ -728,8 +807,9 @@
 adequately.\footnote{see \csa{BNE_Op_opp} in the code for the
   default.}
 
-The sole package option is |custom|: it tells \bnumname not to load
-\xintcorename.
+Macro |\bnumexprsetup| can be used multiple times in the same document, thus
+allowing to switch math engines or to remap operators to some other arithmetic
+macros of the same math engine. Its effect obeys the local scope.
 
 \section{Readme}
 \begingroup
@@ -822,11 +902,11 @@
 \long\def\xint_secondofthree #1#2#3{#2}%
 \long\def\xint_thirdofthree  #1#2#3{#3}%
 \def\xint_gob_til_!          #1!{}% this ! has catcode 11
-\def\xint_UDsignfork         #1-#2#3\krof {#2}%
+\long\def\xint_UDsignfork    #1-#2#3\krof {#2}%
 \long\def\xint_afterfi       #1#2\fi {\fi #1}%
 \long\def\xint_dothis        #1#2\xint_orthat #3{\fi #1}%
 \let\xint_orthat             \xint_firstofone
-\def\xint_zapspaces          #1 #2{#1#2\xint_zapspaces }%
+\long\def\xint_zapspaces     #1 #2{#1#2\xint_zapspaces }%
 %    \end{macrocode}
 % \subsection{\csh{bnumexprsetup}}
 % New with |v1.2a|. Replaces removed |\bnumexprUsesbigintcalc| etc...
@@ -841,14 +921,15 @@
 \def\BNE_parsedone #1\BNE_parsekeys {}%
 %    \end{macrocode}
 % \subsection{Package options}
+% |v1.2c| replaces former key |divtrunc| by |div|.
 %    \begin{macrocode}
 \def\BNE_tmpa {0}%
 \DeclareOption {custom}{\def\BNE_tmpa {1}}%
 \ProcessOptions\relax
 \if0\BNE_tmpa % Default is to load xintcore.sty
-    \RequirePackage{xintcore}[2015/10/10]%
+    \RequirePackage{xintcore}[2017/12/04]%
     \bnumexprsetup{add=\xintiiAdd, sub=\xintiiSub, mul=\xintiiMul,
-                   divround=\xintiiDivRound, divtrunc=\xintiiDivTrunc,
+                   divround=\xintiiDivRound, div=\xintiiDivFloor,
                    mod=\xintiiMod, pow=\xintiiPow, fac=\xintiiFac}%
 \fi
 %    \end{macrocode}
@@ -1120,6 +1201,8 @@
 %
 % |v1.2a| adds |//| for truncated division, |/:| for modulo operations
 % and |**| for powers (synonym to |^|).
+%
+% |v1.2c| has |//| and |/:| per default associated to floored division.
 %    \begin{macrocode}
 \def\BNE_tmpc #1#2#3#4#5#6#7%
 {%
@@ -1160,7 +1243,7 @@
 \expandafter\def\csname BNE_itself_**\endcsname {^}% shortcut for alias
 \expandafter\def\csname BNE_itself_//\endcsname {//}%
 \expandafter\def\csname BNE_itself_/:\endcsname {/:}%
-\BNE_tmpb  {//}{vii}{BNE_Op_divtrunc}%
+\BNE_tmpb  {//}{vii}{BNE_Op_div}%
 \BNE_tmpb  {/:}{vii}{BNE_Op_mod}%
 %    \end{macrocode}
 % \subsection{! as postfix factorial operator}
@@ -1271,7 +1354,7 @@
   Right bracket \]     Circumflex    \^     Underscore    \_
   Grave accent  \`     Left brace    \{     Vertical bar  \|
   Right brace   \}     Tilde         \~}
-\CheckSum {871}
+\CheckSum {873}
 \makeatletter\check at checksum\makeatother
 \Finale
 %% End of file xint.dtx

Modified: trunk/Master/texmf-dist/tex/latex/bnumexpr/bnumexpr.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bnumexpr/bnumexpr.sty	2017-12-06 23:55:02 UTC (rev 46001)
+++ trunk/Master/texmf-dist/tex/latex/bnumexpr/bnumexpr.sty	2017-12-06 23:55:15 UTC (rev 46002)
@@ -58,11 +58,11 @@
 \long\def\xint_secondofthree #1#2#3{#2}%
 \long\def\xint_thirdofthree  #1#2#3{#3}%
 \def\xint_gob_til_!          #1!{}% this ! has catcode 11
-\def\xint_UDsignfork         #1-#2#3\krof {#2}%
+\long\def\xint_UDsignfork    #1-#2#3\krof {#2}%
 \long\def\xint_afterfi       #1#2\fi {\fi #1}%
 \long\def\xint_dothis        #1#2\xint_orthat #3{\fi #1}%
 \let\xint_orthat             \xint_firstofone
-\def\xint_zapspaces          #1 #2{#1#2\xint_zapspaces }%
+\long\def\xint_zapspaces     #1 #2{#1#2\xint_zapspaces }%
 \catcode`! 3
 \def\bnumexprsetup #1{\BNE_parsekeys #1,=!,}%
 \def\BNE_parsekeys #1=#2#3,{\ifx!#2\expandafter\BNE_parsedone\fi
@@ -75,9 +75,9 @@
 \DeclareOption {custom}{\def\BNE_tmpa {1}}%
 \ProcessOptions\relax
 \if0\BNE_tmpa % Default is to load xintcore.sty
-    \RequirePackage{xintcore}[2015/10/10]%
+    \RequirePackage{xintcore}[2017/12/04]%
     \bnumexprsetup{add=\xintiiAdd, sub=\xintiiSub, mul=\xintiiMul,
-                   divround=\xintiiDivRound, divtrunc=\xintiiDivTrunc,
+                   divround=\xintiiDivRound, div=\xintiiDivFloor,
                    mod=\xintiiMod, pow=\xintiiPow, fac=\xintiiFac}%
 \fi
 \def\bnumexpr {\romannumeral0\bnumeval }%
@@ -309,7 +309,7 @@
 \expandafter\def\csname BNE_itself_**\endcsname {^}% shortcut for alias
 \expandafter\def\csname BNE_itself_//\endcsname {//}%
 \expandafter\def\csname BNE_itself_/:\endcsname {/:}%
-\BNE_tmpb  {//}{vii}{BNE_Op_divtrunc}%
+\BNE_tmpb  {//}{vii}{BNE_Op_div}%
 \BNE_tmpb  {/:}{vii}{BNE_Op_mod}%
 \let\BNE_precedence_! \xint_c_x
 \def\BNE_op_! #1%



More information about the tex-live-commits mailing list