texlive[53172] Master: bigintcalc split from oberdiek (18dec19)

commits+karl at tug.org commits+karl at tug.org
Wed Dec 18 00:29:01 CET 2019


Revision: 53172
          http://tug.org/svn/texlive?view=revision&revision=53172
Author:   karl
Date:     2019-12-18 00:29:01 +0100 (Wed, 18 Dec 2019)
Log Message:
-----------
bigintcalc split from oberdiek (18dec19)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-latex.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/bigintcalc/
    trunk/Master/texmf-dist/doc/latex/bigintcalc/README.md
    trunk/Master/texmf-dist/doc/latex/bigintcalc/bigintcalc.pdf
    trunk/Master/texmf-dist/source/latex/bigintcalc/
    trunk/Master/texmf-dist/source/latex/bigintcalc/bigintcalc.dtx
    trunk/Master/texmf-dist/tex/generic/bigintcalc/
    trunk/Master/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty
    trunk/Master/tlpkg/tlpsrc/bigintcalc.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/bigintcalc/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bigintcalc/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/bigintcalc/README.md	2019-12-17 23:29:01 UTC (rev 53172)
@@ -0,0 +1,9 @@
+# bigintcalc
+
+bigintcalc package for LaTeX
+
+
+This package provides expandable arithmetic operations
+with big integers that can exceed TeX's number limits.
+
+


Property changes on: trunk/Master/texmf-dist/doc/latex/bigintcalc/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/bigintcalc/bigintcalc.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/bigintcalc/bigintcalc.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bigintcalc/bigintcalc.pdf	2019-12-17 23:27:53 UTC (rev 53171)
+++ trunk/Master/texmf-dist/doc/latex/bigintcalc/bigintcalc.pdf	2019-12-17 23:29:01 UTC (rev 53172)

Property changes on: trunk/Master/texmf-dist/doc/latex/bigintcalc/bigintcalc.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/bigintcalc/bigintcalc.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/bigintcalc/bigintcalc.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/bigintcalc/bigintcalc.dtx	2019-12-17 23:29:01 UTC (rev 53172)
@@ -0,0 +1,3561 @@
+% \iffalse meta-comment
+%
+% File: bigintcalc.dtx
+% Version: 2019/12/15 v1.5
+% Info: Expandable calculations on big integers
+%
+% Copyright (C)
+%    2007, 2011, 2012 Heiko Oberdiek
+%    2016-2019 Oberdiek Package Support Group
+%    https://github.com/ho-tex/bigintcalc/issues
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either
+% version 1.3c of this license or (at your option) any later
+% version. This version of this license is in
+%    https://www.latex-project.org/lppl/lppl-1-3c.txt
+% and the latest version of this license is in
+%    https://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainers of this work are
+% Heiko Oberdiek and the Oberdiek Package Support Group
+% https://github.com/ho-tex/bigintcalc/issues
+%
+% The Base Interpreter refers to any `TeX-Format',
+% because some files are installed in TDS:tex/generic//.
+%
+% This work consists of the main source file bigintcalc.dtx
+% and the derived files
+%    bigintcalc.sty, bigintcalc.pdf, bigintcalc.ins, bigintcalc.drv,
+%    bigintcalc-test1.tex, bigintcalc-test2.tex,
+%    bigintcalc-test3.tex.
+%
+% Distribution:
+%    CTAN:macros/latex/contrib/bigintcalc/bigintcalc.dtx
+%    CTAN:macros/latex/contrib/bigintcalc/bigintcalc.pdf
+%
+% Unpacking:
+%    (a) If bigintcalc.ins is present:
+%           tex bigintcalc.ins
+%    (b) Without bigintcalc.ins:
+%           tex bigintcalc.dtx
+%    (c) If you insist on using LaTeX
+%           latex \let\install=y\input{bigintcalc.dtx}
+%        (quote the arguments according to the demands of your shell)
+%
+% Documentation:
+%    (a) If bigintcalc.drv is present:
+%           latex bigintcalc.drv
+%    (b) Without bigintcalc.drv:
+%           latex bigintcalc.dtx; ...
+%    The class ltxdoc loads the configuration file ltxdoc.cfg
+%    if available. Here you can specify further options, e.g.
+%    use A4 as paper format:
+%       \PassOptionsToClass{a4paper}{article}
+%
+%    Programm calls to get the documentation (example):
+%       pdflatex bigintcalc.dtx
+%       makeindex -s gind.ist bigintcalc.idx
+%       pdflatex bigintcalc.dtx
+%       makeindex -s gind.ist bigintcalc.idx
+%       pdflatex bigintcalc.dtx
+%
+% Installation:
+%    TDS:tex/generic/bigintcalc/bigintcalc.sty
+%    TDS:doc/latex/bigintcalc/bigintcalc.pdf
+%    TDS:source/latex/bigintcalc/bigintcalc.dtx
+%
+%<*ignore>
+\begingroup
+  \catcode123=1 %
+  \catcode125=2 %
+  \def\x{LaTeX2e}%
+\expandafter\endgroup
+\ifcase 0\ifx\install y1\fi\expandafter
+         \ifx\csname processbatchFile\endcsname\relax\else1\fi
+         \ifx\fmtname\x\else 1\fi\relax
+\else\csname fi\endcsname
+%</ignore>
+%<*install>
+\input docstrip.tex
+\Msg{************************************************************************}
+\Msg{* Installation}
+\Msg{* Package: bigintcalc 2019/12/15 v1.5 Expandable calculations on big integers (HO)}
+\Msg{************************************************************************}
+
+\keepsilent
+\askforoverwritefalse
+
+\let\MetaPrefix\relax
+\preamble
+
+This is a generated file.
+
+Project: bigintcalc
+Version: 2019/12/15 v1.5
+
+Copyright (C)
+   2007, 2011, 2012 Heiko Oberdiek
+   2016-2019 Oberdiek Package Support Group
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either
+version 1.3c of this license or (at your option) any later
+version. This version of this license is in
+   https://www.latex-project.org/lppl/lppl-1-3c.txt
+and the latest version of this license is in
+   https://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainers of this work are
+Heiko Oberdiek and the Oberdiek Package Support Group
+https://github.com/ho-tex/bigintcalc/issues
+
+
+The Base Interpreter refers to any `TeX-Format',
+because some files are installed in TDS:tex/generic//.
+
+This work consists of the main source file bigintcalc.dtx
+and the derived files
+   bigintcalc.sty, bigintcalc.pdf, bigintcalc.ins, bigintcalc.drv,
+   bigintcalc-test1.tex, bigintcalc-test2.tex,
+   bigintcalc-test3.tex.
+
+\endpreamble
+\let\MetaPrefix\DoubleperCent
+
+\generate{%
+  \file{bigintcalc.ins}{\from{bigintcalc.dtx}{install}}%
+  \file{bigintcalc.drv}{\from{bigintcalc.dtx}{driver}}%
+  \usedir{tex/generic/bigintcalc}%
+  \file{bigintcalc.sty}{\from{bigintcalc.dtx}{package}}%
+}
+
+\catcode32=13\relax% active space
+\let =\space%
+\Msg{************************************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* file into a directory searched by TeX:}
+\Msg{*}
+\Msg{*     bigintcalc.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `bigintcalc.drv'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{************************************************************************}
+
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{bigintcalc.drv}%
+  [2019/12/15 v1.5 Expandable calculations on big integers (HO)]%
+\documentclass{ltxdoc}
+\usepackage{wasysym}
+\let\iint\relax
+\let\iiint\relax
+\usepackage[fleqn]{amsmath}
+
+\DeclareMathOperator{\opInv}{Inv}
+\DeclareMathOperator{\opAbs}{Abs}
+\DeclareMathOperator{\opSgn}{Sgn}
+\DeclareMathOperator{\opMin}{Min}
+\DeclareMathOperator{\opMax}{Max}
+\DeclareMathOperator{\opCmp}{Cmp}
+\DeclareMathOperator{\opOdd}{Odd}
+\DeclareMathOperator{\opInc}{Inc}
+\DeclareMathOperator{\opDec}{Dec}
+\DeclareMathOperator{\opAdd}{Add}
+\DeclareMathOperator{\opSub}{Sub}
+\DeclareMathOperator{\opShl}{Shl}
+\DeclareMathOperator{\opShr}{Shr}
+\DeclareMathOperator{\opMul}{Mul}
+\DeclareMathOperator{\opSqr}{Sqr}
+\DeclareMathOperator{\opFac}{Fac}
+\DeclareMathOperator{\opPow}{Pow}
+\DeclareMathOperator{\opDiv}{Div}
+\DeclareMathOperator{\opMod}{Mod}
+\DeclareMathOperator{\opInt}{Int}
+\DeclareMathOperator{\opODD}{ifodd}
+
+\newcommand*{\Def}{%
+  \ensuremath{%
+    \mathrel{\mathop{:}}=%
+  }%
+}
+\newcommand*{\op}[1]{%
+  \textsf{#1}%
+}
+\usepackage{holtxdoc}[2011/11/22]
+\begin{document}
+  \DocInput{bigintcalc.dtx}%
+\end{document}
+%</driver>
+% \fi
+%
+%
+%
+% \GetFileInfo{bigintcalc.drv}
+%
+% \title{The \xpackage{bigintcalc} package}
+% \date{2019/12/15 v1.5}
+% \author{Heiko Oberdiek\thanks
+% {Please report any issues at \url{https://github.com/ho-tex/bigintcalc/issues}}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package provides expandable arithmetic operations
+% with big integers that can exceed \TeX's number limits.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Documentation}
+%
+% \subsection{Introduction}
+%
+% Package \xpackage{bigintcalc} defines arithmetic operations
+% that deal with big integers. Big integers can be given
+% either as explicit integer number or as macro code
+% that expands to an explicit number. \emph{Big} means that
+% there is no limit on the size of the number. Big integers
+% may exceed \TeX's range limitation of -2147483647 and 2147483647.
+% Only memory issues will limit the usable range.
+%
+% In opposite to package \xpackage{intcalc}
+% unexpandable command tokens are not supported, even if
+% they are valid \TeX\ numbers like count registers or
+% commands created by \cs{chardef}. Nevertheless they may
+% be used, if they are prefixed by \cs{number}.
+%
+% Also \eTeX's \cs{numexpr} expressions are not supported
+% directly in the manner of package \xpackage{intcalc}.
+% However they can be given if \cs{the}\cs{numexpr}
+% or \cs{number}\cs{numexpr} are used.
+%
+% The operations have the form of macros that take one or
+% two integers as parameter and return the integer result.
+% The macro name is a three letter operation name prefixed
+% by the package name, e.g. \cs{bigintcalcAdd}|{10}{43}| returns
+% |53|.
+%
+% The macros are fully expandable, exactly two expansion
+% steps generate the result. Therefore the operations
+% may be used nearly everywhere in \TeX, even inside
+% \cs{csname}, file names,  or other
+% expandable contexts.
+%
+% \subsection{Conditions}
+%
+% \subsubsection{Preconditions}
+%
+% \begin{itemize}
+% \item
+%   Arguments can be anything that expands to a number that consists
+%   of optional signs and digits.
+% \item
+%   The arguments and return values must be sound.
+%   Zero as divisor or factorials of negative numbers will cause errors.
+% \end{itemize}
+%
+% \subsubsection{Postconditions}
+%
+% Additional properties of the macros apart from calculating
+% a correct result (of course \smiley):
+% \begin{itemize}
+% \item
+%   The macros are fully expandable. Thus they can
+%   be used inside \cs{edef}, \cs{csname},
+%   for example.
+% \item
+%   Furthermore exactly two expansion steps calculate the result.
+% \item
+%   The number consists of one optional minus sign and one or more
+%   digits. The first digit is larger than zero for
+%   numbers that consists of more than one digit.
+%
+%   In short, the number format is exactly the same as
+%   \cs{number} generates, but without its range limitation.
+%   And the tokens (minus sign, digits)
+%   have catcode 12 (other).
+% \item
+%   Call by value is simulated. First the arguments are
+%   converted to numbers. Then these numbers are used
+%   in the calculations.
+%
+%   Remember that arguments
+%   may contain expensive macros or \eTeX\ expressions.
+%   This strategy avoids multiple evaluations of such
+%   arguments.
+% \end{itemize}
+%
+% \subsection{Error handling}
+%
+% Some errors are detected by the macros, example: division by zero.
+% In this cases an undefined control sequence is called and causes
+% a TeX error message, example: \cs{BigIntCalcError:DivisionByZero}.
+% The name of the control sequence contains
+% the reason for the error. The \TeX\ error may be ignored.
+% Then the operation returns zero as result.
+% Because the macros are supposed to work in expandible contexts.
+% An traditional error message, however, is not expandable and
+% would break these contexts.
+%
+% \subsection{Operations}
+%
+% Some definition equations below use the function $\opInt$
+% that converts a real number to an integer. The number
+% is truncated that means rounding to zero:
+% \begin{gather*}
+%   \opInt(x) \Def
+%   \begin{cases}
+%     \lfloor x\rfloor & \text{if $x\geq0$}\\
+%     \lceil x\rceil & \text{otherwise}
+%   \end{cases}
+% \end{gather*}
+%
+% \subsubsection{\op{Num}}
+%
+% \begin{declcs}{bigintcalcNum} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcNum} converts its argument to a normalized integer
+% number without unnecessary leading zeros or signs.
+% The result matches the regular expression:
+%\begin{quote}
+%\begin{verbatim}
+%0|-?[1-9][0-9]*
+%\end{verbatim}
+%\end{quote}
+%
+% \subsubsection{\op{Inv}, \op{Abs}, \op{Sgn}}
+%
+% \begin{declcs}{bigintcalcInv} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcInv} switches the sign.
+% \begin{gather*}
+%   \opInv(x) \Def -x
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcAbs} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcAbs} returns the absolute value
+% of integer \meta{x}.
+% \begin{gather*}
+%   \opAbs(x) \Def \vert x\vert
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcSgn} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcSgn} encodes the sign of \meta{x} as number.
+% \begin{gather*}
+%   \opSgn(x) \Def
+%   \begin{cases}
+%     -1& \text{if $x<0$}\\
+%      0& \text{if $x=0$}\\
+%      1& \text{if $x>0$}
+%   \end{cases}
+% \end{gather*}
+% These return values can easily be distinguished by \cs{ifcase}:
+%\begin{quote}
+%\begin{verbatim}
+%\ifcase\bigintcalcSgn{<x>}
+%  $x=0$
+%\or
+%  $x>0$
+%\else
+%  $x<0$
+%\fi
+%\end{verbatim}
+%\end{quote}
+%
+% \subsubsection{\op{Min}, \op{Max}, \op{Cmp}}
+%
+% \begin{declcs}{bigintcalcMin} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcMin} returns the smaller of the two integers.
+% \begin{gather*}
+%   \opMin(x,y) \Def
+%   \begin{cases}
+%     x & \text{if $x<y$}\\
+%     y & \text{otherwise}
+%   \end{cases}
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcMax} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcMax} returns the larger of the two integers.
+% \begin{gather*}
+%   \opMax(x,y) \Def
+%   \begin{cases}
+%     x & \text{if $x>y$}\\
+%     y & \text{otherwise}
+%   \end{cases}
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcCmp} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcCmp} encodes the comparison result as number:
+% \begin{gather*}
+%   \opCmp(x,y) \Def
+%   \begin{cases}
+%     -1 & \text{if $x<y$}\\
+%      0 & \text{if $x=y$}\\
+%      1 & \text{if $x>y$}
+%   \end{cases}
+% \end{gather*}
+% These values can be distinguished by \cs{ifcase}:
+%\begin{quote}
+%\begin{verbatim}
+%\ifcase\bigintcalcCmp{<x>}{<y>}
+%  $x=y$
+%\or
+%  $x>y$
+%\else
+%  $x<y$
+%\fi
+%\end{verbatim}
+%\end{quote}
+%
+% \subsubsection{\op{Odd}}
+%
+% \begin{declcs}{bigintcalcOdd} \M{x}
+% \end{declcs}
+% \begin{gather*}
+%   \opOdd(x) \Def
+%   \begin{cases}
+%     1 & \text{if $x$ is odd}\\
+%     0 & \text{if $x$ is even}
+%   \end{cases}
+% \end{gather*}
+%
+% \subsubsection{\op{Inc}, \op{Dec}, \op{Add}, \op{Sub}}
+%
+% \begin{declcs}{bigintcalcInc} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcInc} increments \meta{x} by one.
+% \begin{gather*}
+%   \opInc(x) \Def x + 1
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcDec} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcDec} decrements \meta{x} by one.
+% \begin{gather*}
+%   \opDec(x) \Def x - 1
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcAdd} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcAdd} adds the two numbers.
+% \begin{gather*}
+%   \opAdd(x, y) \Def x + y
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcSub} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcSub} calculates the difference.
+% \begin{gather*}
+%   \opSub(x, y) \Def x - y
+% \end{gather*}
+%
+% \subsubsection{\op{Shl}, \op{Shr}}
+%
+% \begin{declcs}{bigintcalcShl} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcShl} implements shifting to the left that
+% means the number is multiplied by two.
+% The sign is preserved.
+% \begin{gather*}
+%   \opShl(x) \Def x*2
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcShr} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcShr} implements shifting to the right.
+% That is equivalent to an integer division by two.
+% The sign is preserved.
+% \begin{gather*}
+%   \opShr(x) \Def \opInt(x/2)
+% \end{gather*}
+%
+% \subsubsection{\op{Mul}, \op{Sqr}, \op{Fac}, \op{Pow}}
+%
+% \begin{declcs}{bigintcalcMul} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcMul} calculates the product of
+% \meta{x} and \meta{y}.
+% \begin{gather*}
+%   \opMul(x,y) \Def x*y
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcSqr} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcSqr} returns the square product.
+% \begin{gather*}
+%   \opSqr(x) \Def x^2
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcFac} \M{x}
+% \end{declcs}
+% Macro \cs{bigintcalcFac} returns the factorial of \meta{x}.
+% Negative numbers are not permitted.
+% \begin{gather*}
+%   \opFac(x) \Def x!\qquad\text{for $x\geq0$}
+% \end{gather*}
+% ($0! = 1$)
+%
+% \begin{declcs}{bigintcalcPow} M{x} M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcPow} calculates the value of \meta{x} to the
+% power of \meta{y}. The error ``division by zero'' is thrown
+% if \meta{x} is zero and \meta{y} is negative.
+% permitted:
+% \begin{gather*}
+%   \opPow(x,y) \Def
+%   \opInt(x^y)\qquad\text{for $x\neq0$ or $y\geq0$}
+% \end{gather*}
+% ($0^0 = 1$)
+%
+% \subsubsection{\op{Div}, \op{Mul}}
+%
+% \begin{declcs}{bigintcalcDiv} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcDiv} performs an integer division.
+% Argument \meta{y} must not be zero.
+% \begin{gather*}
+%   \opDiv(x,y) \Def \opInt(x/y)\qquad\text{for $y\neq0$}
+% \end{gather*}
+%
+% \begin{declcs}{bigintcalcMod} \M{x} \M{y}
+% \end{declcs}
+% Macro \cs{bigintcalcMod} gets the remainder of the integer
+% division. The sign follows the divisor \meta{y}.
+% Argument \meta{y} must not be zero.
+% \begin{gather*}
+%   \opMod(x,y) \Def x\mathrel{\%}y\qquad\text{for $y\neq0$}
+% \end{gather*}
+% The result ranges:
+% \begin{gather*}
+%   -\vert y\vert < \opMod(x,y) \leq 0\qquad\text{for $y<0$}\\
+%   0 \leq \opMod(x,y) < y\qquad\text{for $y\geq0$}
+% \end{gather*}
+%
+% \subsection{Interface for programmers}
+%
+% If the programmer can ensure some more properties about
+% the arguments of the operations, then the following
+% macros are a little more efficient.
+%
+% In general numbers must obey the following constraints:
+% \begin{itemize}
+% \item Plain number: digit tokens only, no command tokens.
+% \item Non-negative. Signs are forbidden.
+% \item Delimited by exclamation mark. Curly braces
+%       around the number are not allowed and will
+%       break the code.
+% \end{itemize}
+%
+% \begin{declcs}{BigIntCalcOdd} \meta{number} |!|
+% \end{declcs}
+% |1|/|0| is returned if \meta{number} is odd/even.
+%
+% \begin{declcs}{BigIntCalcInc} \meta{number} |!|
+% \end{declcs}
+% Incrementation.
+%
+% \begin{declcs}{BigIntCalcDec} \meta{number} |!|
+% \end{declcs}
+% Decrementation, positive number without zero.
+%
+% \begin{declcs}{BigIntCalcAdd} \meta{number A} |!| \meta{number B} |!|
+% \end{declcs}
+% Addition, $A\geq B$.
+%
+% \begin{declcs}{BigIntCalcSub} \meta{number A} |!| \meta{number B} |!|
+% \end{declcs}
+% Subtraction, $A\geq B$.
+%
+% \begin{declcs}{BigIntCalcShl} \meta{number} |!|
+% \end{declcs}
+% Left shift (multiplication with two).
+%
+% \begin{declcs}{BigIntCalcShr} \meta{number} |!|
+% \end{declcs}
+% Right shift (integer division by two).
+%
+% \begin{declcs}{BigIntCalcMul} \meta{number A} |!| \meta{number B} |!|
+% \end{declcs}
+% Multiplication, $A\geq B$.
+%
+% \begin{declcs}{BigIntCalcDiv} \meta{number A} |!| \meta{number B} |!|
+% \end{declcs}
+% Division operation.
+%
+% \begin{declcs}{BigIntCalcMod} \meta{number A} |!| \meta{number B} |!|
+% \end{declcs}
+% Modulo operation.
+%
+%
+% \StopEventually{
+% }
+%
+% \section{Implementation}
+%
+%    \begin{macrocode}
+%<*package>
+%    \end{macrocode}
+%
+% \subsection{Reload check and package identification}
+%    Reload check, especially if the package is not used with \LaTeX.
+%    \begin{macrocode}
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+  \catcode13=5 % ^^M
+  \endlinechar=13 %
+  \catcode35=6 % #
+  \catcode39=12 % '
+  \catcode44=12 % ,
+  \catcode45=12 % -
+  \catcode46=12 % .
+  \catcode58=12 % :
+  \catcode64=11 % @
+  \catcode123=1 % {
+  \catcode125=2 % }
+  \expandafter\let\expandafter\x\csname ver at bigintcalc.sty\endcsname
+  \ifx\x\relax % plain-TeX, first loading
+  \else
+    \def\empty{}%
+    \ifx\x\empty % LaTeX, first loading,
+      % variable is initialized, but \ProvidesPackage not yet seen
+    \else
+      \expandafter\ifx\csname PackageInfo\endcsname\relax
+        \def\x#1#2{%
+          \immediate\write-1{Package #1 Info: #2.}%
+        }%
+      \else
+        \def\x#1#2{\PackageInfo{#1}{#2, stopped}}%
+      \fi
+      \x{bigintcalc}{The package is already loaded}%
+      \aftergroup\endinput
+    \fi
+  \fi
+\endgroup%
+%    \end{macrocode}
+%    Package identification:
+%    \begin{macrocode}
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+  \catcode13=5 % ^^M
+  \endlinechar=13 %
+  \catcode35=6 % #
+  \catcode39=12 % '
+  \catcode40=12 % (
+  \catcode41=12 % )
+  \catcode44=12 % ,
+  \catcode45=12 % -
+  \catcode46=12 % .
+  \catcode47=12 % /
+  \catcode58=12 % :
+  \catcode64=11 % @
+  \catcode91=12 % [
+  \catcode93=12 % ]
+  \catcode123=1 % {
+  \catcode125=2 % }
+  \expandafter\ifx\csname ProvidesPackage\endcsname\relax
+    \def\x#1#2#3[#4]{\endgroup
+      \immediate\write-1{Package: #3 #4}%
+      \xdef#1{#4}%
+    }%
+  \else
+    \def\x#1#2[#3]{\endgroup
+      #2[{#3}]%
+      \ifx#1\@undefined
+        \xdef#1{#3}%
+      \fi
+      \ifx#1\relax
+        \xdef#1{#3}%
+      \fi
+    }%
+  \fi
+\expandafter\x\csname ver at bigintcalc.sty\endcsname
+\ProvidesPackage{bigintcalc}%
+  [2019/12/15 v1.5 Expandable calculations on big integers (HO)]%
+%    \end{macrocode}
+%
+% \subsection{Catcodes}
+%
+%    \begin{macrocode}
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+  \catcode13=5 % ^^M
+  \endlinechar=13 %
+  \catcode123=1 % {
+  \catcode125=2 % }
+  \catcode64=11 % @
+  \def\x{\endgroup
+    \expandafter\edef\csname BIC at AtEnd\endcsname{%
+      \endlinechar=\the\endlinechar\relax
+      \catcode13=\the\catcode13\relax
+      \catcode32=\the\catcode32\relax
+      \catcode35=\the\catcode35\relax
+      \catcode61=\the\catcode61\relax
+      \catcode64=\the\catcode64\relax
+      \catcode123=\the\catcode123\relax
+      \catcode125=\the\catcode125\relax
+    }%
+  }%
+\x\catcode61\catcode48\catcode32=10\relax%
+\catcode13=5 % ^^M
+\endlinechar=13 %
+\catcode35=6 % #
+\catcode64=11 % @
+\catcode123=1 % {
+\catcode125=2 % }
+\def\TMP at EnsureCode#1#2{%
+  \edef\BIC at AtEnd{%
+    \BIC at AtEnd
+    \catcode#1=\the\catcode#1\relax
+  }%
+  \catcode#1=#2\relax
+}
+\TMP at EnsureCode{33}{12}% !
+\TMP at EnsureCode{36}{14}% $ (comment!)
+\TMP at EnsureCode{38}{14}% & (comment!)
+\TMP at EnsureCode{40}{12}% (
+\TMP at EnsureCode{41}{12}% )
+\TMP at EnsureCode{42}{12}% *
+\TMP at EnsureCode{43}{12}% +
+\TMP at EnsureCode{45}{12}% -
+\TMP at EnsureCode{46}{12}% .
+\TMP at EnsureCode{47}{12}% /
+\TMP at EnsureCode{58}{11}% : (letter!)
+\TMP at EnsureCode{60}{12}% <
+\TMP at EnsureCode{62}{12}% >
+\TMP at EnsureCode{63}{14}% ? (comment!)
+\TMP at EnsureCode{91}{12}% [
+\TMP at EnsureCode{93}{12}% ]
+\edef\BIC at AtEnd{\BIC at AtEnd\noexpand\endinput}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname BIC at TestMode\endcsname\relax
+\else
+  \catcode63=9 % ? (ignore)
+\fi
+? \let\BIC@@TestMode\BIC at TestMode
+%    \end{macrocode}
+%
+% \subsection{\eTeX\ detection}
+%
+%    \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname numexpr\endcsname\relax
+  \catcode36=9 % $ (ignore)
+\else
+  \catcode38=9 % & (ignore)
+\fi
+%    \end{macrocode}
+%
+% \subsection{Help macros}
+%
+%    \begin{macro}{\BIC at Fi}
+%    \begin{macrocode}
+\let\BIC at Fi\fi
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at AfterFi}
+%    \begin{macrocode}
+\def\BIC at AfterFi#1#2\BIC at Fi{\fi#1}%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at AfterFiFi}
+%    \begin{macrocode}
+\def\BIC at AfterFiFi#1#2\BIC at Fi{\fi\fi#1}%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at AfterFiFiFi}
+%    \begin{macrocode}
+\def\BIC at AfterFiFiFi#1#2\BIC at Fi{\fi\fi\fi#1}%
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macro}{\BIC at Space}
+%    \begin{macrocode}
+\begingroup
+  \def\x#1{\endgroup
+    \let\BIC at Space= #1%
+  }%
+\x{ }
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsection{Expand number}
+%
+%    \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+  \def\TMP at RequirePackage#1[#2]{%
+    \begingroup\expandafter\expandafter\expandafter\endgroup
+    \expandafter\ifx\csname ver@#1.sty\endcsname\relax
+      \input #1.sty\relax
+    \fi
+  }%
+  \TMP at RequirePackage{pdftexcmds}[2007/11/11]%
+\else
+  \RequirePackage{pdftexcmds}[2007/11/11]%
+\fi
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdf at escapehex\endcsname\relax
+%    \end{macrocode}
+%
+%    \begin{macro}{\BIC at Expand}
+%    \begin{macrocode}
+  \def\BIC at Expand#1{%
+    \romannumeral0%
+    \BIC@@Expand#1!\@nil{}%
+  }%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@Expand}
+%    \begin{macrocode}
+  \def\BIC@@Expand#1#2\@nil#3{%
+    \expandafter\ifcat\noexpand#1\relax
+      \expandafter\@firstoftwo
+    \else
+      \expandafter\@secondoftwo
+    \fi
+    {%
+      \expandafter\BIC@@Expand#1#2\@nil{#3}%
+    }{%
+      \ifx#1!%
+        \expandafter\@firstoftwo
+      \else
+        \expandafter\@secondoftwo
+      \fi
+      { #3}{%
+        \BIC@@Expand#2\@nil{#3#1}%
+      }%
+    }%
+  }%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\@firstoftwo}
+%    \begin{macrocode}
+  \expandafter\ifx\csname @firstoftwo\endcsname\relax
+    \long\def\@firstoftwo#1#2{#1}%
+  \fi
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\@secondoftwo}
+%    \begin{macrocode}
+  \expandafter\ifx\csname @secondoftwo\endcsname\relax
+    \long\def\@secondoftwo#1#2{#2}%
+  \fi
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macrocode}
+\else
+%    \end{macrocode}
+%    \begin{macro}{\BIC at Expand}
+%    \begin{macrocode}
+  \def\BIC at Expand#1{%
+    \romannumeral0\expandafter\expandafter\expandafter\BIC at Space
+    \pdf at unescapehex{%
+      \expandafter\expandafter\expandafter
+      \BIC at StripHexSpace\pdf at escapehex{#1}20\@nil
+    }%
+  }%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at StripHexSpace}
+%    \begin{macrocode}
+  \def\BIC at StripHexSpace#120#2\@nil{%
+    #1%
+    \ifx\\#2\\%
+    \else
+      \BIC at AfterFi{%
+        \BIC at StripHexSpace#2\@nil
+      }%
+    \BIC at Fi
+  }%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macrocode}
+\fi
+%    \end{macrocode}
+%
+% \subsection{Normalize expanded number}
+%
+%    \begin{macro}{\BIC at Normalize}
+%    |#1|: result sign\\
+%    |#2|: first token of number
+%    \begin{macrocode}
+\def\BIC at Normalize#1#2{%
+  \ifx#2-%
+    \ifx\\#1\\%
+      \BIC at AfterFiFi{%
+        \BIC at Normalize-%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at Normalize{}%
+      }%
+    \fi
+  \else
+    \ifx#2+%
+      \BIC at AfterFiFi{%
+        \BIC at Normalize{#1}%
+      }%
+    \else
+      \ifx#20%
+        \BIC at AfterFiFiFi{%
+          \BIC at NormalizeZero{#1}%
+        }%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at NormalizeDigits#1#2%
+        }%
+      \fi
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at NormalizeZero}
+%    \begin{macrocode}
+\def\BIC at NormalizeZero#1#2{%
+  \ifx#2!%
+    \BIC at AfterFi{ 0}%
+  \else
+    \ifx#20%
+      \BIC at AfterFiFi{%
+        \BIC at NormalizeZero{#1}%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at NormalizeDigits#1#2%
+      }%
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at NormalizeDigits}
+%    \begin{macrocode}
+\def\BIC at NormalizeDigits#1!{ #1}
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsection{\op{Num}}
+%
+%    \begin{macro}{\bigintcalcNum}
+%    \begin{macrocode}
+\def\bigintcalcNum#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Normalize
+  \expandafter\expandafter\expandafter{%
+  \expandafter\expandafter\expandafter}%
+  \BIC at Expand{#1}!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsection{\op{Inv}, \op{Abs}, \op{Sgn}}
+%
+%
+%    \begin{macro}{\bigintcalcInv}
+%    \begin{macrocode}
+\def\bigintcalcInv#1{%
+  \romannumeral0\expandafter\expandafter\expandafter\BIC at Space
+  \bigintcalcNum{-#1}%
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macro}{\bigintcalcAbs}
+%    \begin{macrocode}
+\def\bigintcalcAbs#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Abs
+  \bigintcalcNum{#1}%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at Abs}
+%    \begin{macrocode}
+\def\BIC at Abs#1{%
+  \ifx#1-%
+    \expandafter\BIC at Space
+  \else
+    \expandafter\BIC at Space
+    \expandafter#1%
+  \fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macro}{\bigintcalcSgn}
+%    \begin{macrocode}
+\def\bigintcalcSgn#1{%
+  \number
+  \expandafter\expandafter\expandafter\BIC at Sgn
+  \bigintcalcNum{#1}! %
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at Sgn}
+%    \begin{macrocode}
+\def\BIC at Sgn#1#2!{%
+  \ifx#1-%
+    -1%
+  \else
+    \ifx#10%
+      0%
+    \else
+      1%
+    \fi
+  \fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsection{\op{Cmp}, \op{Min}, \op{Max}}
+%
+%    \begin{macro}{\bigintcalcCmp}
+%    \begin{macrocode}
+\def\bigintcalcCmp#1#2{%
+  \number
+  \expandafter\expandafter\expandafter\BIC at Cmp
+  \bigintcalcNum{#2}!{#1}%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at Cmp}
+%    \begin{macrocode}
+\def\BIC at Cmp#1!#2{%
+  \expandafter\expandafter\expandafter\BIC@@Cmp
+  \bigintcalcNum{#2}!#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@Cmp}
+%    \begin{macrocode}
+\def\BIC@@Cmp#1#2!#3#4!{%
+  \ifx#1-%
+    \ifx#3-%
+      \BIC at AfterFiFi{%
+        \BIC@@Cmp#4!#2!%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        -1 %
+      }%
+    \fi
+  \else
+    \ifx#3-%
+      \BIC at AfterFiFi{%
+        1 %
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at CmpLength#1#2!#3#4!#1#2!#3#4!%
+      }%
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at PosCmp}
+%    \begin{macrocode}
+\def\BIC at PosCmp#1!#2!{%
+  \BIC at CmpLength#1!#2!#1!#2!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at CmpLength}
+%    \begin{macrocode}
+\def\BIC at CmpLength#1#2!#3#4!{%
+  \ifx\\#2\\%
+    \ifx\\#4\\%
+      \BIC at AfterFiFi\BIC at CmpDiff
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at CmpResult{-1}%
+      }%
+    \fi
+  \else
+    \ifx\\#4\\%
+      \BIC at AfterFiFi{%
+        \BIC at CmpResult1%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at CmpLength#2!#4!%
+      }%
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at CmpResult}
+%    \begin{macrocode}
+\def\BIC at CmpResult#1#2!#3!{#1 }
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at CmpDiff}
+%    \begin{macrocode}
+\def\BIC at CmpDiff#1#2!#3#4!{%
+  \ifnum#1<#3 %
+    \BIC at AfterFi{%
+      -1 %
+    }%
+  \else
+    \ifnum#1>#3 %
+      \BIC at AfterFiFi{%
+        1 %
+      }%
+    \else
+      \ifx\\#2\\%
+        \BIC at AfterFiFiFi{%
+          0 %
+        }%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at CmpDiff#2!#4!%
+        }%
+      \fi
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macro}{\bigintcalcMin}
+%    \begin{macrocode}
+\def\bigintcalcMin#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at MinMax
+  \bigintcalcNum{#1}!-!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\bigintcalcMax}
+%    \begin{macrocode}
+\def\bigintcalcMax#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at MinMax
+  \bigintcalcNum{#1}!!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at MinMax}
+%    |#1|: $x$\\
+%    |#2|: sign for comparison\\
+%    |#3|: $y$
+%    \begin{macrocode}
+\def\BIC at MinMax#1!#2!#3{%
+  \expandafter\expandafter\expandafter\BIC@@MinMax
+  \bigintcalcNum{#3}!#1!#2!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@MinMax}
+%    |#1|: $y$\\
+%    |#2|: $x$\\
+%    |#3|: sign for comparison
+%    \begin{macrocode}
+\def\BIC@@MinMax#1!#2!#3!{%
+  \ifnum\BIC@@Cmp#1!#2!=#31 %
+    \BIC at AfterFi{ #1}%
+  \else
+    \BIC at AfterFi{ #2}%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsection{\op{Odd}}
+%
+%    \begin{macro}{\bigintcalcOdd}
+%    \begin{macrocode}
+\def\bigintcalcOdd#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Odd
+  \bigintcalcAbs{#1}!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BigIntCalcOdd}
+%    \begin{macrocode}
+\def\BigIntCalcOdd#1!{%
+  \romannumeral0%
+  \BIC at Odd#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at Odd}
+%    |#1|: $x$
+%    \begin{macrocode}
+\def\BIC at Odd#1#2{%
+  \ifx#2!%
+    \ifodd#1 %
+      \BIC at AfterFiFi{ 1}%
+    \else
+      \BIC at AfterFiFi{ 0}%
+    \fi
+  \else
+    \expandafter\BIC at Odd\expandafter#2%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsection{\op{Inc}, \op{Dec}}
+%
+%    \begin{macro}{\bigintcalcInc}
+%    \begin{macrocode}
+\def\bigintcalcInc#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at IncSwitch
+  \bigintcalcNum{#1}!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at IncSwitch}
+%    \begin{macrocode}
+\def\BIC at IncSwitch#1#2!{%
+  \ifcase\BIC@@Cmp#1#2!-1!%
+    \BIC at AfterFi{ 0}%
+  \or
+    \BIC at AfterFi{%
+      \BIC at Inc#1#2!{}%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \expandafter-\romannumeral0%
+      \BIC at Dec#2!{}%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macro}{\bigintcalcDec}
+%    \begin{macrocode}
+\def\bigintcalcDec#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at DecSwitch
+  \bigintcalcNum{#1}!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at DecSwitch}
+%    \begin{macrocode}
+\def\BIC at DecSwitch#1#2!{%
+  \ifcase\BIC at Sgn#1#2! %
+    \BIC at AfterFi{ -1}%
+  \or
+    \BIC at AfterFi{%
+      \BIC at Dec#1#2!{}%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \expandafter-\romannumeral0%
+      \BIC at Inc#2!{}%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macro}{\BigIntCalcInc}
+%    \begin{macrocode}
+\def\BigIntCalcInc#1!{%
+  \romannumeral0\BIC at Inc#1!{}%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BigIntCalcDec}
+%    \begin{macrocode}
+\def\BigIntCalcDec#1!{%
+  \romannumeral0\BIC at Dec#1!{}%
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macro}{\BIC at Inc}
+%    \begin{macrocode}
+\def\BIC at Inc#1#2!#3{%
+  \ifx\\#2\\%
+    \BIC at AfterFi{%
+      \BIC@@Inc1#1#3!{}%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \BIC at Inc#2!{#1#3}%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@Inc}
+%    \begin{macrocode}
+\def\BIC@@Inc#1#2#3!#4{%
+  \ifcase#1 %
+    \ifx\\#3\\%
+      \BIC at AfterFiFi{ #2#4}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC@@Inc0#3!{#2#4}%
+      }%
+    \fi
+  \else
+    \ifnum#2<9 %
+      \BIC at AfterFiFi{%
+&       \expandafter\BIC@@@Inc\the\numexpr#2+1\relax
+$       \expandafter\expandafter\expandafter\BIC@@@Inc
+$       \ifcase#2 \expandafter1%
+$       \or\expandafter2%
+$       \or\expandafter3%
+$       \or\expandafter4%
+$       \or\expandafter5%
+$       \or\expandafter6%
+$       \or\expandafter7%
+$       \or\expandafter8%
+$       \or\expandafter9%
+$?      \else\BigIntCalcError:ThisCannotHappen%
+$       \fi
+        0#3!{#4}%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC@@@Inc01#3!{#4}%
+      }%
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@@Inc}
+%    \begin{macrocode}
+\def\BIC@@@Inc#1#2#3!#4{%
+  \ifx\\#3\\%
+    \ifnum#2=1 %
+      \BIC at AfterFiFi{ 1#1#4}%
+    \else
+      \BIC at AfterFiFi{ #1#4}%
+    \fi
+  \else
+    \BIC at AfterFi{%
+      \BIC@@Inc#2#3!{#1#4}%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macro}{\BIC at Dec}
+%    \begin{macrocode}
+\def\BIC at Dec#1#2!#3{%
+  \ifx\\#2\\%
+    \BIC at AfterFi{%
+      \BIC@@Dec1#1#3!{}%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \BIC at Dec#2!{#1#3}%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@Dec}
+%    \begin{macrocode}
+\def\BIC@@Dec#1#2#3!#4{%
+  \ifcase#1 %
+    \ifx\\#3\\%
+      \BIC at AfterFiFi{ #2#4}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC@@Dec0#3!{#2#4}%
+      }%
+    \fi
+  \else
+    \ifnum#2>0 %
+      \BIC at AfterFiFi{%
+&       \expandafter\BIC@@@Dec\the\numexpr#2-1\relax
+$       \expandafter\expandafter\expandafter\BIC@@@Dec
+$       \ifcase#2
+$?        \BigIntCalcError:ThisCannotHappen%
+$       \or\expandafter0%
+$       \or\expandafter1%
+$       \or\expandafter2%
+$       \or\expandafter3%
+$       \or\expandafter4%
+$       \or\expandafter5%
+$       \or\expandafter6%
+$       \or\expandafter7%
+$       \or\expandafter8%
+$?      \else\BigIntCalcError:ThisCannotHappen%
+$       \fi
+        0#3!{#4}%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC@@@Dec91#3!{#4}%
+      }%
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@@Dec}
+%    \begin{macrocode}
+\def\BIC@@@Dec#1#2#3!#4{%
+  \ifx\\#3\\%
+    \ifcase#1 %
+      \ifx\\#4\\%
+        \BIC at AfterFiFiFi{ 0}%
+      \else
+        \BIC at AfterFiFiFi{ #4}%
+      \fi
+    \else
+      \BIC at AfterFiFi{ #1#4}%
+    \fi
+  \else
+    \BIC at AfterFi{%
+      \BIC@@Dec#2#3!{#1#4}%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsection{\op{Add}, \op{Sub}}
+%
+%    \begin{macro}{\bigintcalcAdd}
+%    \begin{macrocode}
+\def\bigintcalcAdd#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Add
+  \bigintcalcNum{#1}!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at Add}
+%    \begin{macrocode}
+\def\BIC at Add#1!#2{%
+  \expandafter\expandafter\expandafter
+  \BIC at AddSwitch\bigintcalcNum{#2}!#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\bigintcalcSub}
+%    \begin{macrocode}
+\def\bigintcalcSub#1#2{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Add
+  \bigintcalcNum{-#2}!{#1}%
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macro}{\BIC at AddSwitch}
+%    Decision table for \cs{BIC at AddSwitch}.
+%    \begin{quote}
+%    \begin{tabular}[t]{@{}|l|l|l|l|l|@{}}
+%      \hline
+%      $x<0$ & $y<0$ & $-x>-y$ & $-$ & $\opAdd(-x,-y)$\\
+%      \cline{3-3}\cline{5-5}
+%            &       & else    &     & $\opAdd(-y,-x)$\\
+%      \cline{2-5}
+%            & else  & $-x> y$ & $-$ & $\opSub(-x, y)$\\
+%      \cline{3-5}
+%            &       & $-x= y$ &     & $0$\\
+%      \cline{3-5}
+%            &       & else    & $+$ & $\opSub( y,-x)$\\
+%      \hline
+%      else  & $y<0$ & $ x>-y$ & $+$ & $\opSub( x,-y)$\\
+%      \cline{3-5}
+%            &       & $ x=-y$ &     & $0$\\
+%      \cline{3-5}
+%            &       & else    & $-$ & $\opSub(-y, x)$\\
+%      \cline{2-5}
+%            & else  & $ x> y$ & $+$ & $\opAdd( x, y)$\\
+%      \cline{3-3}\cline{5-5}
+%            &       & else    &     & $\opAdd( y, x)$\\
+%      \hline
+%    \end{tabular}
+%    \end{quote}
+%    \begin{macrocode}
+\def\BIC at AddSwitch#1#2!#3#4!{%
+  \ifx#1-% x < 0
+    \ifx#3-% y < 0
+      \expandafter-\romannumeral0%
+      \ifnum\BIC at PosCmp#2!#4!=1 % -x > -y
+        \BIC at AfterFiFiFi{%
+          \BIC at AddXY#2!#4!!!%
+        }%
+      \else % -x <= -y
+        \BIC at AfterFiFiFi{%
+          \BIC at AddXY#4!#2!!!%
+        }%
+      \fi
+    \else % y >= 0
+      \ifcase\BIC at PosCmp#2!#3#4!% -x = y
+        \BIC at AfterFiFiFi{ 0}%
+      \or % -x > y
+        \expandafter-\romannumeral0%
+        \BIC at AfterFiFiFi{%
+          \BIC at SubXY#2!#3#4!!!%
+        }%
+      \else % -x <= y
+        \BIC at AfterFiFiFi{%
+          \BIC at SubXY#3#4!#2!!!%
+        }%
+      \fi
+    \fi
+  \else % x >= 0
+    \ifx#3-% y < 0
+      \ifcase\BIC at PosCmp#1#2!#4!% x = -y
+        \BIC at AfterFiFiFi{ 0}%
+      \or % x > -y
+        \BIC at AfterFiFiFi{%
+          \BIC at SubXY#1#2!#4!!!%
+        }%
+      \else % x <= -y
+        \expandafter-\romannumeral0%
+        \BIC at AfterFiFiFi{%
+          \BIC at SubXY#4!#1#2!!!%
+        }%
+      \fi
+    \else % y >= 0
+      \ifnum\BIC at PosCmp#1#2!#3#4!=1 % x > y
+        \BIC at AfterFiFiFi{%
+          \BIC at AddXY#1#2!#3#4!!!%
+        }%
+      \else % x <= y
+        \BIC at AfterFiFiFi{%
+          \BIC at AddXY#3#4!#1#2!!!%
+        }%
+      \fi
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macro}{\BigIntCalcAdd}
+%    \begin{macrocode}
+\def\BigIntCalcAdd#1!#2!{%
+  \romannumeral0\BIC at AddXY#1!#2!!!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BigIntCalcSub}
+%    \begin{macrocode}
+\def\BigIntCalcSub#1!#2!{%
+  \romannumeral0\BIC at SubXY#1!#2!!!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macro}{\BIC at AddXY}
+%    \begin{macrocode}
+\def\BIC at AddXY#1#2!#3#4!#5!#6!{%
+  \ifx\\#2\\%
+    \ifx\\#3\\%
+      \BIC at AfterFiFi{%
+        \BIC at DoAdd0!#1#5!#60!%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at DoAdd0!#1#5!#3#6!%
+      }%
+    \fi
+  \else
+    \ifx\\#4\\%
+      \ifx\\#3\\%
+        \BIC at AfterFiFiFi{%
+          \BIC at AddXY#2!{}!#1#5!#60!%
+        }%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at AddXY#2!{}!#1#5!#3#6!%
+        }%
+      \fi
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at AddXY#2!#4!#1#5!#3#6!%
+      }%
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at DoAdd}
+%    |#1|: carry\\
+%    |#2|: reverted result\\
+%    |#3#4|: reverted $x$\\
+%    |#5#6|: reverted $y$
+%    \begin{macrocode}
+\def\BIC at DoAdd#1#2!#3#4!#5#6!{%
+  \ifx\\#4\\%
+    \BIC at AfterFi{%
+&     \expandafter\BIC at Space
+&     \the\numexpr#1+#3+#5\relax#2%
+$     \expandafter\expandafter\expandafter\BIC at AddResult
+$     \BIC at AddDigit#1#3#5#2%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \expandafter\expandafter\expandafter\BIC at DoAdd
+      \BIC at AddDigit#1#3#5#2!#4!#6!%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at AddResult}
+%    \begin{macrocode}
+$ \def\BIC at AddResult#1{%
+$   \ifx#10%
+$     \expandafter\BIC at Space
+$   \else
+$     \expandafter\BIC at Space\expandafter#1%
+$   \fi
+$ }%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at AddDigit}
+%    |#1|: carry\\
+%    |#2|: digit of $x$\\
+%    |#3|: digit of $y$
+%    \begin{macrocode}
+\def\BIC at AddDigit#1#2#3{%
+  \romannumeral0%
+& \expandafter\BIC@@AddDigit\the\numexpr#1+#2+#3!%
+$ \expandafter\BIC@@AddDigit\number%
+$ \csname
+$   BIC at AddCarry%
+$   \ifcase#1 %
+$     #2%
+$   \else
+$     \ifcase#2 1\or2\or3\or4\or5\or6\or7\or8\or9\or10\fi
+$   \fi
+$ \endcsname#3!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@AddDigit}
+%    \begin{macrocode}
+\def\BIC@@AddDigit#1!{%
+  \ifnum#1<10 %
+    \BIC at AfterFi{ 0#1}%
+  \else
+    \BIC at AfterFi{ #1}%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at AddCarry0}
+%    \begin{macrocode}
+$ \expandafter\def\csname BIC at AddCarry0\endcsname#1{#1}%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at AddCarry10}
+%    \begin{macrocode}
+$ \expandafter\def\csname BIC at AddCarry10\endcsname#1{1#1}%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at AddCarry[1-9]}
+%    \begin{macrocode}
+$ \def\BIC at Temp#1#2{%
+$   \expandafter\def\csname BIC at AddCarry#1\endcsname##1{%
+$     \ifcase##1 #1\or
+$     #2%
+$?    \else\BigIntCalcError:ThisCannotHappen%
+$     \fi
+$   }%
+$ }%
+$ \BIC at Temp 0{1\or2\or3\or4\or5\or6\or7\or8\or9}%
+$ \BIC at Temp 1{2\or3\or4\or5\or6\or7\or8\or9\or10}%
+$ \BIC at Temp 2{3\or4\or5\or6\or7\or8\or9\or10\or11}%
+$ \BIC at Temp 3{4\or5\or6\or7\or8\or9\or10\or11\or12}%
+$ \BIC at Temp 4{5\or6\or7\or8\or9\or10\or11\or12\or13}%
+$ \BIC at Temp 5{6\or7\or8\or9\or10\or11\or12\or13\or14}%
+$ \BIC at Temp 6{7\or8\or9\or10\or11\or12\or13\or14\or15}%
+$ \BIC at Temp 7{8\or9\or10\or11\or12\or13\or14\or15\or16}%
+$ \BIC at Temp 8{9\or10\or11\or12\or13\or14\or15\or16\or17}%
+$ \BIC at Temp 9{10\or11\or12\or13\or14\or15\or16\or17\or18}%
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macro}{\BIC at SubXY}
+%    Preconditions:
+%    \begin{itemize}
+%    \item $x > y$, $x \geq 0$, and $y >= 0$
+%    \item digits($x$) = digits($y$)
+%    \end{itemize}
+%    \begin{macrocode}
+\def\BIC at SubXY#1#2!#3#4!#5!#6!{%
+  \ifx\\#2\\%
+    \ifx\\#3\\%
+      \BIC at AfterFiFi{%
+        \BIC at DoSub0!#1#5!#60!%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at DoSub0!#1#5!#3#6!%
+      }%
+    \fi
+  \else
+    \ifx\\#4\\%
+      \ifx\\#3\\%
+        \BIC at AfterFiFiFi{%
+          \BIC at SubXY#2!{}!#1#5!#60!%
+        }%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at SubXY#2!{}!#1#5!#3#6!%
+        }%
+      \fi
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at SubXY#2!#4!#1#5!#3#6!%
+      }%
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at DoSub}
+%    |#1|: carry\\
+%    |#2|: reverted result\\
+%    |#3#4|: reverted x\\
+%    |#5#6|: reverted y
+%    \begin{macrocode}
+\def\BIC at DoSub#1#2!#3#4!#5#6!{%
+  \ifx\\#4\\%
+    \BIC at AfterFi{%
+      \expandafter\expandafter\expandafter\BIC at SubResult
+      \BIC at SubDigit#1#3#5#2%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \expandafter\expandafter\expandafter\BIC at DoSub
+      \BIC at SubDigit#1#3#5#2!#4!#6!%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at SubResult}
+%    \begin{macrocode}
+\def\BIC at SubResult#1{%
+  \ifx#10%
+    \expandafter\BIC at SubResult
+  \else
+    \expandafter\BIC at Space\expandafter#1%
+  \fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at SubDigit}
+%    |#1|: carry\\
+%    |#2|: digit of $x$\\
+%    |#3|: digit of $y$
+%    \begin{macrocode}
+\def\BIC at SubDigit#1#2#3{%
+  \romannumeral0%
+& \expandafter\BIC@@SubDigit\the\numexpr#2-#3-#1!%
+$ \expandafter\BIC@@AddDigit\number
+$   \csname
+$     BIC at SubCarry%
+$     \ifcase#1 %
+$       #3%
+$     \else
+$       \ifcase#3 1\or2\or3\or4\or5\or6\or7\or8\or9\or10\fi
+$     \fi
+$   \endcsname#2!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@SubDigit}
+%    \begin{macrocode}
+& \def\BIC@@SubDigit#1!{%
+&   \ifnum#1<0 %
+&     \BIC at AfterFi{%
+&       \expandafter\BIC at Space
+&       \expandafter1\the\numexpr#1+10\relax
+&     }%
+&   \else
+&     \BIC at AfterFi{ 0#1}%
+&   \BIC at Fi
+& }%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at SubCarry0}
+%    \begin{macrocode}
+$ \expandafter\def\csname BIC at SubCarry0\endcsname#1{#1}%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at SubCarry10}%
+%    \begin{macrocode}
+$ \expandafter\def\csname BIC at SubCarry10\endcsname#1{1#1}%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at SubCarry[1-9]}
+%    \begin{macrocode}
+$ \def\BIC at Temp#1#2{%
+$   \expandafter\def\csname BIC at SubCarry#1\endcsname##1{%
+$     \ifcase##1 #2%
+$?    \else\BigIntCalcError:ThisCannotHappen%
+$     \fi
+$   }%
+$ }%
+$ \BIC at Temp 1{19\or0\or1\or2\or3\or4\or5\or6\or7\or8}%
+$ \BIC at Temp 2{18\or19\or0\or1\or2\or3\or4\or5\or6\or7}%
+$ \BIC at Temp 3{17\or18\or19\or0\or1\or2\or3\or4\or5\or6}%
+$ \BIC at Temp 4{16\or17\or18\or19\or0\or1\or2\or3\or4\or5}%
+$ \BIC at Temp 5{15\or16\or17\or18\or19\or0\or1\or2\or3\or4}%
+$ \BIC at Temp 6{14\or15\or16\or17\or18\or19\or0\or1\or2\or3}%
+$ \BIC at Temp 7{13\or14\or15\or16\or17\or18\or19\or0\or1\or2}%
+$ \BIC at Temp 8{12\or13\or14\or15\or16\or17\or18\or19\or0\or1}%
+$ \BIC at Temp 9{11\or12\or13\or14\or15\or16\or17\or18\or19\or0}%
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsection{\op{Shl}, \op{Shr}}
+%
+%    \begin{macro}{\bigintcalcShl}
+%    \begin{macrocode}
+\def\bigintcalcShl#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Shl
+  \bigintcalcNum{#1}!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at Shl}
+%    \begin{macrocode}
+\def\BIC at Shl#1#2!{%
+  \ifx#1-%
+    \BIC at AfterFi{%
+      \expandafter-\romannumeral0%
+&     \BIC@@Shl#2!!%
+$     \BIC at AddXY#2!#2!!!%
+    }%
+  \else
+    \BIC at AfterFi{%
+&     \BIC@@Shl#1#2!!%
+$     \BIC at AddXY#1#2!#1#2!!!%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BigIntCalcShl}
+%    \begin{macrocode}
+\def\BigIntCalcShl#1!{%
+  \romannumeral0%
+& \BIC@@Shl#1!!%
+$ \BIC at AddXY#1!#1!!!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@Shl}
+%    \begin{macrocode}
+& \def\BIC@@Shl#1#2!{%
+&   \ifx\\#2\\%
+&     \BIC at AfterFi{%
+&       \BIC@@@Shl0!#1%
+&     }%
+&   \else
+&     \BIC at AfterFi{%
+&       \BIC@@Shl#2!#1%
+&     }%
+&   \BIC at Fi
+& }%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@@Shl}
+%    |#1|: carry\\
+%    |#2|: result\\
+%    |#3#4|: reverted number
+%    \begin{macrocode}
+& \def\BIC@@@Shl#1#2!#3#4!{%
+&   \ifx\\#4\\%
+&     \BIC at AfterFi{%
+&       \expandafter\BIC at Space
+&       \the\numexpr#3*2+#1\relax#2%
+&     }%
+&   \else
+&     \BIC at AfterFi{%
+&       \expandafter\BIC@@@@Shl\the\numexpr#3*2+#1!#2!#4!%
+&     }%
+&   \BIC at Fi
+& }%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@@@Shl}
+%    \begin{macrocode}
+& \def\BIC@@@@Shl#1!{%
+&   \ifnum#1<10 %
+&     \BIC at AfterFi{%
+&       \BIC@@@Shl0#1%
+&     }%
+&   \else
+&     \BIC at AfterFi{%
+&       \BIC@@@Shl#1%
+&     }%
+&   \BIC at Fi
+& }%
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macro}{\bigintcalcShr}
+%    \begin{macrocode}
+\def\bigintcalcShr#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Shr
+  \bigintcalcNum{#1}!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at Shr}
+%    \begin{macrocode}
+\def\BIC at Shr#1#2!{%
+  \ifx#1-%
+    \expandafter-\romannumeral0%
+    \BIC at AfterFi{%
+      \BIC@@Shr#2!%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \BIC@@Shr#1#2!%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BigIntCalcShr}
+%    \begin{macrocode}
+\def\BigIntCalcShr#1!{%
+  \romannumeral0%
+  \BIC@@Shr#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@Shr}
+%    \begin{macrocode}
+\def\BIC@@Shr#1#2!{%
+  \ifcase#1 %
+    \BIC at AfterFi{ 0}%
+  \or
+    \ifx\\#2\\%
+      \BIC at AfterFiFi{ 0}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC@@@Shr#1#2!!%
+      }%
+    \fi
+  \else
+    \BIC at AfterFi{%
+      \BIC@@@Shr0#1#2!!%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@@Shr}
+%    |#1|: carry\\
+%    |#2#3|: number\\
+%    |#4|: result
+%    \begin{macrocode}
+\def\BIC@@@Shr#1#2#3!#4!{%
+  \ifx\\#3\\%
+    \ifodd#1#2 %
+      \BIC at AfterFiFi{%
+&       \expandafter\BIC at ShrResult\the\numexpr(#1#2-1)/2\relax
+$       \expandafter\expandafter\expandafter\BIC at ShrResult
+$       \csname BIC at ShrDigit#1#2\endcsname
+        #4!%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+&       \expandafter\BIC at ShrResult\the\numexpr#1#2/2\relax
+$       \expandafter\expandafter\expandafter\BIC at ShrResult
+$       \csname BIC at ShrDigit#1#2\endcsname
+        #4!%
+      }%
+    \fi
+  \else
+    \ifodd#1#2 %
+      \BIC at AfterFiFi{%
+&       \expandafter\BIC@@@@Shr\the\numexpr(#1#2-1)/2\relax1%
+$       \expandafter\expandafter\expandafter\BIC@@@@Shr
+$       \csname BIC at ShrDigit#1#2\endcsname
+        #3!#4!%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+&       \expandafter\BIC@@@@Shr\the\numexpr#1#2/2\relax0%
+$       \expandafter\expandafter\expandafter\BIC@@@@Shr
+$       \csname BIC at ShrDigit#1#2\endcsname
+        #3!#4!%
+      }%
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at ShrResult}
+%    \begin{macrocode}
+& \def\BIC at ShrResult#1#2!{ #2#1}%
+$ \def\BIC at ShrResult#1#2#3!{ #3#1}%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@@@Shr}
+%    |#1|: new digit\\
+%    |#2|: carry\\
+%    |#3|: remaining number\\
+%    |#4|: result
+%    \begin{macrocode}
+\def\BIC@@@@Shr#1#2#3!#4!{%
+  \BIC@@@Shr#2#3!#4#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at ShrDigit[00-19]}
+%    \begin{macrocode}
+$ \def\BIC at Temp#1#2#3#4{%
+$   \expandafter\def\csname BIC at ShrDigit#1#2\endcsname{#3#4}%
+$ }%
+$ \BIC at Temp 0000%
+$ \BIC at Temp 0101%
+$ \BIC at Temp 0210%
+$ \BIC at Temp 0311%
+$ \BIC at Temp 0420%
+$ \BIC at Temp 0521%
+$ \BIC at Temp 0630%
+$ \BIC at Temp 0731%
+$ \BIC at Temp 0840%
+$ \BIC at Temp 0941%
+$ \BIC at Temp 1050%
+$ \BIC at Temp 1151%
+$ \BIC at Temp 1260%
+$ \BIC at Temp 1361%
+$ \BIC at Temp 1470%
+$ \BIC at Temp 1571%
+$ \BIC at Temp 1680%
+$ \BIC at Temp 1781%
+$ \BIC at Temp 1890%
+$ \BIC at Temp 1991%
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsection{\cs{BIC at Tim}}
+%
+%    \begin{macro}{\BIC at Tim}
+%    Macro \cs{BIC at Tim} implements ``Number \emph{tim}es digit''.\\
+%    |#1|: plain number without sign\\
+%    |#2|: digit
+\def\BIC at Tim#1!#2{%
+  \romannumeral0%
+  \ifcase#2 % 0
+    \BIC at AfterFi{ 0}%
+  \or % 1
+    \BIC at AfterFi{ #1}%
+  \or % 2
+    \BIC at AfterFi{%
+      \BIC at Shl#1!%
+    }%
+  \else % 3-9
+    \BIC at AfterFi{%
+      \BIC@@Tim#1!!#2%
+    }%
+  \BIC at Fi
+}
+%    \begin{macrocode}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@Tim}
+%    |#1#2|: number\\
+%    |#3|: reverted number
+%    \begin{macrocode}
+\def\BIC@@Tim#1#2!{%
+  \ifx\\#2\\%
+    \BIC at AfterFi{%
+      \BIC at ProcessTim0!#1%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \BIC@@Tim#2!#1%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at ProcessTim}
+%    |#1|: carry\\
+%    |#2|: result\\
+%    |#3#4|: reverted number\\
+%    |#5|: digit
+%    \begin{macrocode}
+\def\BIC at ProcessTim#1#2!#3#4!#5{%
+  \ifx\\#4\\%
+    \BIC at AfterFi{%
+      \expandafter\BIC at Space
+&     \the\numexpr#3*#5+#1\relax
+$     \romannumeral0\BIC at TimDigit#3#5#1%
+      #2%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \expandafter\BIC@@ProcessTim
+&     \the\numexpr#3*#5+#1%
+$     \romannumeral0\BIC at TimDigit#3#5#1%
+      !#2!#4!#5%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@ProcessTim}
+%    |#1#2|: carry?, new digit\\
+%    |#3|: new number\\
+%    |#4|: old number\\
+%    |#5|: digit
+%    \begin{macrocode}
+\def\BIC@@ProcessTim#1#2!{%
+  \ifx\\#2\\%
+    \BIC at AfterFi{%
+      \BIC at ProcessTim0#1%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \BIC at ProcessTim#1#2%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at TimDigit}
+%    |#1|: digit 0--9\\
+%    |#2|: digit 3--9\\
+%    |#3|: carry 0--9
+%    \begin{macrocode}
+$ \def\BIC at TimDigit#1#2#3{%
+$   \ifcase#1 % 0
+$     \BIC at AfterFi{ #3}%
+$   \or % 1
+$     \BIC at AfterFi{%
+$       \expandafter\BIC at Space
+$       \number\csname BIC at AddCarry#2\endcsname#3 %
+$     }%
+$   \else
+$     \ifcase#3 %
+$       \BIC at AfterFiFi{%
+$         \expandafter\BIC at Space
+$         \number\csname BIC at MulDigit#2\endcsname#1 %
+$       }%
+$     \else
+$       \BIC at AfterFiFi{%
+$         \expandafter\BIC at Space
+$         \romannumeral0%
+$         \expandafter\BIC at AddXY
+$         \number\csname BIC at MulDigit#2\endcsname#1!%
+$         #3!!!%
+$       }%
+$     \fi
+$   \BIC at Fi
+$ }%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at MulDigit[3-9]}
+%    \begin{macrocode}
+$ \def\BIC at Temp#1#2{%
+$   \expandafter\def\csname BIC at MulDigit#1\endcsname##1{%
+$     \ifcase##1 0%
+$     \or ##1%
+$     \or #2%
+$?    \else\BigIntCalcError:ThisCannotHappen%
+$     \fi
+$   }%
+$ }%
+$ \BIC at Temp 3{6\or9\or12\or15\or18\or21\or24\or27}%
+$ \BIC at Temp 4{8\or12\or16\or20\or24\or28\or32\or36}%
+$ \BIC at Temp 5{10\or15\or20\or25\or30\or35\or40\or45}%
+$ \BIC at Temp 6{12\or18\or24\or30\or36\or42\or48\or54}%
+$ \BIC at Temp 7{14\or21\or28\or35\or42\or49\or56\or63}%
+$ \BIC at Temp 8{16\or24\or32\or40\or48\or56\or64\or72}%
+$ \BIC at Temp 9{18\or27\or36\or45\or54\or63\or72\or81}%
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsection{\op{Mul}}
+%
+%    \begin{macro}{\bigintcalcMul}
+%    \begin{macrocode}
+\def\bigintcalcMul#1#2{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Mul
+  \bigintcalcNum{#1}!{#2}%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at Mul}
+%    \begin{macrocode}
+\def\BIC at Mul#1!#2{%
+  \expandafter\expandafter\expandafter\BIC at MulSwitch
+  \bigintcalcNum{#2}!#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at MulSwitch}
+%    Decision table for \cs{BIC at MulSwitch}.
+%    \begin{quote}
+%    \begin{tabular}[t]{@{}|l|l|l|l|l|@{}}
+%      \hline
+%      $x=0$ &\multicolumn{3}{l}{}    &$0$\\
+%      \hline
+%      $x>0$ & $y=0$ &\multicolumn2l{}&$0$\\
+%      \cline{2-5}
+%            & $y>0$ & $ x> y$ & $+$ & $\opMul( x, y)$\\
+%      \cline{3-3}\cline{5-5}
+%            &       & else    &     & $\opMul( y, x)$\\
+%      \cline{2-5}
+%            & $y<0$ & $ x>-y$ & $-$ & $\opMul( x,-y)$\\
+%      \cline{3-3}\cline{5-5}
+%            &       & else    &     & $\opMul(-y, x)$\\
+%      \hline
+%      $x<0$ & $y=0$ &\multicolumn2l{}&$0$\\
+%      \cline{2-5}
+%            & $y>0$ & $-x> y$ & $-$ & $\opMul(-x, y)$\\
+%      \cline{3-3}\cline{5-5}
+%            &       & else    &     & $\opMul( y,-x)$\\
+%      \cline{2-5}
+%            & $y<0$ & $-x>-y$ & $+$ & $\opMul(-x,-y)$\\
+%      \cline{3-3}\cline{5-5}
+%            &       & else    &     & $\opMul(-y,-x)$\\
+%      \hline
+%    \end{tabular}
+%    \end{quote}
+%    \begin{macrocode}
+\def\BIC at MulSwitch#1#2!#3#4!{%
+  \ifcase\BIC at Sgn#1#2! % x = 0
+    \BIC at AfterFi{ 0}%
+  \or % x > 0
+    \ifcase\BIC at Sgn#3#4! % y = 0
+      \BIC at AfterFiFi{ 0}%
+    \or % y > 0
+      \ifnum\BIC at PosCmp#1#2!#3#4!=1 % x > y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#1#2!#3#4!%
+        }%
+      \else % x <= y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#3#4!#1#2!%
+        }%
+      \fi
+    \else % y < 0
+      \expandafter-\romannumeral0%
+      \ifnum\BIC at PosCmp#1#2!#4!=1 % x > -y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#1#2!#4!%
+        }%
+      \else % x <= -y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#4!#1#2!%
+        }%
+      \fi
+    \fi
+  \else % x < 0
+    \ifcase\BIC at Sgn#3#4! % y = 0
+      \BIC at AfterFiFi{ 0}%
+    \or % y > 0
+      \expandafter-\romannumeral0%
+      \ifnum\BIC at PosCmp#2!#3#4!=1 % -x > y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#2!#3#4!%
+        }%
+      \else % -x <= y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#3#4!#2!%
+        }%
+      \fi
+    \else % y < 0
+      \ifnum\BIC at PosCmp#2!#4!=1 % -x > -y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#2!#4!%
+        }%
+      \else % -x <= -y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#4!#2!%
+        }%
+      \fi
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BigIntCalcMul}
+%    \begin{macrocode}
+\def\BigIntCalcMul#1!#2!{%
+  \romannumeral0%
+  \BIC at ProcessMul0!#1!#2!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at ProcessMul}
+%    |#1|: result\\
+%    |#2|: number $x$\\
+%    |#3#4|: number $y$
+%    \begin{macrocode}
+\def\BIC at ProcessMul#1!#2!#3#4!{%
+  \ifx\\#4\\%
+    \BIC at AfterFi{%
+      \expandafter\expandafter\expandafter\BIC at Space
+      \bigintcalcAdd{\BIC at Tim#2!#3}{#10}%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \expandafter\expandafter\expandafter\BIC at ProcessMul
+      \bigintcalcAdd{\BIC at Tim#2!#3}{#10}!#2!#4!%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsection{\op{Sqr}}
+%
+%    \begin{macro}{\bigintcalcSqr}
+%    \begin{macrocode}
+\def\bigintcalcSqr#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Sqr
+  \bigintcalcNum{#1}!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at Sqr}
+%    \begin{macrocode}
+\def\BIC at Sqr#1{%
+   \ifx#1-%
+     \expandafter\BIC@@Sqr
+   \else
+     \expandafter\BIC@@Sqr\expandafter#1%
+   \fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@Sqr}
+%    \begin{macrocode}
+\def\BIC@@Sqr#1!{%
+  \BIC at ProcessMul0!#1!#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsection{\op{Fac}}
+%
+%    \begin{macro}{\bigintcalcFac}
+%    \begin{macrocode}
+\def\bigintcalcFac#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Fac
+  \bigintcalcNum{#1}!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at Fac}
+%    \begin{macrocode}
+\def\BIC at Fac#1#2!{%
+  \ifx#1-%
+    \BIC at AfterFi{ 0\BigIntCalcError:FacNegative}%
+  \else
+    \ifnum\BIC at PosCmp#1#2!13!<0 %
+      \ifcase#1#2 %
+         \BIC at AfterFiFiFi{ 1}% 0!
+      \or\BIC at AfterFiFiFi{ 1}% 1!
+      \or\BIC at AfterFiFiFi{ 2}% 2!
+      \or\BIC at AfterFiFiFi{ 6}% 3!
+      \or\BIC at AfterFiFiFi{ 24}% 4!
+      \or\BIC at AfterFiFiFi{ 120}% 5!
+      \or\BIC at AfterFiFiFi{ 720}% 6!
+      \or\BIC at AfterFiFiFi{ 5040}% 7!
+      \or\BIC at AfterFiFiFi{ 40320}% 8!
+      \or\BIC at AfterFiFiFi{ 362880}% 9!
+      \or\BIC at AfterFiFiFi{ 3628800}% 10!
+      \or\BIC at AfterFiFiFi{ 39916800}% 11!
+      \or\BIC at AfterFiFiFi{ 479001600}% 12!
+?     \else\BigIntCalcError:ThisCannotHappen%
+      \fi
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at ProcessFac#1#2!479001600!%
+      }%
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at ProcessFac}
+%    |#1|: $n$\\
+%    |#2|: result
+%    \begin{macrocode}
+\def\BIC at ProcessFac#1!#2!{%
+  \ifnum\BIC at PosCmp#1!12!=0 %
+    \BIC at AfterFi{ #2}%
+  \else
+    \BIC at AfterFi{%
+      \expandafter\BIC@@ProcessFac
+      \romannumeral0\BIC at ProcessMul0!#2!#1!%
+      !#1!%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@ProcessFac}
+%    |#1|: result\\
+%    |#2|: $n$
+%    \begin{macrocode}
+\def\BIC@@ProcessFac#1!#2!{%
+  \expandafter\BIC at ProcessFac
+  \romannumeral0\BIC at Dec#2!{}%
+  !#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsection{\op{Pow}}
+%
+%    \begin{macro}{\bigintcalcPow}
+%    |#1|: basis\\
+%    |#2|: power
+%    \begin{macrocode}
+\def\bigintcalcPow#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Pow
+  \bigintcalcNum{#1}!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at Pow}
+%    |#1|: basis\\
+%    |#2|: power
+%    \begin{macrocode}
+\def\BIC at Pow#1!#2{%
+  \expandafter\expandafter\expandafter\BIC at PowSwitch
+  \bigintcalcNum{#2}!#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at PowSwitch}
+%    |#1#2|: power $y$\\
+%    |#3#4|: basis $x$\\
+%    Decision table for \cs{BIC at PowSwitch}.
+%    \begin{quote}
+%    \def\M#1{\multicolumn{#1}{l}{}}%
+%    \begin{tabular}[t]{@{}|l|l|l|l|@{}}
+%    \hline
+%    $y=0$ & \M{2}                        & $1$\\
+%    \hline
+%    $y=1$ & \M{2}                        & $x$\\
+%    \hline
+%    $y=2$ & $x<0$          & \M{1}       & $\opMul(-x,-x)$\\
+%    \cline{2-4}
+%          & else           & \M{1}       & $\opMul(x,x)$\\
+%    \hline
+%    $y<0$ & $x=0$          & \M{1}       & DivisionByZero\\
+%    \cline{2-4}
+%          & $x=1$          & \M{1}       & $1$\\
+%    \cline{2-4}
+%          & $x=-1$         & $\opODD(y)$ & $-1$\\
+%    \cline{3-4}
+%          &                & else        & $1$\\
+%    \cline{2-4}
+%          & else ($\string|x\string|>1$) & \M{1}       & $0$\\
+%    \hline
+%    $y>2$ & $x=0$          & \M{1}       & $0$\\
+%    \cline{2-4}
+%          & $x=1$          & \M{1}       & $1$\\
+%    \cline{2-4}
+%          & $x=-1$         & $\opODD(y)$ & $-1$\\
+%    \cline{3-4}
+%          &                & else        & $1$\\
+%    \cline{2-4}
+%          & $x<-1$ ($x<0$) & $\opODD(y)$ & $-\opPow(-x,y)$\\
+%    \cline{3-4}
+%          &                & else        & $\opPow(-x,y)$\\
+%    \cline{2-4}
+%          & else ($x>1$)   & \M{1}       & $\opPow(x,y)$\\
+%    \hline
+%    \end{tabular}
+%    \end{quote}
+%    \begin{macrocode}
+\def\BIC at PowSwitch#1#2!#3#4!{%
+  \ifcase\ifx\\#2\\%
+           \ifx#100 % y = 0
+           \else\ifx#111 % y = 1
+           \else\ifx#122 % y = 2
+           \else4 % y > 2
+           \fi\fi\fi
+         \else
+           \ifx#1-3 % y < 0
+           \else4 % y > 2
+           \fi
+         \fi
+    \BIC at AfterFi{ 1}% y = 0
+  \or % y = 1
+    \BIC at AfterFi{ #3#4}%
+  \or % y = 2
+    \ifx#3-% x < 0
+      \BIC at AfterFiFi{%
+        \BIC at ProcessMul0!#4!#4!%
+      }%
+    \else % x >= 0
+      \BIC at AfterFiFi{%
+        \BIC at ProcessMul0!#3#4!#3#4!%
+      }%
+    \fi
+  \or % y < 0
+    \ifcase\ifx\\#4\\%
+             \ifx#300 % x = 0
+             \else\ifx#311 % x = 1
+             \else3 % x > 1
+             \fi\fi
+           \else
+             \ifcase\BIC at MinusOne#3#4! %
+               3 % |x| > 1
+             \or
+               2 % x = -1
+?            \else\BigIntCalcError:ThisCannotHappen%
+             \fi
+           \fi
+      \BIC at AfterFiFi{ 0\BigIntCalcError:DivisionByZero}% x = 0
+    \or % x = 1
+      \BIC at AfterFiFi{ 1}% x = 1
+    \or % x = -1
+      \ifcase\BIC at ModTwo#2! % even(y)
+        \BIC at AfterFiFiFi{ 1}%
+      \or % odd(y)
+        \BIC at AfterFiFiFi{ -1}%
+?     \else\BigIntCalcError:ThisCannotHappen%
+      \fi
+    \or % |x| > 1
+      \BIC at AfterFiFi{ 0}%
+?   \else\BigIntCalcError:ThisCannotHappen%
+    \fi
+  \or % y > 2
+    \ifcase\ifx\\#4\\%
+             \ifx#300 % x = 0
+             \else\ifx#311 % x = 1
+             \else4 % x > 1
+             \fi\fi
+           \else
+             \ifx#3-%
+               \ifcase\BIC at MinusOne#3#4! %
+                 3 % x < -1
+               \else
+                 2 % x = -1
+               \fi
+             \else
+               4 % x > 1
+             \fi
+           \fi
+      \BIC at AfterFiFi{ 0}% x = 0
+    \or % x = 1
+      \BIC at AfterFiFi{ 1}% x = 1
+    \or % x = -1
+      \ifcase\BIC at ModTwo#1#2! % even(y)
+        \BIC at AfterFiFiFi{ 1}%
+      \or % odd(y)
+        \BIC at AfterFiFiFi{ -1}%
+?     \else\BigIntCalcError:ThisCannotHappen%
+      \fi
+    \or % x < -1
+      \ifcase\BIC at ModTwo#1#2! % even(y)
+        \BIC at AfterFiFiFi{%
+          \BIC at PowRec#4!#1#2!1!%
+        }%
+      \or % odd(y)
+        \expandafter-\romannumeral0%
+        \BIC at AfterFiFiFi{%
+          \BIC at PowRec#4!#1#2!1!%
+        }%
+?     \else\BigIntCalcError:ThisCannotHappen%
+      \fi
+    \or % x > 1
+      \BIC at AfterFiFi{%
+        \BIC at PowRec#3#4!#1#2!1!%
+      }%
+?   \else\BigIntCalcError:ThisCannotHappen%
+    \fi
+? \else\BigIntCalcError:ThisCannotHappen%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsubsection{Help macros}
+%
+%    \begin{macro}{\BIC at ModTwo}
+%    Macro \cs{BIC at ModTwo} expects a number without sign
+%    and returns digit |1| or |0| if the number is odd or even.
+%    \begin{macrocode}
+\def\BIC at ModTwo#1#2!{%
+  \ifx\\#2\\%
+    \ifodd#1 %
+      \BIC at AfterFiFi1%
+    \else
+      \BIC at AfterFiFi0%
+    \fi
+  \else
+    \BIC at AfterFi{%
+      \BIC at ModTwo#2!%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macro}{\BIC at MinusOne}
+%    Macro \cs{BIC at MinusOne} expects a number and returns
+%    digit |1| if the number equals minus one and returns |0| otherwise.
+%    \begin{macrocode}
+\def\BIC at MinusOne#1#2!{%
+  \ifx#1-%
+    \BIC@@MinusOne#2!%
+  \else
+    0%
+  \fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@MinusOne}
+%    \begin{macrocode}
+\def\BIC@@MinusOne#1#2!{%
+  \ifx#11%
+    \ifx\\#2\\%
+      1%
+    \else
+      0%
+    \fi
+  \else
+    0%
+  \fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsubsection{Recursive calculation}
+%
+%    \begin{macro}{\BIC at PowRec}
+%\begin{quote}
+%\begin{verbatim}
+%Pow(x, y) {
+%  PowRec(x, y, 1)
+%}
+%PowRec(x, y, r) {
+%  if y == 1 then
+%    return r
+%  else
+%    ifodd y then
+%      return PowRec(x*x, y div 2, r*x) % y div 2 = (y-1)/2
+%    else
+%      return PowRec(x*x, y div 2, r)
+%    fi
+%  fi
+%}
+%\end{verbatim}
+%\end{quote}
+%    |#1|: $x$ (basis)\\
+%    |#2#3|: $y$ (power)\\
+%    |#4|: $r$ (result)
+%    \begin{macrocode}
+\def\BIC at PowRec#1!#2#3!#4!{%
+  \ifcase\ifx#21\ifx\\#3\\0 \else1 \fi\else1 \fi % y = 1
+    \ifnum\BIC at PosCmp#1!#4!=1 % x > r
+      \BIC at AfterFiFi{%
+        \BIC at ProcessMul0!#1!#4!%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at ProcessMul0!#4!#1!%
+      }%
+    \fi
+  \or
+    \ifcase\BIC at ModTwo#2#3! % even(y)
+      \BIC at AfterFiFi{%
+        \expandafter\BIC@@PowRec\romannumeral0%
+        \BIC@@Shr#2#3!%
+        !#1!#4!%
+      }%
+    \or % odd(y)
+      \ifnum\BIC at PosCmp#1!#4!=1 % x > r
+        \BIC at AfterFiFiFi{%
+          \expandafter\BIC@@@PowRec\romannumeral0%
+          \BIC at ProcessMul0!#1!#4!%
+          !#1!#2#3!%
+        }%
+      \else
+        \BIC at AfterFiFiFi{%
+          \expandafter\BIC@@@PowRec\romannumeral0%
+          \BIC at ProcessMul0!#1!#4!%
+          !#1!#2#3!%
+        }%
+      \fi
+?   \else\BigIntCalcError:ThisCannotHappen%
+    \fi
+? \else\BigIntCalcError:ThisCannotHappen%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@PowRec}
+%    |#1|: $y/2$\\
+%    |#2|: $x$\\
+%    |#3|: new $r$ ($r$ or $r*x$)
+%    \begin{macrocode}
+\def\BIC@@PowRec#1!#2!#3!{%
+  \expandafter\BIC at PowRec\romannumeral0%
+  \BIC at ProcessMul0!#2!#2!%
+  !#1!#3!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@@PowRec}
+%    |#1|: $r*x$
+%    |#2|: $x$
+%    |#3|: $y$
+%    \begin{macrocode}
+\def\BIC@@@PowRec#1!#2!#3!{%
+  \expandafter\BIC@@PowRec\romannumeral0%
+  \BIC@@Shr#3!%
+  !#2!#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsection{\op{Div}}
+%
+%    \begin{macro}{\bigintcalcDiv}
+%    |#1|: $x$\\
+%    |#2|: $y$ (divisor)
+%    \begin{macrocode}
+\def\bigintcalcDiv#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Div
+  \bigintcalcNum{#1}!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at Div}
+%    |#1|: $x$\\
+%    |#2|: $y$
+%    \begin{macrocode}
+\def\BIC at Div#1!#2{%
+  \expandafter\expandafter\expandafter\BIC at DivSwitchSign
+  \bigintcalcNum{#2}!#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BigIntCalcDiv}
+%    \begin{macrocode}
+\def\BigIntCalcDiv#1!#2!{%
+  \romannumeral0%
+  \BIC at DivSwitchSign#2!#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at DivSwitchSign}
+%    Decision table for \cs{BIC at DivSwitchSign}.
+%    \begin{quote}
+%    \begin{tabular}{@{}|l|l|l|@{}}
+%    \hline
+%    $y=0$ & \multicolumn{1}{l}{} & DivisionByZero\\
+%    \hline
+%    $y>0$ & $x=0$ & $0$\\
+%    \cline{2-3}
+%          & $x>0$ & DivSwitch$(+,x,y)$\\
+%    \cline{2-3}
+%          & $x<0$ & DivSwitch$(-,-x,y)$\\
+%    \hline
+%    $y<0$ & $x=0$ & $0$\\
+%    \cline{2-3}
+%          & $x>0$ & DivSwitch$(-,x,-y)$\\
+%    \cline{2-3}
+%          & $x<0$ & DivSwitch$(+,-x,-y)$\\
+%    \hline
+%    \end{tabular}
+%    \end{quote}
+%    |#1|: $y$ (divisor)\\
+%    |#2|: $x$
+%    \begin{macrocode}
+\def\BIC at DivSwitchSign#1#2!#3#4!{%
+  \ifcase\BIC at Sgn#1#2! % y = 0
+    \BIC at AfterFi{ 0\BigIntCalcError:DivisionByZero}%
+  \or % y > 0
+    \ifcase\BIC at Sgn#3#4! % x = 0
+      \BIC at AfterFiFi{ 0}%
+    \or % x > 0
+      \BIC at AfterFiFi{%
+        \BIC at DivSwitch{}#3#4!#1#2!%
+      }%
+    \else % x < 0
+      \BIC at AfterFiFi{%
+        \BIC at DivSwitch-#4!#1#2!%
+      }%
+    \fi
+  \else % y < 0
+    \ifcase\BIC at Sgn#3#4! % x = 0
+      \BIC at AfterFiFi{ 0}%
+    \or % x > 0
+      \BIC at AfterFiFi{%
+        \BIC at DivSwitch-#3#4!#2!%
+      }%
+    \else % x < 0
+      \BIC at AfterFiFi{%
+        \BIC at DivSwitch{}#4!#2!%
+      }%
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at DivSwitch}
+%    Decision table for \cs{BIC at DivSwitch}.
+%    \begin{quote}
+%    \begin{tabular}{@{}|l|l|l|@{}}
+%    \hline
+%    $y=x$ & \multicolumn{1}{l}{} & sign $1$\\
+%    \hline
+%    $y>x$ & \multicolumn{1}{l}{} & $0$\\
+%    \hline
+%    $y<x$ & $y=1$                & sign $x$\\
+%    \cline{2-3}
+%          & $y=2$                & sign Shr$(x)$\\
+%    \cline{2-3}
+%          & $y=4$                & sign Shr(Shr$(x)$)\\
+%    \cline{2-3}
+%          & else                 & sign ProcessDiv$(x,y)$\\
+%    \hline
+%    \end{tabular}
+%    \end{quote}
+%    |#1|: sign\\
+%    |#2|: $x$\\
+%    |#3#4|: $y$ ($y\ne 0$)
+%    \begin{macrocode}
+\def\BIC at DivSwitch#1#2!#3#4!{%
+  \ifcase\BIC at PosCmp#3#4!#2!% y = x
+    \BIC at AfterFi{ #11}%
+  \or % y > x
+    \BIC at AfterFi{ 0}%
+  \else % y < x
+    \ifx\\#1\\%
+    \else
+      \expandafter-\romannumeral0%
+    \fi
+    \ifcase\ifx\\#4\\%
+             \ifx#310 % y = 1
+             \else\ifx#321 % y = 2
+             \else\ifx#342 % y = 4
+             \else3 % y > 2
+             \fi\fi\fi
+           \else
+             3 % y > 2
+           \fi
+      \BIC at AfterFiFi{ #2}% y = 1
+    \or % y = 2
+      \BIC at AfterFiFi{%
+        \BIC@@Shr#2!%
+      }%
+    \or % y = 4
+      \BIC at AfterFiFi{%
+        \expandafter\BIC@@Shr\romannumeral0%
+          \BIC@@Shr#2!!%
+      }%
+    \or % y > 2
+      \BIC at AfterFiFi{%
+        \BIC at DivStartX#2!#3#4!!!%
+      }%
+?   \else\BigIntCalcError:ThisCannotHappen%
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at ProcessDiv}
+%    |#1#2|: $x$\\
+%    |#3#4|: $y$\\
+%    |#5|: collect first digits of $x$\\
+%    |#6|: corresponding digits of $y$
+%    \begin{macrocode}
+\def\BIC at DivStartX#1#2!#3#4!#5!#6!{%
+  \ifx\\#4\\%
+    \BIC at AfterFi{%
+      \BIC at DivStartYii#6#3#4!{#5#1}#2=!%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \BIC at DivStartX#2!#4!#5#1!#6#3!%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at DivStartYii}
+%    |#1|: $y$\\
+%    |#2|: $x$, |=|
+%    \begin{macrocode}
+\def\BIC at DivStartYii#1!{%
+  \expandafter\BIC at DivStartYiv\romannumeral0%
+  \BIC at Shl#1!%
+  !#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at DivStartYiv}
+%    |#1|: $2y$\\
+%    |#2|: $y$\\
+%    |#3|: $x$, |=|
+%    \begin{macrocode}
+\def\BIC at DivStartYiv#1!{%
+  \expandafter\BIC at DivStartYvi\romannumeral0%
+  \BIC at Shl#1!%
+  !#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at DivStartYvi}
+%    |#1|: $4y$\\
+%    |#2|: $2y$\\
+%    |#3|: $y$\\
+%    |#4|: $x$, |=|
+%    \begin{macrocode}
+\def\BIC at DivStartYvi#1!#2!{%
+  \expandafter\BIC at DivStartYviii\romannumeral0%
+  \BIC at AddXY#1!#2!!!%
+  !#1!#2!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at DivStartYviii}
+%    |#1|: $6y$\\
+%    |#2|: $4y$\\
+%    |#3|: $2y$\\
+%    |#4|: $y$\\
+%    |#5|: $x$, |=|
+%    \begin{macrocode}
+\def\BIC at DivStartYviii#1!#2!{%
+  \expandafter\BIC at DivStart\romannumeral0%
+  \BIC at Shl#2!%
+  !#1!#2!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at DivStart}
+%    |#1|: $8y$\\
+%    |#2|: $6y$\\
+%    |#3|: $4y$\\
+%    |#4|: $2y$\\
+%    |#5|: $y$\\
+%    |#6|: $x$, |=|
+%    \begin{macrocode}
+\def\BIC at DivStart#1!#2!#3!#4!#5!#6!{%
+  \BIC at ProcessDiv#6!!#5!#4!#3!#2!#1!=%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at ProcessDiv}
+%    |#1#2#3|: $x$, |=|\\
+%    |#4|: result\\
+%    |#5|: $y$\\
+%    |#6|: $2y$\\
+%    |#7|: $4y$\\
+%    |#8|: $6y$\\
+%    |#9|: $8y$
+%    \begin{macrocode}
+\def\BIC at ProcessDiv#1#2#3!#4!#5!{%
+  \ifcase\BIC at PosCmp#5!#1!% y = #1
+    \ifx#2=%
+      \BIC at AfterFiFi{\BIC at DivCleanup{#41}}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at ProcessDiv#2#3!#41!#5!%
+      }%
+    \fi
+  \or % y > #1
+    \ifx#2=%
+      \BIC at AfterFiFi{\BIC at DivCleanup{#40}}%
+    \else
+      \ifx\\#4\\%
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessDiv{#1#2}#3!!#5!%
+        }%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessDiv{#1#2}#3!#40!#5!%
+        }%
+      \fi
+    \fi
+  \else % y < #1
+    \BIC at AfterFi{%
+      \BIC@@ProcessDiv{#1}#2#3!#4!#5!%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at DivCleanup}
+%    |#1|: result\\
+%    |#2|: garbage
+%    \begin{macrocode}
+\def\BIC at DivCleanup#1#2={ #1}%
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC@@ProcessDiv}
+%    \begin{macrocode}
+\def\BIC@@ProcessDiv#1#2#3!#4!#5!#6!#7!{%
+  \ifcase\BIC at PosCmp#7!#1!% 4y = #1
+    \ifx#2=%
+      \BIC at AfterFiFi{\BIC at DivCleanup{#44}}%
+    \else
+     \BIC at AfterFiFi{%
+       \BIC at ProcessDiv#2#3!#44!#5!#6!#7!%
+     }%
+    \fi
+  \or % 4y > #1
+    \ifcase\BIC at PosCmp#6!#1!% 2y = #1
+      \ifx#2=%
+        \BIC at AfterFiFiFi{\BIC at DivCleanup{#42}}%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessDiv#2#3!#42!#5!#6!#7!%
+        }%
+      \fi
+    \or % 2y > #1
+      \ifx#2=%
+        \BIC at AfterFiFiFi{\BIC at DivCleanup{#41}}%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at DivSub#1!#5!#2#3!#41!#5!#6!#7!%
+        }%
+      \fi
+    \else % 2y < #1
+      \BIC at AfterFiFi{%
+        \expandafter\BIC at ProcessDivII\romannumeral0%
+        \BIC at SubXY#1!#6!!!%
+        !#2#3!#4!#5!23%
+        #6!#7!%
+      }%
+    \fi
+  \else % 4y < #1
+    \BIC at AfterFi{%
+      \BIC@@@ProcessDiv{#1}#2#3!#4!#5!#6!#7!%
+    }%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at DivSub}
+%    Next token group: |#1|-|#2| and next digit |#3|.
+%    \begin{macrocode}
+\def\BIC at DivSub#1!#2!#3{%
+  \expandafter\BIC at ProcessDiv\expandafter{%
+    \romannumeral0%
+    \BIC at SubXY#1!#2!!!%
+    #3%
+  }%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at ProcessDivII}
+%    |#1|: $x'-2y$\\
+%    |#2#3|: remaining $x$, |=|\\
+%    |#4|: result\\
+%    |#5|: $y$\\
+%    |#6|: first possible result digit\\
+%    |#7|: second possible result digit
+%    \begin{macrocode}
+\def\BIC at ProcessDivII#1!#2#3!#4!#5!#6#7{%
+  \ifcase\BIC at PosCmp#5!#1!% y = #1
+    \ifx#2=%
+      \BIC at AfterFiFi{\BIC at DivCleanup{#4#7}}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at ProcessDiv#2#3!#4#7!#5!%
+      }%
+    \fi
+  \or % y > #1
+    \ifx#2=%
+      \BIC at AfterFiFi{\BIC at DivCleanup{#4#6}}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at ProcessDiv{#1#2}#3!#4#6!#5!%
+      }%
+    \fi
+  \else % y < #1
+    \ifx#2=%
+      \BIC at AfterFiFi{\BIC at DivCleanup{#4#7}}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at DivSub#1!#5!#2#3!#4#7!#5!%
+      }%
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at ProcessDivIV}
+%    |#1#2#3|: $x$, |=|, $x>4y$\\
+%    |#4|: result\\
+%    |#5|: $y$\\
+%    |#6|: $2y$\\
+%    |#7|: $4y$\\
+%    |#8|: $6y$\\
+%    |#9|: $8y$
+%    \begin{macrocode}
+\def\BIC@@@ProcessDiv#1#2#3!#4!#5!#6!#7!#8!#9!{%
+  \ifcase\BIC at PosCmp#8!#1!% 6y = #1
+    \ifx#2=%
+      \BIC at AfterFiFi{\BIC at DivCleanup{#46}}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at ProcessDiv#2#3!#46!#5!#6!#7!#8!#9!%
+      }%
+    \fi
+  \or % 6y > #1
+    \BIC at AfterFi{%
+      \expandafter\BIC at ProcessDivII\romannumeral0%
+      \BIC at SubXY#1!#7!!!%
+      !#2#3!#4!#5!45%
+      #6!#7!#8!#9!%
+    }%
+  \else % 6y < #1
+    \ifcase\BIC at PosCmp#9!#1!% 8y = #1
+      \ifx#2=%
+        \BIC at AfterFiFiFi{\BIC at DivCleanup{#48}}%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessDiv#2#3!#48!#5!#6!#7!#8!#9!%
+        }%
+      \fi
+    \or % 8y > #1
+      \BIC at AfterFiFi{%
+        \expandafter\BIC at ProcessDivII\romannumeral0%
+        \BIC at SubXY#1!#8!!!%
+        !#2#3!#4!#5!67%
+        #6!#7!#8!#9!%
+      }%
+    \else % 8y < #1
+      \BIC at AfterFiFi{%
+        \expandafter\BIC at ProcessDivII\romannumeral0%
+        \BIC at SubXY#1!#9!!!%
+        !#2#3!#4!#5!89%
+        #6!#7!#8!#9!%
+      }%
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+% \subsection{\op{Mod}}
+%
+%    \begin{macro}{\bigintcalcMod}
+%    |#1|: $x$\\
+%    |#2|: $y$
+%    \begin{macrocode}
+\def\bigintcalcMod#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Mod
+  \bigintcalcNum{#1}!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at Mod}
+%    |#1|: $x$\\
+%    |#2|: $y$
+%    \begin{macrocode}
+\def\BIC at Mod#1!#2{%
+  \expandafter\expandafter\expandafter\BIC at ModSwitchSign
+  \bigintcalcNum{#2}!#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BigIntCalcMod}
+%    \begin{macrocode}
+\def\BigIntCalcMod#1!#2!{%
+  \romannumeral0%
+  \BIC at ModSwitchSign#2!#1!%
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at ModSwitchSign}
+%    Decision table for \cs{BIC at ModSwitchSign}.
+%    \begin{quote}
+%    \begin{tabular}{@{}|l|l|l|@{}}
+%    \hline
+%    $y=0$ & \multicolumn{1}{l}{} & DivisionByZero\\
+%    \hline
+%    $y>0$ & $x=0$ & $0$\\
+%    \cline{2-3}
+%          & else  & ModSwitch$(+,x,y)$\\
+%    \hline
+%    $y<0$ & \multicolumn{1}{l}{} & ModSwitch$(-,-x,-y)$\\
+%    \hline
+%    \end{tabular}
+%    \end{quote}
+%    |#1#2|: $y$\\
+%    |#3#4|: $x$
+%    \begin{macrocode}
+\def\BIC at ModSwitchSign#1#2!#3#4!{%
+  \ifcase\ifx\\#2\\%
+           \ifx#100 % y = 0
+           \else1 % y > 0
+           \fi
+          \else
+            \ifx#1-2 % y < 0
+            \else1 % y > 0
+            \fi
+          \fi
+    \BIC at AfterFi{ 0\BigIntCalcError:DivisionByZero}%
+  \or % y > 0
+    \ifcase\ifx\\#4\\\ifx#300 \else1 \fi\else1 \fi % x = 0
+      \BIC at AfterFiFi{ 0}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at ModSwitch{}#3#4!#1#2!%
+      }%
+    \fi
+  \else % y < 0
+    \ifcase\ifx\\#4\\%
+             \ifx#300 % x = 0
+             \else1 % x > 0
+             \fi
+           \else
+             \ifx#3-2 % x < 0
+             \else1 % x > 0
+             \fi
+           \fi
+      \BIC at AfterFiFi{ 0}%
+    \or % x > 0
+      \BIC at AfterFiFi{%
+        \BIC at ModSwitch--#3#4!#2!%
+      }%
+    \else % x < 0
+      \BIC at AfterFiFi{%
+        \BIC at ModSwitch-#4!#2!%
+      }%
+    \fi
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at ModSwitch}
+%    Decision table for \cs{BIC at ModSwitch}.
+%    \begin{quote}
+%    \begin{tabular}{@{}|l|l|l|@{}}
+%    \hline
+%    $y=1$ & \multicolumn{1}{l}{} & $0$\\
+%    \hline
+%    $y=2$ & ifodd$(x)$ & sign $1$\\
+%    \cline{2-3}
+%          & else       & $0$\\
+%    \hline
+%    $y>2$ & $x<0$      &
+%        $z\leftarrow x-(x/y)*y;\quad (z<0)\mathbin{?}z+y\mathbin{:}z$\\
+%    \cline{2-3}
+%          & $x>0$      & $x - (x/y) * y$\\
+%    \hline
+%    \end{tabular}
+%    \end{quote}
+%    |#1|: sign\\
+%    |#2#3|: $x$\\
+%    |#4#5|: $y$
+%    \begin{macrocode}
+\def\BIC at ModSwitch#1#2#3!#4#5!{%
+  \ifcase\ifx\\#5\\%
+           \ifx#410 % y = 1
+           \else\ifx#421 % y = 2
+           \else2 % y > 2
+           \fi\fi
+         \else2 % y > 2
+         \fi
+    \BIC at AfterFi{ 0}% y = 1
+  \or % y = 2
+    \ifcase\BIC at ModTwo#2#3! % even(x)
+      \BIC at AfterFiFi{ 0}%
+    \or % odd(x)
+      \BIC at AfterFiFi{ #11}%
+?   \else\BigIntCalcError:ThisCannotHappen%
+    \fi
+  \or % y > 2
+    \ifx\\#1\\%
+    \else
+      \expandafter\BIC at Space\romannumeral0%
+      \expandafter\BIC at ModMinus\romannumeral0%
+    \fi
+    \ifx#2-% x < 0
+      \BIC at AfterFiFi{%
+        \expandafter\expandafter\expandafter\BIC at ModX
+        \bigintcalcSub{#2#3}{%
+          \bigintcalcMul{#4#5}{\bigintcalcDiv{#2#3}{#4#5}}%
+        }!#4#5!%
+      }%
+    \else % x > 0
+      \BIC at AfterFiFi{%
+        \expandafter\expandafter\expandafter\BIC at Space
+        \bigintcalcSub{#2#3}{%
+          \bigintcalcMul{#4#5}{\bigintcalcDiv{#2#3}{#4#5}}%
+        }%
+      }%
+    \fi
+? \else\BigIntCalcError:ThisCannotHappen%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at ModMinus}
+%    \begin{macrocode}
+\def\BIC at ModMinus#1{%
+  \ifx#10%
+    \BIC at AfterFi{ 0}%
+  \else
+    \BIC at AfterFi{ -#1}%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%    \begin{macro}{\BIC at ModX}
+%    |#1#2|: $z$\\
+%    |#3|: $x$
+%    \begin{macrocode}
+\def\BIC at ModX#1#2!#3!{%
+  \ifx#1-% z < 0
+    \BIC at AfterFi{%
+      \expandafter\BIC at Space\romannumeral0%
+      \BIC at SubXY#3!#2!!!%
+    }%
+  \else % z >= 0
+    \BIC at AfterFi{ #1#2}%
+  \BIC at Fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
+%    \begin{macrocode}
+\BIC at AtEnd%
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%</package>
+%    \end{macrocode}
+%% \section{Installation}
+%
+% \subsection{Download}
+%
+% \paragraph{Package.} This package is available on
+% CTAN\footnote{\CTANpkg{bigintcalc}}:
+% \begin{description}
+% \item[\CTAN{macros/latex/contrib/bigintcalc/bigintcalc.dtx}] The source file.
+% \item[\CTAN{macros/latex/contrib/bigintcalc/bigintcalc.pdf}] Documentation.
+% \end{description}
+%
+%
+% \paragraph{Bundle.} All the packages of the bundle `bigintcalc'
+% are also available in a TDS compliant ZIP archive. There
+% the packages are already unpacked and the documentation files
+% are generated. The files and directories obey the TDS standard.
+% \begin{description}
+% \item[\CTANinstall{install/macros/latex/contrib/bigintcalc.tds.zip}]
+% \end{description}
+% \emph{TDS} refers to the standard ``A Directory Structure
+% for \TeX\ Files'' (\CTANpkg{tds}). Directories
+% with \xfile{texmf} in their name are usually organized this way.
+%
+% \subsection{Bundle installation}
+%
+% \paragraph{Unpacking.} Unpack the \xfile{bigintcalc.tds.zip} in the
+% TDS tree (also known as \xfile{texmf} tree) of your choice.
+% Example (linux):
+% \begin{quote}
+%   |unzip bigintcalc.tds.zip -d ~/texmf|
+% \end{quote}
+%
+% \subsection{Package installation}
+%
+% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
+% \docstrip\ archive. The files are extracted by running the
+% \xfile{.dtx} through \plainTeX:
+% \begin{quote}
+%   \verb|tex bigintcalc.dtx|
+% \end{quote}
+%
+% \paragraph{TDS.} Now the different files must be moved into
+% the different directories in your installation TDS tree
+% (also known as \xfile{texmf} tree):
+% \begin{quote}
+% \def\t{^^A
+% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
+%   bigintcalc.sty & tex/generic/bigintcalc/bigintcalc.sty\\
+%   bigintcalc.pdf & doc/latex/bigintcalc/bigintcalc.pdf\\
+%   bigintcalc.dtx & source/latex/bigintcalc/bigintcalc.dtx\\
+% \end{tabular}^^A
+% }^^A
+% \sbox0{\t}^^A
+% \ifdim\wd0>\linewidth
+%   \begingroup
+%     \advance\linewidth by\leftmargin
+%     \advance\linewidth by\rightmargin
+%   \edef\x{\endgroup
+%     \def\noexpand\lw{\the\linewidth}^^A
+%   }\x
+%   \def\lwbox{^^A
+%     \leavevmode
+%     \hbox to \linewidth{^^A
+%       \kern-\leftmargin\relax
+%       \hss
+%       \usebox0
+%       \hss
+%       \kern-\rightmargin\relax
+%     }^^A
+%   }^^A
+%   \ifdim\wd0>\lw
+%     \sbox0{\small\t}^^A
+%     \ifdim\wd0>\linewidth
+%       \ifdim\wd0>\lw
+%         \sbox0{\footnotesize\t}^^A
+%         \ifdim\wd0>\linewidth
+%           \ifdim\wd0>\lw
+%             \sbox0{\scriptsize\t}^^A
+%             \ifdim\wd0>\linewidth
+%               \ifdim\wd0>\lw
+%                 \sbox0{\tiny\t}^^A
+%                 \ifdim\wd0>\linewidth
+%                   \lwbox
+%                 \else
+%                   \usebox0
+%                 \fi
+%               \else
+%                 \lwbox
+%               \fi
+%             \else
+%               \usebox0
+%             \fi
+%           \else
+%             \lwbox
+%           \fi
+%         \else
+%           \usebox0
+%         \fi
+%       \else
+%         \lwbox
+%       \fi
+%     \else
+%       \usebox0
+%     \fi
+%   \else
+%     \lwbox
+%   \fi
+% \else
+%   \usebox0
+% \fi
+% \end{quote}
+% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
+% TDS installing feature, then some files can already be in the right
+% place, see the documentation of \docstrip.
+%
+% \subsection{Refresh file name databases}
+%
+% If your \TeX~distribution
+% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh
+% these. For example, \TeX\,Live\ users run \verb|texhash| or
+% \verb|mktexlsr|.
+%
+% \subsection{Some details for the interested}
+%
+% \paragraph{Unpacking with \LaTeX.}
+% The \xfile{.dtx} chooses its action depending on the format:
+% \begin{description}
+% \item[\plainTeX:] Run \docstrip\ and extract the files.
+% \item[\LaTeX:] Generate the documentation.
+% \end{description}
+% If you insist on using \LaTeX\ for \docstrip\ (really,
+% \docstrip\ does not need \LaTeX), then inform the autodetect routine
+% about your intention:
+% \begin{quote}
+%   \verb|latex \let\install=y\input{bigintcalc.dtx}|
+% \end{quote}
+% Do not forget to quote the argument according to the demands
+% of your shell.
+%
+% \paragraph{Generating the documentation.}
+% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
+% the documentation. The process can be configured by the
+% configuration file \xfile{ltxdoc.cfg}. For instance, put this
+% line into this file, if you want to have A4 as paper format:
+% \begin{quote}
+%   \verb|\PassOptionsToClass{a4paper}{article}|
+% \end{quote}
+% An example follows how to generate the
+% documentation with pdf\LaTeX:
+% \begin{quote}
+%\begin{verbatim}
+%pdflatex bigintcalc.dtx
+%makeindex -s gind.ist bigintcalc.idx
+%pdflatex bigintcalc.dtx
+%makeindex -s gind.ist bigintcalc.idx
+%pdflatex bigintcalc.dtx
+%\end{verbatim}
+% \end{quote}
+%
+% \begin{History}
+%   \begin{Version}{2007/09/27 v1.0}
+%   \item
+%     First version.
+%   \end{Version}
+%   \begin{Version}{2007/11/11 v1.1}
+%   \item
+%     Use of package \xpackage{pdftexcmds} for \LuaTeX\ support.
+%   \end{Version}
+%   \begin{Version}{2011/01/30 v1.2}
+%   \item
+%     Already loaded package files are not input in \hologo{plainTeX}.
+%   \end{Version}
+%   \begin{Version}{2012/04/08 v1.3}
+%   \item
+%     Fix: \xpackage{pdftexcmds} wasn't loaded in case of \hologo{LaTeX}.
+%   \end{Version}
+%   \begin{Version}{2016/05/16 v1.4}
+%   \item
+%     Documentation updates.
+%   \end{Version}
+%   \begin{Version}{2019/12/15 v1.5}
+%   \item
+%     Documentation updates.
+%   \end{Version}
+% \end{History}
+%
+% \PrintIndex
+%
+% \Finale
+\endinput


Property changes on: trunk/Master/texmf-dist/source/latex/bigintcalc/bigintcalc.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty	2019-12-17 23:29:01 UTC (rev 53172)
@@ -0,0 +1,1831 @@
+%%
+%% This is file `bigintcalc.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% bigintcalc.dtx  (with options: `package')
+%% 
+%% This is a generated file.
+%% 
+%% Project: bigintcalc
+%% Version: 2019/12/15 v1.5
+%% 
+%% Copyright (C)
+%%    2007, 2011, 2012 Heiko Oberdiek
+%%    2016-2019 Oberdiek Package Support Group
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%%    https://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%%    https://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%% 
+%% This work has the LPPL maintenance status "maintained".
+%% 
+%% The Current Maintainers of this work are
+%% Heiko Oberdiek and the Oberdiek Package Support Group
+%% https://github.com/ho-tex/bigintcalc/issues
+%% 
+%% 
+%% The Base Interpreter refers to any `TeX-Format',
+%% because some files are installed in TDS:tex/generic//.
+%% 
+%% This work consists of the main source file bigintcalc.dtx
+%% and the derived files
+%%    bigintcalc.sty, bigintcalc.pdf, bigintcalc.ins, bigintcalc.drv,
+%%    bigintcalc-test1.tex, bigintcalc-test2.tex,
+%%    bigintcalc-test3.tex.
+%% 
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+  \catcode13=5 % ^^M
+  \endlinechar=13 %
+  \catcode35=6 % #
+  \catcode39=12 % '
+  \catcode44=12 % ,
+  \catcode45=12 % -
+  \catcode46=12 % .
+  \catcode58=12 % :
+  \catcode64=11 % @
+  \catcode123=1 % {
+  \catcode125=2 % }
+  \expandafter\let\expandafter\x\csname ver at bigintcalc.sty\endcsname
+  \ifx\x\relax % plain-TeX, first loading
+  \else
+    \def\empty{}%
+    \ifx\x\empty % LaTeX, first loading,
+      % variable is initialized, but \ProvidesPackage not yet seen
+    \else
+      \expandafter\ifx\csname PackageInfo\endcsname\relax
+        \def\x#1#2{%
+          \immediate\write-1{Package #1 Info: #2.}%
+        }%
+      \else
+        \def\x#1#2{\PackageInfo{#1}{#2, stopped}}%
+      \fi
+      \x{bigintcalc}{The package is already loaded}%
+      \aftergroup\endinput
+    \fi
+  \fi
+\endgroup%
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+  \catcode13=5 % ^^M
+  \endlinechar=13 %
+  \catcode35=6 % #
+  \catcode39=12 % '
+  \catcode40=12 % (
+  \catcode41=12 % )
+  \catcode44=12 % ,
+  \catcode45=12 % -
+  \catcode46=12 % .
+  \catcode47=12 % /
+  \catcode58=12 % :
+  \catcode64=11 % @
+  \catcode91=12 % [
+  \catcode93=12 % ]
+  \catcode123=1 % {
+  \catcode125=2 % }
+  \expandafter\ifx\csname ProvidesPackage\endcsname\relax
+    \def\x#1#2#3[#4]{\endgroup
+      \immediate\write-1{Package: #3 #4}%
+      \xdef#1{#4}%
+    }%
+  \else
+    \def\x#1#2[#3]{\endgroup
+      #2[{#3}]%
+      \ifx#1\@undefined
+        \xdef#1{#3}%
+      \fi
+      \ifx#1\relax
+        \xdef#1{#3}%
+      \fi
+    }%
+  \fi
+\expandafter\x\csname ver at bigintcalc.sty\endcsname
+\ProvidesPackage{bigintcalc}%
+  [2019/12/15 v1.5 Expandable calculations on big integers (HO)]%
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+  \catcode13=5 % ^^M
+  \endlinechar=13 %
+  \catcode123=1 % {
+  \catcode125=2 % }
+  \catcode64=11 % @
+  \def\x{\endgroup
+    \expandafter\edef\csname BIC at AtEnd\endcsname{%
+      \endlinechar=\the\endlinechar\relax
+      \catcode13=\the\catcode13\relax
+      \catcode32=\the\catcode32\relax
+      \catcode35=\the\catcode35\relax
+      \catcode61=\the\catcode61\relax
+      \catcode64=\the\catcode64\relax
+      \catcode123=\the\catcode123\relax
+      \catcode125=\the\catcode125\relax
+    }%
+  }%
+\x\catcode61\catcode48\catcode32=10\relax%
+\catcode13=5 % ^^M
+\endlinechar=13 %
+\catcode35=6 % #
+\catcode64=11 % @
+\catcode123=1 % {
+\catcode125=2 % }
+\def\TMP at EnsureCode#1#2{%
+  \edef\BIC at AtEnd{%
+    \BIC at AtEnd
+    \catcode#1=\the\catcode#1\relax
+  }%
+  \catcode#1=#2\relax
+}
+\TMP at EnsureCode{33}{12}% !
+\TMP at EnsureCode{36}{14}% $ (comment!)
+\TMP at EnsureCode{38}{14}% & (comment!)
+\TMP at EnsureCode{40}{12}% (
+\TMP at EnsureCode{41}{12}% )
+\TMP at EnsureCode{42}{12}% *
+\TMP at EnsureCode{43}{12}% +
+\TMP at EnsureCode{45}{12}% -
+\TMP at EnsureCode{46}{12}% .
+\TMP at EnsureCode{47}{12}% /
+\TMP at EnsureCode{58}{11}% : (letter!)
+\TMP at EnsureCode{60}{12}% <
+\TMP at EnsureCode{62}{12}% >
+\TMP at EnsureCode{63}{14}% ? (comment!)
+\TMP at EnsureCode{91}{12}% [
+\TMP at EnsureCode{93}{12}% ]
+\edef\BIC at AtEnd{\BIC at AtEnd\noexpand\endinput}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname BIC at TestMode\endcsname\relax
+\else
+  \catcode63=9 % ? (ignore)
+\fi
+? \let\BIC@@TestMode\BIC at TestMode
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname numexpr\endcsname\relax
+  \catcode36=9 % $ (ignore)
+\else
+  \catcode38=9 % & (ignore)
+\fi
+\let\BIC at Fi\fi
+\def\BIC at AfterFi#1#2\BIC at Fi{\fi#1}%
+\def\BIC at AfterFiFi#1#2\BIC at Fi{\fi\fi#1}%
+\def\BIC at AfterFiFiFi#1#2\BIC at Fi{\fi\fi\fi#1}%
+\begingroup
+  \def\x#1{\endgroup
+    \let\BIC at Space= #1%
+  }%
+\x{ }
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+  \def\TMP at RequirePackage#1[#2]{%
+    \begingroup\expandafter\expandafter\expandafter\endgroup
+    \expandafter\ifx\csname ver@#1.sty\endcsname\relax
+      \input #1.sty\relax
+    \fi
+  }%
+  \TMP at RequirePackage{pdftexcmds}[2007/11/11]%
+\else
+  \RequirePackage{pdftexcmds}[2007/11/11]%
+\fi
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdf at escapehex\endcsname\relax
+  \def\BIC at Expand#1{%
+    \romannumeral0%
+    \BIC@@Expand#1!\@nil{}%
+  }%
+  \def\BIC@@Expand#1#2\@nil#3{%
+    \expandafter\ifcat\noexpand#1\relax
+      \expandafter\@firstoftwo
+    \else
+      \expandafter\@secondoftwo
+    \fi
+    {%
+      \expandafter\BIC@@Expand#1#2\@nil{#3}%
+    }{%
+      \ifx#1!%
+        \expandafter\@firstoftwo
+      \else
+        \expandafter\@secondoftwo
+      \fi
+      { #3}{%
+        \BIC@@Expand#2\@nil{#3#1}%
+      }%
+    }%
+  }%
+  \expandafter\ifx\csname @firstoftwo\endcsname\relax
+    \long\def\@firstoftwo#1#2{#1}%
+  \fi
+  \expandafter\ifx\csname @secondoftwo\endcsname\relax
+    \long\def\@secondoftwo#1#2{#2}%
+  \fi
+\else
+  \def\BIC at Expand#1{%
+    \romannumeral0\expandafter\expandafter\expandafter\BIC at Space
+    \pdf at unescapehex{%
+      \expandafter\expandafter\expandafter
+      \BIC at StripHexSpace\pdf at escapehex{#1}20\@nil
+    }%
+  }%
+  \def\BIC at StripHexSpace#120#2\@nil{%
+    #1%
+    \ifx\\#2\\%
+    \else
+      \BIC at AfterFi{%
+        \BIC at StripHexSpace#2\@nil
+      }%
+    \BIC at Fi
+  }%
+\fi
+\def\BIC at Normalize#1#2{%
+  \ifx#2-%
+    \ifx\\#1\\%
+      \BIC at AfterFiFi{%
+        \BIC at Normalize-%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at Normalize{}%
+      }%
+    \fi
+  \else
+    \ifx#2+%
+      \BIC at AfterFiFi{%
+        \BIC at Normalize{#1}%
+      }%
+    \else
+      \ifx#20%
+        \BIC at AfterFiFiFi{%
+          \BIC at NormalizeZero{#1}%
+        }%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at NormalizeDigits#1#2%
+        }%
+      \fi
+    \fi
+  \BIC at Fi
+}
+\def\BIC at NormalizeZero#1#2{%
+  \ifx#2!%
+    \BIC at AfterFi{ 0}%
+  \else
+    \ifx#20%
+      \BIC at AfterFiFi{%
+        \BIC at NormalizeZero{#1}%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at NormalizeDigits#1#2%
+      }%
+    \fi
+  \BIC at Fi
+}
+\def\BIC at NormalizeDigits#1!{ #1}
+\def\bigintcalcNum#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Normalize
+  \expandafter\expandafter\expandafter{%
+  \expandafter\expandafter\expandafter}%
+  \BIC at Expand{#1}!%
+}
+\def\bigintcalcInv#1{%
+  \romannumeral0\expandafter\expandafter\expandafter\BIC at Space
+  \bigintcalcNum{-#1}%
+}
+\def\bigintcalcAbs#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Abs
+  \bigintcalcNum{#1}%
+}
+\def\BIC at Abs#1{%
+  \ifx#1-%
+    \expandafter\BIC at Space
+  \else
+    \expandafter\BIC at Space
+    \expandafter#1%
+  \fi
+}
+\def\bigintcalcSgn#1{%
+  \number
+  \expandafter\expandafter\expandafter\BIC at Sgn
+  \bigintcalcNum{#1}! %
+}
+\def\BIC at Sgn#1#2!{%
+  \ifx#1-%
+    -1%
+  \else
+    \ifx#10%
+      0%
+    \else
+      1%
+    \fi
+  \fi
+}
+\def\bigintcalcCmp#1#2{%
+  \number
+  \expandafter\expandafter\expandafter\BIC at Cmp
+  \bigintcalcNum{#2}!{#1}%
+}
+\def\BIC at Cmp#1!#2{%
+  \expandafter\expandafter\expandafter\BIC@@Cmp
+  \bigintcalcNum{#2}!#1!%
+}
+\def\BIC@@Cmp#1#2!#3#4!{%
+  \ifx#1-%
+    \ifx#3-%
+      \BIC at AfterFiFi{%
+        \BIC@@Cmp#4!#2!%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        -1 %
+      }%
+    \fi
+  \else
+    \ifx#3-%
+      \BIC at AfterFiFi{%
+        1 %
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at CmpLength#1#2!#3#4!#1#2!#3#4!%
+      }%
+    \fi
+  \BIC at Fi
+}
+\def\BIC at PosCmp#1!#2!{%
+  \BIC at CmpLength#1!#2!#1!#2!%
+}
+\def\BIC at CmpLength#1#2!#3#4!{%
+  \ifx\\#2\\%
+    \ifx\\#4\\%
+      \BIC at AfterFiFi\BIC at CmpDiff
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at CmpResult{-1}%
+      }%
+    \fi
+  \else
+    \ifx\\#4\\%
+      \BIC at AfterFiFi{%
+        \BIC at CmpResult1%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at CmpLength#2!#4!%
+      }%
+    \fi
+  \BIC at Fi
+}
+\def\BIC at CmpResult#1#2!#3!{#1 }
+\def\BIC at CmpDiff#1#2!#3#4!{%
+  \ifnum#1<#3 %
+    \BIC at AfterFi{%
+      -1 %
+    }%
+  \else
+    \ifnum#1>#3 %
+      \BIC at AfterFiFi{%
+        1 %
+      }%
+    \else
+      \ifx\\#2\\%
+        \BIC at AfterFiFiFi{%
+          0 %
+        }%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at CmpDiff#2!#4!%
+        }%
+      \fi
+    \fi
+  \BIC at Fi
+}
+\def\bigintcalcMin#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at MinMax
+  \bigintcalcNum{#1}!-!%
+}
+\def\bigintcalcMax#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at MinMax
+  \bigintcalcNum{#1}!!%
+}
+\def\BIC at MinMax#1!#2!#3{%
+  \expandafter\expandafter\expandafter\BIC@@MinMax
+  \bigintcalcNum{#3}!#1!#2!%
+}
+\def\BIC@@MinMax#1!#2!#3!{%
+  \ifnum\BIC@@Cmp#1!#2!=#31 %
+    \BIC at AfterFi{ #1}%
+  \else
+    \BIC at AfterFi{ #2}%
+  \BIC at Fi
+}
+\def\bigintcalcOdd#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Odd
+  \bigintcalcAbs{#1}!%
+}
+\def\BigIntCalcOdd#1!{%
+  \romannumeral0%
+  \BIC at Odd#1!%
+}
+\def\BIC at Odd#1#2{%
+  \ifx#2!%
+    \ifodd#1 %
+      \BIC at AfterFiFi{ 1}%
+    \else
+      \BIC at AfterFiFi{ 0}%
+    \fi
+  \else
+    \expandafter\BIC at Odd\expandafter#2%
+  \BIC at Fi
+}
+\def\bigintcalcInc#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at IncSwitch
+  \bigintcalcNum{#1}!%
+}
+\def\BIC at IncSwitch#1#2!{%
+  \ifcase\BIC@@Cmp#1#2!-1!%
+    \BIC at AfterFi{ 0}%
+  \or
+    \BIC at AfterFi{%
+      \BIC at Inc#1#2!{}%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \expandafter-\romannumeral0%
+      \BIC at Dec#2!{}%
+    }%
+  \BIC at Fi
+}
+\def\bigintcalcDec#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at DecSwitch
+  \bigintcalcNum{#1}!%
+}
+\def\BIC at DecSwitch#1#2!{%
+  \ifcase\BIC at Sgn#1#2! %
+    \BIC at AfterFi{ -1}%
+  \or
+    \BIC at AfterFi{%
+      \BIC at Dec#1#2!{}%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \expandafter-\romannumeral0%
+      \BIC at Inc#2!{}%
+    }%
+  \BIC at Fi
+}
+\def\BigIntCalcInc#1!{%
+  \romannumeral0\BIC at Inc#1!{}%
+}
+\def\BigIntCalcDec#1!{%
+  \romannumeral0\BIC at Dec#1!{}%
+}
+\def\BIC at Inc#1#2!#3{%
+  \ifx\\#2\\%
+    \BIC at AfterFi{%
+      \BIC@@Inc1#1#3!{}%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \BIC at Inc#2!{#1#3}%
+    }%
+  \BIC at Fi
+}
+\def\BIC@@Inc#1#2#3!#4{%
+  \ifcase#1 %
+    \ifx\\#3\\%
+      \BIC at AfterFiFi{ #2#4}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC@@Inc0#3!{#2#4}%
+      }%
+    \fi
+  \else
+    \ifnum#2<9 %
+      \BIC at AfterFiFi{%
+&       \expandafter\BIC@@@Inc\the\numexpr#2+1\relax
+$       \expandafter\expandafter\expandafter\BIC@@@Inc
+$       \ifcase#2 \expandafter1%
+$       \or\expandafter2%
+$       \or\expandafter3%
+$       \or\expandafter4%
+$       \or\expandafter5%
+$       \or\expandafter6%
+$       \or\expandafter7%
+$       \or\expandafter8%
+$       \or\expandafter9%
+$?      \else\BigIntCalcError:ThisCannotHappen%
+$       \fi
+        0#3!{#4}%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC@@@Inc01#3!{#4}%
+      }%
+    \fi
+  \BIC at Fi
+}
+\def\BIC@@@Inc#1#2#3!#4{%
+  \ifx\\#3\\%
+    \ifnum#2=1 %
+      \BIC at AfterFiFi{ 1#1#4}%
+    \else
+      \BIC at AfterFiFi{ #1#4}%
+    \fi
+  \else
+    \BIC at AfterFi{%
+      \BIC@@Inc#2#3!{#1#4}%
+    }%
+  \BIC at Fi
+}
+\def\BIC at Dec#1#2!#3{%
+  \ifx\\#2\\%
+    \BIC at AfterFi{%
+      \BIC@@Dec1#1#3!{}%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \BIC at Dec#2!{#1#3}%
+    }%
+  \BIC at Fi
+}
+\def\BIC@@Dec#1#2#3!#4{%
+  \ifcase#1 %
+    \ifx\\#3\\%
+      \BIC at AfterFiFi{ #2#4}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC@@Dec0#3!{#2#4}%
+      }%
+    \fi
+  \else
+    \ifnum#2>0 %
+      \BIC at AfterFiFi{%
+&       \expandafter\BIC@@@Dec\the\numexpr#2-1\relax
+$       \expandafter\expandafter\expandafter\BIC@@@Dec
+$       \ifcase#2
+$?        \BigIntCalcError:ThisCannotHappen%
+$       \or\expandafter0%
+$       \or\expandafter1%
+$       \or\expandafter2%
+$       \or\expandafter3%
+$       \or\expandafter4%
+$       \or\expandafter5%
+$       \or\expandafter6%
+$       \or\expandafter7%
+$       \or\expandafter8%
+$?      \else\BigIntCalcError:ThisCannotHappen%
+$       \fi
+        0#3!{#4}%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC@@@Dec91#3!{#4}%
+      }%
+    \fi
+  \BIC at Fi
+}
+\def\BIC@@@Dec#1#2#3!#4{%
+  \ifx\\#3\\%
+    \ifcase#1 %
+      \ifx\\#4\\%
+        \BIC at AfterFiFiFi{ 0}%
+      \else
+        \BIC at AfterFiFiFi{ #4}%
+      \fi
+    \else
+      \BIC at AfterFiFi{ #1#4}%
+    \fi
+  \else
+    \BIC at AfterFi{%
+      \BIC@@Dec#2#3!{#1#4}%
+    }%
+  \BIC at Fi
+}
+\def\bigintcalcAdd#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Add
+  \bigintcalcNum{#1}!%
+}
+\def\BIC at Add#1!#2{%
+  \expandafter\expandafter\expandafter
+  \BIC at AddSwitch\bigintcalcNum{#2}!#1!%
+}
+\def\bigintcalcSub#1#2{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Add
+  \bigintcalcNum{-#2}!{#1}%
+}
+\def\BIC at AddSwitch#1#2!#3#4!{%
+  \ifx#1-% x < 0
+    \ifx#3-% y < 0
+      \expandafter-\romannumeral0%
+      \ifnum\BIC at PosCmp#2!#4!=1 % -x > -y
+        \BIC at AfterFiFiFi{%
+          \BIC at AddXY#2!#4!!!%
+        }%
+      \else % -x <= -y
+        \BIC at AfterFiFiFi{%
+          \BIC at AddXY#4!#2!!!%
+        }%
+      \fi
+    \else % y >= 0
+      \ifcase\BIC at PosCmp#2!#3#4!% -x = y
+        \BIC at AfterFiFiFi{ 0}%
+      \or % -x > y
+        \expandafter-\romannumeral0%
+        \BIC at AfterFiFiFi{%
+          \BIC at SubXY#2!#3#4!!!%
+        }%
+      \else % -x <= y
+        \BIC at AfterFiFiFi{%
+          \BIC at SubXY#3#4!#2!!!%
+        }%
+      \fi
+    \fi
+  \else % x >= 0
+    \ifx#3-% y < 0
+      \ifcase\BIC at PosCmp#1#2!#4!% x = -y
+        \BIC at AfterFiFiFi{ 0}%
+      \or % x > -y
+        \BIC at AfterFiFiFi{%
+          \BIC at SubXY#1#2!#4!!!%
+        }%
+      \else % x <= -y
+        \expandafter-\romannumeral0%
+        \BIC at AfterFiFiFi{%
+          \BIC at SubXY#4!#1#2!!!%
+        }%
+      \fi
+    \else % y >= 0
+      \ifnum\BIC at PosCmp#1#2!#3#4!=1 % x > y
+        \BIC at AfterFiFiFi{%
+          \BIC at AddXY#1#2!#3#4!!!%
+        }%
+      \else % x <= y
+        \BIC at AfterFiFiFi{%
+          \BIC at AddXY#3#4!#1#2!!!%
+        }%
+      \fi
+    \fi
+  \BIC at Fi
+}
+\def\BigIntCalcAdd#1!#2!{%
+  \romannumeral0\BIC at AddXY#1!#2!!!%
+}
+\def\BigIntCalcSub#1!#2!{%
+  \romannumeral0\BIC at SubXY#1!#2!!!%
+}
+\def\BIC at AddXY#1#2!#3#4!#5!#6!{%
+  \ifx\\#2\\%
+    \ifx\\#3\\%
+      \BIC at AfterFiFi{%
+        \BIC at DoAdd0!#1#5!#60!%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at DoAdd0!#1#5!#3#6!%
+      }%
+    \fi
+  \else
+    \ifx\\#4\\%
+      \ifx\\#3\\%
+        \BIC at AfterFiFiFi{%
+          \BIC at AddXY#2!{}!#1#5!#60!%
+        }%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at AddXY#2!{}!#1#5!#3#6!%
+        }%
+      \fi
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at AddXY#2!#4!#1#5!#3#6!%
+      }%
+    \fi
+  \BIC at Fi
+}
+\def\BIC at DoAdd#1#2!#3#4!#5#6!{%
+  \ifx\\#4\\%
+    \BIC at AfterFi{%
+&     \expandafter\BIC at Space
+&     \the\numexpr#1+#3+#5\relax#2%
+$     \expandafter\expandafter\expandafter\BIC at AddResult
+$     \BIC at AddDigit#1#3#5#2%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \expandafter\expandafter\expandafter\BIC at DoAdd
+      \BIC at AddDigit#1#3#5#2!#4!#6!%
+    }%
+  \BIC at Fi
+}
+$ \def\BIC at AddResult#1{%
+$   \ifx#10%
+$     \expandafter\BIC at Space
+$   \else
+$     \expandafter\BIC at Space\expandafter#1%
+$   \fi
+$ }%
+\def\BIC at AddDigit#1#2#3{%
+  \romannumeral0%
+& \expandafter\BIC@@AddDigit\the\numexpr#1+#2+#3!%
+$ \expandafter\BIC@@AddDigit\number%
+$ \csname
+$   BIC at AddCarry%
+$   \ifcase#1 %
+$     #2%
+$   \else
+$     \ifcase#2 1\or2\or3\or4\or5\or6\or7\or8\or9\or10\fi
+$   \fi
+$ \endcsname#3!%
+}
+\def\BIC@@AddDigit#1!{%
+  \ifnum#1<10 %
+    \BIC at AfterFi{ 0#1}%
+  \else
+    \BIC at AfterFi{ #1}%
+  \BIC at Fi
+}
+$ \expandafter\def\csname BIC at AddCarry0\endcsname#1{#1}%
+$ \expandafter\def\csname BIC at AddCarry10\endcsname#1{1#1}%
+$ \def\BIC at Temp#1#2{%
+$   \expandafter\def\csname BIC at AddCarry#1\endcsname##1{%
+$     \ifcase##1 #1\or
+$     #2%
+$?    \else\BigIntCalcError:ThisCannotHappen%
+$     \fi
+$   }%
+$ }%
+$ \BIC at Temp 0{1\or2\or3\or4\or5\or6\or7\or8\or9}%
+$ \BIC at Temp 1{2\or3\or4\or5\or6\or7\or8\or9\or10}%
+$ \BIC at Temp 2{3\or4\or5\or6\or7\or8\or9\or10\or11}%
+$ \BIC at Temp 3{4\or5\or6\or7\or8\or9\or10\or11\or12}%
+$ \BIC at Temp 4{5\or6\or7\or8\or9\or10\or11\or12\or13}%
+$ \BIC at Temp 5{6\or7\or8\or9\or10\or11\or12\or13\or14}%
+$ \BIC at Temp 6{7\or8\or9\or10\or11\or12\or13\or14\or15}%
+$ \BIC at Temp 7{8\or9\or10\or11\or12\or13\or14\or15\or16}%
+$ \BIC at Temp 8{9\or10\or11\or12\or13\or14\or15\or16\or17}%
+$ \BIC at Temp 9{10\or11\or12\or13\or14\or15\or16\or17\or18}%
+\def\BIC at SubXY#1#2!#3#4!#5!#6!{%
+  \ifx\\#2\\%
+    \ifx\\#3\\%
+      \BIC at AfterFiFi{%
+        \BIC at DoSub0!#1#5!#60!%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at DoSub0!#1#5!#3#6!%
+      }%
+    \fi
+  \else
+    \ifx\\#4\\%
+      \ifx\\#3\\%
+        \BIC at AfterFiFiFi{%
+          \BIC at SubXY#2!{}!#1#5!#60!%
+        }%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at SubXY#2!{}!#1#5!#3#6!%
+        }%
+      \fi
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at SubXY#2!#4!#1#5!#3#6!%
+      }%
+    \fi
+  \BIC at Fi
+}
+\def\BIC at DoSub#1#2!#3#4!#5#6!{%
+  \ifx\\#4\\%
+    \BIC at AfterFi{%
+      \expandafter\expandafter\expandafter\BIC at SubResult
+      \BIC at SubDigit#1#3#5#2%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \expandafter\expandafter\expandafter\BIC at DoSub
+      \BIC at SubDigit#1#3#5#2!#4!#6!%
+    }%
+  \BIC at Fi
+}
+\def\BIC at SubResult#1{%
+  \ifx#10%
+    \expandafter\BIC at SubResult
+  \else
+    \expandafter\BIC at Space\expandafter#1%
+  \fi
+}
+\def\BIC at SubDigit#1#2#3{%
+  \romannumeral0%
+& \expandafter\BIC@@SubDigit\the\numexpr#2-#3-#1!%
+$ \expandafter\BIC@@AddDigit\number
+$   \csname
+$     BIC at SubCarry%
+$     \ifcase#1 %
+$       #3%
+$     \else
+$       \ifcase#3 1\or2\or3\or4\or5\or6\or7\or8\or9\or10\fi
+$     \fi
+$   \endcsname#2!%
+}
+& \def\BIC@@SubDigit#1!{%
+&   \ifnum#1<0 %
+&     \BIC at AfterFi{%
+&       \expandafter\BIC at Space
+&       \expandafter1\the\numexpr#1+10\relax
+&     }%
+&   \else
+&     \BIC at AfterFi{ 0#1}%
+&   \BIC at Fi
+& }%
+$ \expandafter\def\csname BIC at SubCarry0\endcsname#1{#1}%
+$ \expandafter\def\csname BIC at SubCarry10\endcsname#1{1#1}%
+$ \def\BIC at Temp#1#2{%
+$   \expandafter\def\csname BIC at SubCarry#1\endcsname##1{%
+$     \ifcase##1 #2%
+$?    \else\BigIntCalcError:ThisCannotHappen%
+$     \fi
+$   }%
+$ }%
+$ \BIC at Temp 1{19\or0\or1\or2\or3\or4\or5\or6\or7\or8}%
+$ \BIC at Temp 2{18\or19\or0\or1\or2\or3\or4\or5\or6\or7}%
+$ \BIC at Temp 3{17\or18\or19\or0\or1\or2\or3\or4\or5\or6}%
+$ \BIC at Temp 4{16\or17\or18\or19\or0\or1\or2\or3\or4\or5}%
+$ \BIC at Temp 5{15\or16\or17\or18\or19\or0\or1\or2\or3\or4}%
+$ \BIC at Temp 6{14\or15\or16\or17\or18\or19\or0\or1\or2\or3}%
+$ \BIC at Temp 7{13\or14\or15\or16\or17\or18\or19\or0\or1\or2}%
+$ \BIC at Temp 8{12\or13\or14\or15\or16\or17\or18\or19\or0\or1}%
+$ \BIC at Temp 9{11\or12\or13\or14\or15\or16\or17\or18\or19\or0}%
+\def\bigintcalcShl#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Shl
+  \bigintcalcNum{#1}!%
+}
+\def\BIC at Shl#1#2!{%
+  \ifx#1-%
+    \BIC at AfterFi{%
+      \expandafter-\romannumeral0%
+&     \BIC@@Shl#2!!%
+$     \BIC at AddXY#2!#2!!!%
+    }%
+  \else
+    \BIC at AfterFi{%
+&     \BIC@@Shl#1#2!!%
+$     \BIC at AddXY#1#2!#1#2!!!%
+    }%
+  \BIC at Fi
+}
+\def\BigIntCalcShl#1!{%
+  \romannumeral0%
+& \BIC@@Shl#1!!%
+$ \BIC at AddXY#1!#1!!!%
+}
+& \def\BIC@@Shl#1#2!{%
+&   \ifx\\#2\\%
+&     \BIC at AfterFi{%
+&       \BIC@@@Shl0!#1%
+&     }%
+&   \else
+&     \BIC at AfterFi{%
+&       \BIC@@Shl#2!#1%
+&     }%
+&   \BIC at Fi
+& }%
+& \def\BIC@@@Shl#1#2!#3#4!{%
+&   \ifx\\#4\\%
+&     \BIC at AfterFi{%
+&       \expandafter\BIC at Space
+&       \the\numexpr#3*2+#1\relax#2%
+&     }%
+&   \else
+&     \BIC at AfterFi{%
+&       \expandafter\BIC@@@@Shl\the\numexpr#3*2+#1!#2!#4!%
+&     }%
+&   \BIC at Fi
+& }%
+& \def\BIC@@@@Shl#1!{%
+&   \ifnum#1<10 %
+&     \BIC at AfterFi{%
+&       \BIC@@@Shl0#1%
+&     }%
+&   \else
+&     \BIC at AfterFi{%
+&       \BIC@@@Shl#1%
+&     }%
+&   \BIC at Fi
+& }%
+\def\bigintcalcShr#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Shr
+  \bigintcalcNum{#1}!%
+}
+\def\BIC at Shr#1#2!{%
+  \ifx#1-%
+    \expandafter-\romannumeral0%
+    \BIC at AfterFi{%
+      \BIC@@Shr#2!%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \BIC@@Shr#1#2!%
+    }%
+  \BIC at Fi
+}
+\def\BigIntCalcShr#1!{%
+  \romannumeral0%
+  \BIC@@Shr#1!%
+}
+\def\BIC@@Shr#1#2!{%
+  \ifcase#1 %
+    \BIC at AfterFi{ 0}%
+  \or
+    \ifx\\#2\\%
+      \BIC at AfterFiFi{ 0}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC@@@Shr#1#2!!%
+      }%
+    \fi
+  \else
+    \BIC at AfterFi{%
+      \BIC@@@Shr0#1#2!!%
+    }%
+  \BIC at Fi
+}
+\def\BIC@@@Shr#1#2#3!#4!{%
+  \ifx\\#3\\%
+    \ifodd#1#2 %
+      \BIC at AfterFiFi{%
+&       \expandafter\BIC at ShrResult\the\numexpr(#1#2-1)/2\relax
+$       \expandafter\expandafter\expandafter\BIC at ShrResult
+$       \csname BIC at ShrDigit#1#2\endcsname
+        #4!%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+&       \expandafter\BIC at ShrResult\the\numexpr#1#2/2\relax
+$       \expandafter\expandafter\expandafter\BIC at ShrResult
+$       \csname BIC at ShrDigit#1#2\endcsname
+        #4!%
+      }%
+    \fi
+  \else
+    \ifodd#1#2 %
+      \BIC at AfterFiFi{%
+&       \expandafter\BIC@@@@Shr\the\numexpr(#1#2-1)/2\relax1%
+$       \expandafter\expandafter\expandafter\BIC@@@@Shr
+$       \csname BIC at ShrDigit#1#2\endcsname
+        #3!#4!%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+&       \expandafter\BIC@@@@Shr\the\numexpr#1#2/2\relax0%
+$       \expandafter\expandafter\expandafter\BIC@@@@Shr
+$       \csname BIC at ShrDigit#1#2\endcsname
+        #3!#4!%
+      }%
+    \fi
+  \BIC at Fi
+}
+& \def\BIC at ShrResult#1#2!{ #2#1}%
+$ \def\BIC at ShrResult#1#2#3!{ #3#1}%
+\def\BIC@@@@Shr#1#2#3!#4!{%
+  \BIC@@@Shr#2#3!#4#1!%
+}
+$ \def\BIC at Temp#1#2#3#4{%
+$   \expandafter\def\csname BIC at ShrDigit#1#2\endcsname{#3#4}%
+$ }%
+$ \BIC at Temp 0000%
+$ \BIC at Temp 0101%
+$ \BIC at Temp 0210%
+$ \BIC at Temp 0311%
+$ \BIC at Temp 0420%
+$ \BIC at Temp 0521%
+$ \BIC at Temp 0630%
+$ \BIC at Temp 0731%
+$ \BIC at Temp 0840%
+$ \BIC at Temp 0941%
+$ \BIC at Temp 1050%
+$ \BIC at Temp 1151%
+$ \BIC at Temp 1260%
+$ \BIC at Temp 1361%
+$ \BIC at Temp 1470%
+$ \BIC at Temp 1571%
+$ \BIC at Temp 1680%
+$ \BIC at Temp 1781%
+$ \BIC at Temp 1890%
+$ \BIC at Temp 1991%
+\def\BIC at Tim#1!#2{%
+  \romannumeral0%
+  \ifcase#2 % 0
+    \BIC at AfterFi{ 0}%
+  \or % 1
+    \BIC at AfterFi{ #1}%
+  \or % 2
+    \BIC at AfterFi{%
+      \BIC at Shl#1!%
+    }%
+  \else % 3-9
+    \BIC at AfterFi{%
+      \BIC@@Tim#1!!#2%
+    }%
+  \BIC at Fi
+}
+\def\BIC@@Tim#1#2!{%
+  \ifx\\#2\\%
+    \BIC at AfterFi{%
+      \BIC at ProcessTim0!#1%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \BIC@@Tim#2!#1%
+    }%
+  \BIC at Fi
+}
+\def\BIC at ProcessTim#1#2!#3#4!#5{%
+  \ifx\\#4\\%
+    \BIC at AfterFi{%
+      \expandafter\BIC at Space
+&     \the\numexpr#3*#5+#1\relax
+$     \romannumeral0\BIC at TimDigit#3#5#1%
+      #2%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \expandafter\BIC@@ProcessTim
+&     \the\numexpr#3*#5+#1%
+$     \romannumeral0\BIC at TimDigit#3#5#1%
+      !#2!#4!#5%
+    }%
+  \BIC at Fi
+}
+\def\BIC@@ProcessTim#1#2!{%
+  \ifx\\#2\\%
+    \BIC at AfterFi{%
+      \BIC at ProcessTim0#1%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \BIC at ProcessTim#1#2%
+    }%
+  \BIC at Fi
+}
+$ \def\BIC at TimDigit#1#2#3{%
+$   \ifcase#1 % 0
+$     \BIC at AfterFi{ #3}%
+$   \or % 1
+$     \BIC at AfterFi{%
+$       \expandafter\BIC at Space
+$       \number\csname BIC at AddCarry#2\endcsname#3 %
+$     }%
+$   \else
+$     \ifcase#3 %
+$       \BIC at AfterFiFi{%
+$         \expandafter\BIC at Space
+$         \number\csname BIC at MulDigit#2\endcsname#1 %
+$       }%
+$     \else
+$       \BIC at AfterFiFi{%
+$         \expandafter\BIC at Space
+$         \romannumeral0%
+$         \expandafter\BIC at AddXY
+$         \number\csname BIC at MulDigit#2\endcsname#1!%
+$         #3!!!%
+$       }%
+$     \fi
+$   \BIC at Fi
+$ }%
+$ \def\BIC at Temp#1#2{%
+$   \expandafter\def\csname BIC at MulDigit#1\endcsname##1{%
+$     \ifcase##1 0%
+$     \or ##1%
+$     \or #2%
+$?    \else\BigIntCalcError:ThisCannotHappen%
+$     \fi
+$   }%
+$ }%
+$ \BIC at Temp 3{6\or9\or12\or15\or18\or21\or24\or27}%
+$ \BIC at Temp 4{8\or12\or16\or20\or24\or28\or32\or36}%
+$ \BIC at Temp 5{10\or15\or20\or25\or30\or35\or40\or45}%
+$ \BIC at Temp 6{12\or18\or24\or30\or36\or42\or48\or54}%
+$ \BIC at Temp 7{14\or21\or28\or35\or42\or49\or56\or63}%
+$ \BIC at Temp 8{16\or24\or32\or40\or48\or56\or64\or72}%
+$ \BIC at Temp 9{18\or27\or36\or45\or54\or63\or72\or81}%
+\def\bigintcalcMul#1#2{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Mul
+  \bigintcalcNum{#1}!{#2}%
+}
+\def\BIC at Mul#1!#2{%
+  \expandafter\expandafter\expandafter\BIC at MulSwitch
+  \bigintcalcNum{#2}!#1!%
+}
+\def\BIC at MulSwitch#1#2!#3#4!{%
+  \ifcase\BIC at Sgn#1#2! % x = 0
+    \BIC at AfterFi{ 0}%
+  \or % x > 0
+    \ifcase\BIC at Sgn#3#4! % y = 0
+      \BIC at AfterFiFi{ 0}%
+    \or % y > 0
+      \ifnum\BIC at PosCmp#1#2!#3#4!=1 % x > y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#1#2!#3#4!%
+        }%
+      \else % x <= y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#3#4!#1#2!%
+        }%
+      \fi
+    \else % y < 0
+      \expandafter-\romannumeral0%
+      \ifnum\BIC at PosCmp#1#2!#4!=1 % x > -y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#1#2!#4!%
+        }%
+      \else % x <= -y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#4!#1#2!%
+        }%
+      \fi
+    \fi
+  \else % x < 0
+    \ifcase\BIC at Sgn#3#4! % y = 0
+      \BIC at AfterFiFi{ 0}%
+    \or % y > 0
+      \expandafter-\romannumeral0%
+      \ifnum\BIC at PosCmp#2!#3#4!=1 % -x > y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#2!#3#4!%
+        }%
+      \else % -x <= y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#3#4!#2!%
+        }%
+      \fi
+    \else % y < 0
+      \ifnum\BIC at PosCmp#2!#4!=1 % -x > -y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#2!#4!%
+        }%
+      \else % -x <= -y
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessMul0!#4!#2!%
+        }%
+      \fi
+    \fi
+  \BIC at Fi
+}
+\def\BigIntCalcMul#1!#2!{%
+  \romannumeral0%
+  \BIC at ProcessMul0!#1!#2!%
+}
+\def\BIC at ProcessMul#1!#2!#3#4!{%
+  \ifx\\#4\\%
+    \BIC at AfterFi{%
+      \expandafter\expandafter\expandafter\BIC at Space
+      \bigintcalcAdd{\BIC at Tim#2!#3}{#10}%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \expandafter\expandafter\expandafter\BIC at ProcessMul
+      \bigintcalcAdd{\BIC at Tim#2!#3}{#10}!#2!#4!%
+    }%
+  \BIC at Fi
+}
+\def\bigintcalcSqr#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Sqr
+  \bigintcalcNum{#1}!%
+}
+\def\BIC at Sqr#1{%
+   \ifx#1-%
+     \expandafter\BIC@@Sqr
+   \else
+     \expandafter\BIC@@Sqr\expandafter#1%
+   \fi
+}
+\def\BIC@@Sqr#1!{%
+  \BIC at ProcessMul0!#1!#1!%
+}
+\def\bigintcalcFac#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Fac
+  \bigintcalcNum{#1}!%
+}
+\def\BIC at Fac#1#2!{%
+  \ifx#1-%
+    \BIC at AfterFi{ 0\BigIntCalcError:FacNegative}%
+  \else
+    \ifnum\BIC at PosCmp#1#2!13!<0 %
+      \ifcase#1#2 %
+         \BIC at AfterFiFiFi{ 1}% 0!
+      \or\BIC at AfterFiFiFi{ 1}% 1!
+      \or\BIC at AfterFiFiFi{ 2}% 2!
+      \or\BIC at AfterFiFiFi{ 6}% 3!
+      \or\BIC at AfterFiFiFi{ 24}% 4!
+      \or\BIC at AfterFiFiFi{ 120}% 5!
+      \or\BIC at AfterFiFiFi{ 720}% 6!
+      \or\BIC at AfterFiFiFi{ 5040}% 7!
+      \or\BIC at AfterFiFiFi{ 40320}% 8!
+      \or\BIC at AfterFiFiFi{ 362880}% 9!
+      \or\BIC at AfterFiFiFi{ 3628800}% 10!
+      \or\BIC at AfterFiFiFi{ 39916800}% 11!
+      \or\BIC at AfterFiFiFi{ 479001600}% 12!
+?     \else\BigIntCalcError:ThisCannotHappen%
+      \fi
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at ProcessFac#1#2!479001600!%
+      }%
+    \fi
+  \BIC at Fi
+}
+\def\BIC at ProcessFac#1!#2!{%
+  \ifnum\BIC at PosCmp#1!12!=0 %
+    \BIC at AfterFi{ #2}%
+  \else
+    \BIC at AfterFi{%
+      \expandafter\BIC@@ProcessFac
+      \romannumeral0\BIC at ProcessMul0!#2!#1!%
+      !#1!%
+    }%
+  \BIC at Fi
+}
+\def\BIC@@ProcessFac#1!#2!{%
+  \expandafter\BIC at ProcessFac
+  \romannumeral0\BIC at Dec#2!{}%
+  !#1!%
+}
+\def\bigintcalcPow#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Pow
+  \bigintcalcNum{#1}!%
+}
+\def\BIC at Pow#1!#2{%
+  \expandafter\expandafter\expandafter\BIC at PowSwitch
+  \bigintcalcNum{#2}!#1!%
+}
+\def\BIC at PowSwitch#1#2!#3#4!{%
+  \ifcase\ifx\\#2\\%
+           \ifx#100 % y = 0
+           \else\ifx#111 % y = 1
+           \else\ifx#122 % y = 2
+           \else4 % y > 2
+           \fi\fi\fi
+         \else
+           \ifx#1-3 % y < 0
+           \else4 % y > 2
+           \fi
+         \fi
+    \BIC at AfterFi{ 1}% y = 0
+  \or % y = 1
+    \BIC at AfterFi{ #3#4}%
+  \or % y = 2
+    \ifx#3-% x < 0
+      \BIC at AfterFiFi{%
+        \BIC at ProcessMul0!#4!#4!%
+      }%
+    \else % x >= 0
+      \BIC at AfterFiFi{%
+        \BIC at ProcessMul0!#3#4!#3#4!%
+      }%
+    \fi
+  \or % y < 0
+    \ifcase\ifx\\#4\\%
+             \ifx#300 % x = 0
+             \else\ifx#311 % x = 1
+             \else3 % x > 1
+             \fi\fi
+           \else
+             \ifcase\BIC at MinusOne#3#4! %
+               3 % |x| > 1
+             \or
+               2 % x = -1
+?            \else\BigIntCalcError:ThisCannotHappen%
+             \fi
+           \fi
+      \BIC at AfterFiFi{ 0\BigIntCalcError:DivisionByZero}% x = 0
+    \or % x = 1
+      \BIC at AfterFiFi{ 1}% x = 1
+    \or % x = -1
+      \ifcase\BIC at ModTwo#2! % even(y)
+        \BIC at AfterFiFiFi{ 1}%
+      \or % odd(y)
+        \BIC at AfterFiFiFi{ -1}%
+?     \else\BigIntCalcError:ThisCannotHappen%
+      \fi
+    \or % |x| > 1
+      \BIC at AfterFiFi{ 0}%
+?   \else\BigIntCalcError:ThisCannotHappen%
+    \fi
+  \or % y > 2
+    \ifcase\ifx\\#4\\%
+             \ifx#300 % x = 0
+             \else\ifx#311 % x = 1
+             \else4 % x > 1
+             \fi\fi
+           \else
+             \ifx#3-%
+               \ifcase\BIC at MinusOne#3#4! %
+                 3 % x < -1
+               \else
+                 2 % x = -1
+               \fi
+             \else
+               4 % x > 1
+             \fi
+           \fi
+      \BIC at AfterFiFi{ 0}% x = 0
+    \or % x = 1
+      \BIC at AfterFiFi{ 1}% x = 1
+    \or % x = -1
+      \ifcase\BIC at ModTwo#1#2! % even(y)
+        \BIC at AfterFiFiFi{ 1}%
+      \or % odd(y)
+        \BIC at AfterFiFiFi{ -1}%
+?     \else\BigIntCalcError:ThisCannotHappen%
+      \fi
+    \or % x < -1
+      \ifcase\BIC at ModTwo#1#2! % even(y)
+        \BIC at AfterFiFiFi{%
+          \BIC at PowRec#4!#1#2!1!%
+        }%
+      \or % odd(y)
+        \expandafter-\romannumeral0%
+        \BIC at AfterFiFiFi{%
+          \BIC at PowRec#4!#1#2!1!%
+        }%
+?     \else\BigIntCalcError:ThisCannotHappen%
+      \fi
+    \or % x > 1
+      \BIC at AfterFiFi{%
+        \BIC at PowRec#3#4!#1#2!1!%
+      }%
+?   \else\BigIntCalcError:ThisCannotHappen%
+    \fi
+? \else\BigIntCalcError:ThisCannotHappen%
+  \BIC at Fi
+}
+\def\BIC at ModTwo#1#2!{%
+  \ifx\\#2\\%
+    \ifodd#1 %
+      \BIC at AfterFiFi1%
+    \else
+      \BIC at AfterFiFi0%
+    \fi
+  \else
+    \BIC at AfterFi{%
+      \BIC at ModTwo#2!%
+    }%
+  \BIC at Fi
+}
+\def\BIC at MinusOne#1#2!{%
+  \ifx#1-%
+    \BIC@@MinusOne#2!%
+  \else
+    0%
+  \fi
+}
+\def\BIC@@MinusOne#1#2!{%
+  \ifx#11%
+    \ifx\\#2\\%
+      1%
+    \else
+      0%
+    \fi
+  \else
+    0%
+  \fi
+}
+\def\BIC at PowRec#1!#2#3!#4!{%
+  \ifcase\ifx#21\ifx\\#3\\0 \else1 \fi\else1 \fi % y = 1
+    \ifnum\BIC at PosCmp#1!#4!=1 % x > r
+      \BIC at AfterFiFi{%
+        \BIC at ProcessMul0!#1!#4!%
+      }%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at ProcessMul0!#4!#1!%
+      }%
+    \fi
+  \or
+    \ifcase\BIC at ModTwo#2#3! % even(y)
+      \BIC at AfterFiFi{%
+        \expandafter\BIC@@PowRec\romannumeral0%
+        \BIC@@Shr#2#3!%
+        !#1!#4!%
+      }%
+    \or % odd(y)
+      \ifnum\BIC at PosCmp#1!#4!=1 % x > r
+        \BIC at AfterFiFiFi{%
+          \expandafter\BIC@@@PowRec\romannumeral0%
+          \BIC at ProcessMul0!#1!#4!%
+          !#1!#2#3!%
+        }%
+      \else
+        \BIC at AfterFiFiFi{%
+          \expandafter\BIC@@@PowRec\romannumeral0%
+          \BIC at ProcessMul0!#1!#4!%
+          !#1!#2#3!%
+        }%
+      \fi
+?   \else\BigIntCalcError:ThisCannotHappen%
+    \fi
+? \else\BigIntCalcError:ThisCannotHappen%
+  \BIC at Fi
+}
+\def\BIC@@PowRec#1!#2!#3!{%
+  \expandafter\BIC at PowRec\romannumeral0%
+  \BIC at ProcessMul0!#2!#2!%
+  !#1!#3!%
+}
+\def\BIC@@@PowRec#1!#2!#3!{%
+  \expandafter\BIC@@PowRec\romannumeral0%
+  \BIC@@Shr#3!%
+  !#2!#1!%
+}
+\def\bigintcalcDiv#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Div
+  \bigintcalcNum{#1}!%
+}
+\def\BIC at Div#1!#2{%
+  \expandafter\expandafter\expandafter\BIC at DivSwitchSign
+  \bigintcalcNum{#2}!#1!%
+}
+\def\BigIntCalcDiv#1!#2!{%
+  \romannumeral0%
+  \BIC at DivSwitchSign#2!#1!%
+}
+\def\BIC at DivSwitchSign#1#2!#3#4!{%
+  \ifcase\BIC at Sgn#1#2! % y = 0
+    \BIC at AfterFi{ 0\BigIntCalcError:DivisionByZero}%
+  \or % y > 0
+    \ifcase\BIC at Sgn#3#4! % x = 0
+      \BIC at AfterFiFi{ 0}%
+    \or % x > 0
+      \BIC at AfterFiFi{%
+        \BIC at DivSwitch{}#3#4!#1#2!%
+      }%
+    \else % x < 0
+      \BIC at AfterFiFi{%
+        \BIC at DivSwitch-#4!#1#2!%
+      }%
+    \fi
+  \else % y < 0
+    \ifcase\BIC at Sgn#3#4! % x = 0
+      \BIC at AfterFiFi{ 0}%
+    \or % x > 0
+      \BIC at AfterFiFi{%
+        \BIC at DivSwitch-#3#4!#2!%
+      }%
+    \else % x < 0
+      \BIC at AfterFiFi{%
+        \BIC at DivSwitch{}#4!#2!%
+      }%
+    \fi
+  \BIC at Fi
+}
+\def\BIC at DivSwitch#1#2!#3#4!{%
+  \ifcase\BIC at PosCmp#3#4!#2!% y = x
+    \BIC at AfterFi{ #11}%
+  \or % y > x
+    \BIC at AfterFi{ 0}%
+  \else % y < x
+    \ifx\\#1\\%
+    \else
+      \expandafter-\romannumeral0%
+    \fi
+    \ifcase\ifx\\#4\\%
+             \ifx#310 % y = 1
+             \else\ifx#321 % y = 2
+             \else\ifx#342 % y = 4
+             \else3 % y > 2
+             \fi\fi\fi
+           \else
+             3 % y > 2
+           \fi
+      \BIC at AfterFiFi{ #2}% y = 1
+    \or % y = 2
+      \BIC at AfterFiFi{%
+        \BIC@@Shr#2!%
+      }%
+    \or % y = 4
+      \BIC at AfterFiFi{%
+        \expandafter\BIC@@Shr\romannumeral0%
+          \BIC@@Shr#2!!%
+      }%
+    \or % y > 2
+      \BIC at AfterFiFi{%
+        \BIC at DivStartX#2!#3#4!!!%
+      }%
+?   \else\BigIntCalcError:ThisCannotHappen%
+    \fi
+  \BIC at Fi
+}
+\def\BIC at DivStartX#1#2!#3#4!#5!#6!{%
+  \ifx\\#4\\%
+    \BIC at AfterFi{%
+      \BIC at DivStartYii#6#3#4!{#5#1}#2=!%
+    }%
+  \else
+    \BIC at AfterFi{%
+      \BIC at DivStartX#2!#4!#5#1!#6#3!%
+    }%
+  \BIC at Fi
+}
+\def\BIC at DivStartYii#1!{%
+  \expandafter\BIC at DivStartYiv\romannumeral0%
+  \BIC at Shl#1!%
+  !#1!%
+}
+\def\BIC at DivStartYiv#1!{%
+  \expandafter\BIC at DivStartYvi\romannumeral0%
+  \BIC at Shl#1!%
+  !#1!%
+}
+\def\BIC at DivStartYvi#1!#2!{%
+  \expandafter\BIC at DivStartYviii\romannumeral0%
+  \BIC at AddXY#1!#2!!!%
+  !#1!#2!%
+}
+\def\BIC at DivStartYviii#1!#2!{%
+  \expandafter\BIC at DivStart\romannumeral0%
+  \BIC at Shl#2!%
+  !#1!#2!%
+}
+\def\BIC at DivStart#1!#2!#3!#4!#5!#6!{%
+  \BIC at ProcessDiv#6!!#5!#4!#3!#2!#1!=%
+}
+\def\BIC at ProcessDiv#1#2#3!#4!#5!{%
+  \ifcase\BIC at PosCmp#5!#1!% y = #1
+    \ifx#2=%
+      \BIC at AfterFiFi{\BIC at DivCleanup{#41}}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at ProcessDiv#2#3!#41!#5!%
+      }%
+    \fi
+  \or % y > #1
+    \ifx#2=%
+      \BIC at AfterFiFi{\BIC at DivCleanup{#40}}%
+    \else
+      \ifx\\#4\\%
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessDiv{#1#2}#3!!#5!%
+        }%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessDiv{#1#2}#3!#40!#5!%
+        }%
+      \fi
+    \fi
+  \else % y < #1
+    \BIC at AfterFi{%
+      \BIC@@ProcessDiv{#1}#2#3!#4!#5!%
+    }%
+  \BIC at Fi
+}
+\def\BIC at DivCleanup#1#2={ #1}%
+\def\BIC@@ProcessDiv#1#2#3!#4!#5!#6!#7!{%
+  \ifcase\BIC at PosCmp#7!#1!% 4y = #1
+    \ifx#2=%
+      \BIC at AfterFiFi{\BIC at DivCleanup{#44}}%
+    \else
+     \BIC at AfterFiFi{%
+       \BIC at ProcessDiv#2#3!#44!#5!#6!#7!%
+     }%
+    \fi
+  \or % 4y > #1
+    \ifcase\BIC at PosCmp#6!#1!% 2y = #1
+      \ifx#2=%
+        \BIC at AfterFiFiFi{\BIC at DivCleanup{#42}}%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessDiv#2#3!#42!#5!#6!#7!%
+        }%
+      \fi
+    \or % 2y > #1
+      \ifx#2=%
+        \BIC at AfterFiFiFi{\BIC at DivCleanup{#41}}%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at DivSub#1!#5!#2#3!#41!#5!#6!#7!%
+        }%
+      \fi
+    \else % 2y < #1
+      \BIC at AfterFiFi{%
+        \expandafter\BIC at ProcessDivII\romannumeral0%
+        \BIC at SubXY#1!#6!!!%
+        !#2#3!#4!#5!23%
+        #6!#7!%
+      }%
+    \fi
+  \else % 4y < #1
+    \BIC at AfterFi{%
+      \BIC@@@ProcessDiv{#1}#2#3!#4!#5!#6!#7!%
+    }%
+  \BIC at Fi
+}
+\def\BIC at DivSub#1!#2!#3{%
+  \expandafter\BIC at ProcessDiv\expandafter{%
+    \romannumeral0%
+    \BIC at SubXY#1!#2!!!%
+    #3%
+  }%
+}
+\def\BIC at ProcessDivII#1!#2#3!#4!#5!#6#7{%
+  \ifcase\BIC at PosCmp#5!#1!% y = #1
+    \ifx#2=%
+      \BIC at AfterFiFi{\BIC at DivCleanup{#4#7}}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at ProcessDiv#2#3!#4#7!#5!%
+      }%
+    \fi
+  \or % y > #1
+    \ifx#2=%
+      \BIC at AfterFiFi{\BIC at DivCleanup{#4#6}}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at ProcessDiv{#1#2}#3!#4#6!#5!%
+      }%
+    \fi
+  \else % y < #1
+    \ifx#2=%
+      \BIC at AfterFiFi{\BIC at DivCleanup{#4#7}}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at DivSub#1!#5!#2#3!#4#7!#5!%
+      }%
+    \fi
+  \BIC at Fi
+}
+\def\BIC@@@ProcessDiv#1#2#3!#4!#5!#6!#7!#8!#9!{%
+  \ifcase\BIC at PosCmp#8!#1!% 6y = #1
+    \ifx#2=%
+      \BIC at AfterFiFi{\BIC at DivCleanup{#46}}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at ProcessDiv#2#3!#46!#5!#6!#7!#8!#9!%
+      }%
+    \fi
+  \or % 6y > #1
+    \BIC at AfterFi{%
+      \expandafter\BIC at ProcessDivII\romannumeral0%
+      \BIC at SubXY#1!#7!!!%
+      !#2#3!#4!#5!45%
+      #6!#7!#8!#9!%
+    }%
+  \else % 6y < #1
+    \ifcase\BIC at PosCmp#9!#1!% 8y = #1
+      \ifx#2=%
+        \BIC at AfterFiFiFi{\BIC at DivCleanup{#48}}%
+      \else
+        \BIC at AfterFiFiFi{%
+          \BIC at ProcessDiv#2#3!#48!#5!#6!#7!#8!#9!%
+        }%
+      \fi
+    \or % 8y > #1
+      \BIC at AfterFiFi{%
+        \expandafter\BIC at ProcessDivII\romannumeral0%
+        \BIC at SubXY#1!#8!!!%
+        !#2#3!#4!#5!67%
+        #6!#7!#8!#9!%
+      }%
+    \else % 8y < #1
+      \BIC at AfterFiFi{%
+        \expandafter\BIC at ProcessDivII\romannumeral0%
+        \BIC at SubXY#1!#9!!!%
+        !#2#3!#4!#5!89%
+        #6!#7!#8!#9!%
+      }%
+    \fi
+  \BIC at Fi
+}
+\def\bigintcalcMod#1{%
+  \romannumeral0%
+  \expandafter\expandafter\expandafter\BIC at Mod
+  \bigintcalcNum{#1}!%
+}
+\def\BIC at Mod#1!#2{%
+  \expandafter\expandafter\expandafter\BIC at ModSwitchSign
+  \bigintcalcNum{#2}!#1!%
+}
+\def\BigIntCalcMod#1!#2!{%
+  \romannumeral0%
+  \BIC at ModSwitchSign#2!#1!%
+}
+\def\BIC at ModSwitchSign#1#2!#3#4!{%
+  \ifcase\ifx\\#2\\%
+           \ifx#100 % y = 0
+           \else1 % y > 0
+           \fi
+          \else
+            \ifx#1-2 % y < 0
+            \else1 % y > 0
+            \fi
+          \fi
+    \BIC at AfterFi{ 0\BigIntCalcError:DivisionByZero}%
+  \or % y > 0
+    \ifcase\ifx\\#4\\\ifx#300 \else1 \fi\else1 \fi % x = 0
+      \BIC at AfterFiFi{ 0}%
+    \else
+      \BIC at AfterFiFi{%
+        \BIC at ModSwitch{}#3#4!#1#2!%
+      }%
+    \fi
+  \else % y < 0
+    \ifcase\ifx\\#4\\%
+             \ifx#300 % x = 0
+             \else1 % x > 0
+             \fi
+           \else
+             \ifx#3-2 % x < 0
+             \else1 % x > 0
+             \fi
+           \fi
+      \BIC at AfterFiFi{ 0}%
+    \or % x > 0
+      \BIC at AfterFiFi{%
+        \BIC at ModSwitch--#3#4!#2!%
+      }%
+    \else % x < 0
+      \BIC at AfterFiFi{%
+        \BIC at ModSwitch-#4!#2!%
+      }%
+    \fi
+  \BIC at Fi
+}
+\def\BIC at ModSwitch#1#2#3!#4#5!{%
+  \ifcase\ifx\\#5\\%
+           \ifx#410 % y = 1
+           \else\ifx#421 % y = 2
+           \else2 % y > 2
+           \fi\fi
+         \else2 % y > 2
+         \fi
+    \BIC at AfterFi{ 0}% y = 1
+  \or % y = 2
+    \ifcase\BIC at ModTwo#2#3! % even(x)
+      \BIC at AfterFiFi{ 0}%
+    \or % odd(x)
+      \BIC at AfterFiFi{ #11}%
+?   \else\BigIntCalcError:ThisCannotHappen%
+    \fi
+  \or % y > 2
+    \ifx\\#1\\%
+    \else
+      \expandafter\BIC at Space\romannumeral0%
+      \expandafter\BIC at ModMinus\romannumeral0%
+    \fi
+    \ifx#2-% x < 0
+      \BIC at AfterFiFi{%
+        \expandafter\expandafter\expandafter\BIC at ModX
+        \bigintcalcSub{#2#3}{%
+          \bigintcalcMul{#4#5}{\bigintcalcDiv{#2#3}{#4#5}}%
+        }!#4#5!%
+      }%
+    \else % x > 0
+      \BIC at AfterFiFi{%
+        \expandafter\expandafter\expandafter\BIC at Space
+        \bigintcalcSub{#2#3}{%
+          \bigintcalcMul{#4#5}{\bigintcalcDiv{#2#3}{#4#5}}%
+        }%
+      }%
+    \fi
+? \else\BigIntCalcError:ThisCannotHappen%
+  \BIC at Fi
+}
+\def\BIC at ModMinus#1{%
+  \ifx#10%
+    \BIC at AfterFi{ 0}%
+  \else
+    \BIC at AfterFi{ -#1}%
+  \BIC at Fi
+}
+\def\BIC at ModX#1#2!#3!{%
+  \ifx#1-% z < 0
+    \BIC at AfterFi{%
+      \expandafter\BIC at Space\romannumeral0%
+      \BIC at SubXY#3!#2!!!%
+    }%
+  \else % z >= 0
+    \BIC at AfterFi{ #1#2}%
+  \BIC at Fi
+}
+\BIC at AtEnd%
+%% \section{Installation}
+\endinput
+%%
+%% End of file `bigintcalc.sty'.


Property changes on: trunk/Master/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2019-12-17 23:27:53 UTC (rev 53171)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2019-12-17 23:29:01 UTC (rev 53172)
@@ -121,7 +121,8 @@
     bibtopicprefix bibexport bibunits
     bidi bidi-atbegshi bidicontour bidihl
     bidipagegrid bidipresentation bidishadowtext
-    bigfoot bigints binarytree binomexp biochemistry-colors biocon biolett-bst
+    bigfoot bigintcalc bigints binarytree binomexp
+    biochemistry-colors biocon biolett-bst
     bitelist bitpattern bitset bitter bizcard
     blacklettert1 blindtext blkarray
     blochsphere block blockdraw_mp bloques blowup blox

Added: trunk/Master/tlpkg/tlpsrc/bigintcalc.tlpsrc
===================================================================
Modified: trunk/Master/tlpkg/tlpsrc/collection-latex.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latex.tlpsrc	2019-12-17 23:27:53 UTC (rev 53171)
+++ trunk/Master/tlpkg/tlpsrc/collection-latex.tlpsrc	2019-12-17 23:29:01 UTC (rev 53172)
@@ -13,6 +13,7 @@
 depend babel
 depend babel-english
 depend babelbib
+depend bigintcalc
 depend bookmark
 depend carlisle
 depend colortbl



More information about the tex-live-commits mailing list