diff options
author | Karl Berry <karl@freefriends.org> | 2014-10-28 22:36:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-10-28 22:36:18 +0000 |
commit | 6751ea76abc2df59197ab3c20fe780ecf9de81fb (patch) | |
tree | f0ddbcd0525b27fc8755bec4c667f0a4b076b2a0 /Master/texmf-dist/tex | |
parent | 1eff88f8256fc97ff44035cfd29e162947e4fd67 (diff) |
xint (28oct14)
git-svn-id: svn://tug.org/texlive/trunk@35458 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xint.sty | 2285 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintbinhex.sty | 71 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintcfrac.sty | 45 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintcore.sty | 2104 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintexpr.sty | 2508 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintfrac.sty | 488 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintgcd.sty | 113 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintkernel.sty | 254 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintseries.sty | 45 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xinttools.sty | 254 |
10 files changed, 4715 insertions, 3452 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty index 28cbf05146e..b105b592d96 100644 --- a/Master/texmf-dist/tex/generic/xint/xint.sty +++ b/Master/texmf-dist/tex/generic/xint/xint.sty @@ -20,11 +20,11 @@ %% original source files, as listed above, are part of the %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) -%%---------------------------------------------------------------- -%% The xint bundle (version 1.09n of April 1st, 2014) -%% xint: Expandable operations on long numbers +%% --------------------------------------------------------------- +%% The xint bundle v1.1 (2014/10/28) %% Copyright (C) 2013-2014 by Jean-Francois Burnol -%%---------------------------------------------------------------- +%% xint: Expandable operations on big integers +%% --------------------------------------------------------------- \begingroup\catcode61\catcode48\catcode32=10\relax% \catcode13=5 % ^^M \endlinechar=13 % @@ -36,10 +36,9 @@ \catcode45=12 % - \catcode46=12 % . \catcode58=12 % : - \def\space { }% \let\z\endgroup \expandafter\let\expandafter\x\csname ver@xint.sty\endcsname - \expandafter\let\expandafter\w\csname ver@xinttools.sty\endcsname + \expandafter\let\expandafter\w\csname ver@xintcore.sty\endcsname \expandafter \ifx\csname PackageInfo\endcsname\relax \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% @@ -51,150 +50,55 @@ \y{xint}{\numexpr not available, aborting input}% \aftergroup\endinput \else - \ifx\x\relax % plain-TeX, first loading of xint.sty - \ifx\w\relax % but xinttools.sty not yet loaded. - \y{xint}{now issuing \string\input\space xinttools.sty}% - \def\z{\endgroup\input xinttools.sty\relax}% + \ifx\x\relax % plain-TeX, first loading of xintcore.sty + \ifx\w\relax % but xintkernel.sty not yet loaded. + \def\z{\endgroup\input xintcore.sty\relax}% \fi \else \def\empty {}% \ifx\x\empty % LaTeX, first loading, % variable is initialized, but \ProvidesPackage not yet seen - \ifx\w\relax % xinttools.sty not yet loaded. - \y{xint}{now issuing \string\RequirePackage{xinttools}}% - \def\z{\endgroup\RequirePackage{xinttools}}% + \ifx\w\relax % xintcore.sty not yet loaded. + \def\z{\endgroup\RequirePackage{xintcore}}% \fi \else - \y{xint}{I was already loaded, aborting input}% - \aftergroup\endinput + \aftergroup\endinput % xint already loaded. \fi \fi \fi \z% -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode123=1 % { - \catcode125=2 % } - \catcode64=11 % @ - \catcode35=6 % # - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode58=12 % : - \ifdefined\PackageInfo - \def\y#1#2{\PackageInfo{#1}{#2}}% - \else - \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% - \fi - \def\empty {}% - \expandafter\let\expandafter\w\csname ver@xinttools.sty\endcsname - \ifx\w\relax % Plain TeX, user gave a file name at the prompt - \y{xint}{Loading of package xinttools failed, aborting input}% - \aftergroup\endinput - \fi - \ifx\w\empty % LaTeX, user gave a file name at the prompt - \y{xint}{Loading of package xinttools failed, aborting input}% - \aftergroup\endinput - \fi -\endgroup% -\XINTsetupcatcodes% +\XINTsetupcatcodes% defined in xintkernel.sty (loaded by xintcore.sty) \XINT_providespackage \ProvidesPackage{xint}% - [2014/04/01 v1.09n Expandable operations on long numbers (jfB)]% + [2014/10/28 v1.1 Expandable operations on big integers (jfB)]% \long\def\xint_firstofthree #1#2#3{#1}% \long\def\xint_secondofthree #1#2#3{#2}% \long\def\xint_thirdofthree #1#2#3{#3}% \long\def\xint_firstofthree_thenstop #1#2#3{ #1}% 1.09i \long\def\xint_secondofthree_thenstop #1#2#3{ #2}% \long\def\xint_thirdofthree_thenstop #1#2#3{ #3}% -\def\xint_gob_til_zeros_iii #1000{}% -\def\xint_gob_til_zeros_iv #10000{}% -\def\xint_gob_til_one #11{}% -\def\xint_gob_til_G #1G{}% -\def\xint_gob_til_minus #1-{}% -\def\xint_gob_til_relax #1\relax {}% -\def\xint_exchangetwo_keepbraces #1#2{{#2}{#1}}% -\def\xint_exchangetwo_keepbraces_thenstop #1#2{ {#2}{#1}}% -\def\xint_UDzerofork #10#2#3\krof {#2}% -\def\xint_UDsignfork #1-#2#3\krof {#2}% -\def\xint_UDwfork #1\W#2#3\krof {#2}% -\def\xint_UDzerosfork #100#2#3\krof {#2}% -\def\xint_UDonezerofork #110#2#3\krof {#2}% -\def\xint_UDsignsfork #1--#2#3\krof {#2}% -\chardef\xint_c_ix 9 -\chardef\xint_c_x 10 -\chardef\xint_c_ii^v 32 % not used in xint, common to xintfrac and xintbinhex -\chardef\xint_c_ii^vi 64 -\mathchardef\xint_c_ixixixix 9999 -\mathchardef\xint_c_x^iv 10000 -\newcount\xint_c_x^viii \xint_c_x^viii 100000000 -\def\xintRev {\romannumeral0\xintrev }% -\def\xintrev #1% -{% - \expandafter\XINT_rev_fork - \romannumeral-`0#1\xint_relax % empty #1 ok, \xint_relax stops expansion - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_relax -}% -\def\XINT_rev_fork #1% -{% - \xint_UDsignfork - #1{\expandafter\xint_minus_thenstop\romannumeral0\XINT_rord_main {}}% - -{\XINT_rord_main {}#1}% - \krof -}% -\def\xintLen {\romannumeral0\xintlen }% -\def\xintlen #1% -{% - \expandafter\XINT_len_fork - \romannumeral0\xintnum{#1}\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye -}% -\def\XINT_Len #1% variant which does not expand via \xintnum. -{% - \romannumeral0\XINT_len_fork - #1\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye -}% -\def\XINT_len_fork #1% +\def\xintSgnFork {\romannumeral0\xintsgnfork }% +\def\xintsgnfork #1% {% - \expandafter\XINT_length_loop - \xint_UDsignfork - #1{0.}% - -{0.#1}% - \krof + \ifcase #1 \expandafter\xint_secondofthree_thenstop + \or\expandafter\xint_thirdofthree_thenstop + \else\expandafter\xint_firstofthree_thenstop + \fi }% -\def\XINT_RQ #1#2#3#4#5#6#7#8#9% +\def\xintIsOne {\romannumeral0\xintisone }% +\def\xintisone #1{\expandafter\XINT_isone\romannumeral0\xintnum{#1}\W\Z }% +\def\XINT_isOne #1{\romannumeral0\XINT_isone #1\W\Z }% +\def\XINT_isone #1#2% {% - \xint_gob_til_R #9\XINT_RQ_end_a\R\XINT_RQ {#9#8#7#6#5#4#3#2#1}% + \xint_gob_til_one #1\XINT_isone_b 1% + \expandafter\space\expandafter 0\xint_gob_til_Z #2% }% -\def\XINT_RQ_end_a\R\XINT_RQ #1#2\Z +\def\XINT_isone_b #1\xint_gob_til_Z #2% {% - \XINT_RQ_end_b #1\Z + \xint_gob_til_W #2\XINT_isone_yes \W + \expandafter\space\expandafter 0\xint_gob_til_Z }% -\def\XINT_RQ_end_b #1#2#3#4#5#6#7#8% -{% - \xint_gob_til_R - #8\XINT_RQ_end_viii - #7\XINT_RQ_end_vii - #6\XINT_RQ_end_vi - #5\XINT_RQ_end_v - #4\XINT_RQ_end_iv - #3\XINT_RQ_end_iii - #2\XINT_RQ_end_ii - \R\XINT_RQ_end_i - \Z #2#3#4#5#6#7#8% -}% -\def\XINT_RQ_end_viii #1\Z #2#3#4#5#6#7#8#9\Z { #9}% -\def\XINT_RQ_end_vii #1\Z #2#3#4#5#6#7#8#9\Z { #8#9000}% -\def\XINT_RQ_end_vi #1\Z #2#3#4#5#6#7#8#9\Z { #7#8#900}% -\def\XINT_RQ_end_v #1\Z #2#3#4#5#6#7#8#9\Z { #6#7#8#90}% -\def\XINT_RQ_end_iv #1\Z #2#3#4#5#6#7#8#9\Z { #5#6#7#8#9}% -\def\XINT_RQ_end_iii #1\Z #2#3#4#5#6#7#8#9\Z { #4#5#6#7#8#9000}% -\def\XINT_RQ_end_ii #1\Z #2#3#4#5#6#7#8#9\Z { #3#4#5#6#7#8#900}% -\def\XINT_RQ_end_i \Z #1#2#3#4#5#6#7#8\Z { #1#2#3#4#5#6#7#80}% +\def\XINT_isone_yes #1\Z { 1}% \def\XINT_SQ #1#2#3#4#5#6#7#8% {% \xint_gob_til_R #8\XINT_SQ_end_a\R\XINT_SQ {#8#7#6#5#4#3#2#1}% @@ -222,190 +126,59 @@ \def\XINT_SQ_end_iii #1\Z #2#3#4#5#6#7#8\Z { #4#5#6#7#8000}% \def\XINT_SQ_end_ii #1\Z #2#3#4#5#6#7#8\Z { #3#4#5#6#7#800}% \def\XINT_SQ_end_i \Z #1#2#3#4#5#6#7\Z { #1#2#3#4#5#6#70}% -\def\XINT_OQ #1#2#3#4#5#6#7#8#9% -{% - \xint_gob_til_R #9\XINT_OQ_end_a\R\XINT_OQ {#9#8#7#6#5#4#3#2#1}% -}% -\def\XINT_OQ_end_a\R\XINT_OQ #1#2\Z -{% - \XINT_OQ_end_b #1\Z -}% -\def\XINT_OQ_end_b #1#2#3#4#5#6#7#8% +\def\xintRev {\romannumeral0\xintrev }% +\def\xintrev #1% {% - \xint_gob_til_R - #8\XINT_OQ_end_viii - #7\XINT_OQ_end_vii - #6\XINT_OQ_end_vi - #5\XINT_OQ_end_v - #4\XINT_OQ_end_iv - #3\XINT_OQ_end_iii - #2\XINT_OQ_end_ii - \R\XINT_OQ_end_i - \Z #2#3#4#5#6#7#8% -}% -\def\XINT_OQ_end_viii #1\Z #2#3#4#5#6#7#8#9\Z { #9}% -\def\XINT_OQ_end_vii #1\Z #2#3#4#5#6#7#8#9\Z { #8#90000000}% -\def\XINT_OQ_end_vi #1\Z #2#3#4#5#6#7#8#9\Z { #7#8#9000000}% -\def\XINT_OQ_end_v #1\Z #2#3#4#5#6#7#8#9\Z { #6#7#8#900000}% -\def\XINT_OQ_end_iv #1\Z #2#3#4#5#6#7#8#9\Z { #5#6#7#8#90000}% -\def\XINT_OQ_end_iii #1\Z #2#3#4#5#6#7#8#9\Z { #4#5#6#7#8#9000}% -\def\XINT_OQ_end_ii #1\Z #2#3#4#5#6#7#8#9\Z { #3#4#5#6#7#8#900}% -\def\XINT_OQ_end_i \Z #1#2#3#4#5#6#7#8\Z { #1#2#3#4#5#6#7#80}% -\edef\xint_cleanupzeros_andstop #1#2#3#4% -{% - \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4\relax -}% -\def\xint_cleanupzeros_nostop #1#2#3#4% -{% - \the\numexpr #1#2#3#4\relax -}% -\def\XINT_rev_andcuz #1% -{% - \expandafter\xint_cleanupzeros_andstop - \romannumeral0\XINT_rord_main {}#1% - \xint_relax + \expandafter\XINT_rev_fork + \romannumeral-`0#1\xint_relax % empty #1 ok, \xint_relax stops expansion \xint_bye\xint_bye\xint_bye\xint_bye \xint_bye\xint_bye\xint_bye\xint_bye - \xint_relax -}% -\def\XINT_cuz #1% -{% - \XINT_cuz_loop #1\W\W\W\W\W\W\W\Z% -}% -\def\XINT_cuz_loop #1#2#3#4#5#6#7#8% -{% - \xint_gob_til_W #8\xint_cuz_end_a\W - \xint_gob_til_Z #8\xint_cuz_end_A\Z - \XINT_cuz_check_a {#1#2#3#4#5#6#7#8}% -}% -\def\xint_cuz_end_a #1\XINT_cuz_check_a #2% -{% - \xint_cuz_end_b #2% -}% -\edef\xint_cuz_end_b #1#2#3#4#5\Z -{% - \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4\relax -}% -\def\xint_cuz_end_A \Z\XINT_cuz_check_a #1{ 0}% -\def\XINT_cuz_check_a #1% -{% - \expandafter\XINT_cuz_check_b\the\numexpr #1\relax -}% -\def\XINT_cuz_check_b #1% -{% - \xint_gob_til_zero #1\xint_cuz_backtoloop 0\XINT_cuz_stop #1% -}% -\def\XINT_cuz_stop #1\W #2\Z{ #1}% -\def\xint_cuz_backtoloop 0\XINT_cuz_stop 0{\XINT_cuz_loop }% -\def\xintIsOne {\romannumeral0\xintisone }% -\def\xintisone #1{\expandafter\XINT_isone\romannumeral0\xintnum{#1}\W\Z }% -\def\XINT_isOne #1{\romannumeral0\XINT_isone #1\W\Z }% -\def\XINT_isone #1#2% -{% - \xint_gob_til_one #1\XINT_isone_b 1% - \expandafter\space\expandafter 0\xint_gob_til_Z #2% -}% -\def\XINT_isone_b #1\xint_gob_til_Z #2% -{% - \xint_gob_til_W #2\XINT_isone_yes \W - \expandafter\space\expandafter 0\xint_gob_til_Z -}% -\def\XINT_isone_yes #1\Z { 1}% -\def\xintiNum {\romannumeral0\xintinum }% -\def\xintinum #1% -{% - \expandafter\XINT_num_loop - \romannumeral-`0#1\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\Z -}% -\let\xintNum\xintiNum \let\xintnum\xintinum -\def\XINT_num #1% -{% - \XINT_num_loop #1\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\Z -}% -\def\XINT_num_loop #1#2#3#4#5#6#7#8% -{% - \xint_gob_til_xint_relax #8\XINT_num_end\xint_relax - \XINT_num_NumEight #1#2#3#4#5#6#7#8% -}% -\edef\XINT_num_end\xint_relax\XINT_num_NumEight #1\xint_relax #2\Z -{% - \noexpand\expandafter\space\noexpand\the\numexpr #1+\xint_c_\relax -}% -\def\XINT_num_NumEight #1#2#3#4#5#6#7#8% -{% - \ifnum \numexpr #1#2#3#4#5#6#7#8+\xint_c_= \xint_c_ - \xint_afterfi {\expandafter\XINT_num_keepsign_a - \the\numexpr #1#2#3#4#5#6#7#81\relax}% - \else - \xint_afterfi {\expandafter\XINT_num_finish - \the\numexpr #1#2#3#4#5#6#7#8\relax}% - \fi -}% -\def\XINT_num_keepsign_a #1% -{% - \xint_gob_til_one#1\XINT_num_gobacktoloop 1\XINT_num_keepsign_b -}% -\def\XINT_num_gobacktoloop 1\XINT_num_keepsign_b {\XINT_num_loop }% -\def\XINT_num_keepsign_b #1{\XINT_num_loop -}% -\def\XINT_num_finish #1\xint_relax #2\Z { #1}% -\def\xintiiSgn {\romannumeral0\xintiisgn }% -\def\xintiisgn #1% -{% - \expandafter\XINT_sgn \romannumeral-`0#1\Z% + \xint_relax }% -\def\xintSgn {\romannumeral0\xintsgn }% -\def\xintsgn #1% +\def\XINT_rev_fork #1% {% - \expandafter\XINT_sgn \romannumeral0\xintnum{#1}\Z% + \xint_UDsignfork + #1{\expandafter\xint_minus_thenstop\romannumeral0\XINT_rord_main {}}% + -{\XINT_rord_main {}#1}% + \krof }% -\def\XINT_sgn #1#2\Z +\def\xintLen {\romannumeral0\xintlen }% +\def\xintlen #1% {% - \xint_UDzerominusfork - #1-{ 0}% - 0#1{ -1}% - 0-{ 1}% - \krof + \expandafter\XINT_len_fork + \romannumeral0\xintnum{#1}\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye }% -\def\XINT_Sgn #1#2\Z +\def\XINT_Len #1% variant which does not expand via \xintnum. {% - \xint_UDzerominusfork - #1-{0}% - 0#1{-1}% - 0-{1}% - \krof + \romannumeral0\XINT_len_fork + #1\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye }% -\def\XINT_cntSgn #1#2\Z +\def\XINT_len_fork #1% {% - \xint_UDzerominusfork - #1-\z@ - 0#1\m@ne - 0-\@ne + \expandafter\XINT_length_loop + \xint_UDsignfork + #1{0.}% + -{0.#1}% \krof }% \def\xintBool #1{\romannumeral-`0% \csname if#1\endcsname\expandafter1\else\expandafter0\fi }% \def\xintToggle #1{\romannumeral-`0\iftoggle{#1}{1}{0}}% -\def\xintSgnFork {\romannumeral0\xintsgnfork }% -\def\xintsgnfork #1% +\def\xintifSgn {\romannumeral0\xintifsgn }% +\def\xintifsgn #1% {% - \ifcase #1 \expandafter\xint_secondofthree_thenstop + \ifcase \xintSgn{#1} + \expandafter\xint_secondofthree_thenstop \or\expandafter\xint_thirdofthree_thenstop \else\expandafter\xint_firstofthree_thenstop \fi }% -\def\XINT_cntSgnFork #1% -{% - \ifcase #1\expandafter\xint_secondofthree - \or\expandafter\xint_thirdofthree - \else\expandafter\xint_firstofthree - \fi -}% -\def\xintifSgn {\romannumeral0\xintifsgn }% -\def\xintifsgn #1% +\def\xintiiifSgn {\romannumeral0\xintiiifsgn }% +\def\xintiiifsgn #1% {% - \ifcase \romannumeral0\xintsgn{#1} + \ifcase \xintiiSgn{#1} \expandafter\xint_secondofthree_thenstop \or\expandafter\xint_thirdofthree_thenstop \else\expandafter\xint_firstofthree_thenstop @@ -429,6 +202,24 @@ \expandafter\xint_firstoftwo_thenstop \fi }% +\def\xintiiifZero {\romannumeral0\xintiiifzero }% +\def\xintiiifzero #1% +{% + \if0\xintiiSgn{#1}% + \expandafter\xint_firstoftwo_thenstop + \else + \expandafter\xint_secondoftwo_thenstop + \fi +}% +\def\xintiiifNotZero {\romannumeral0\xintiiifnotzero }% +\def\xintiiifnotzero #1% +{% + \if0\xintiiSgn{#1}% + \expandafter\xint_secondoftwo_thenstop + \else + \expandafter\xint_firstoftwo_thenstop + \fi +}% \def\xintifOne {\romannumeral0\xintifone }% \def\xintifone #1% {% @@ -484,694 +275,6 @@ \expandafter\xint_secondoftwo_thenstop \fi }% -\def\xintiiOpp {\romannumeral0\xintiiopp }% -\def\xintiiopp #1% -{% - \expandafter\XINT_opp \romannumeral-`0#1% -}% -\def\xintiOpp {\romannumeral0\xintiopp }% -\def\xintiopp #1% -{% - \expandafter\XINT_opp \romannumeral0\xintnum{#1}% -}% -\let\xintOpp\xintiOpp \let\xintopp\xintiopp -\def\XINT_Opp #1{\romannumeral0\XINT_opp #1}% -\def\XINT_opp #1% -{% - \xint_UDzerominusfork - #1-{ 0}% zero - 0#1{ }% negative - 0-{ -#1}% positive - \krof -}% -\def\xintiiAbs {\romannumeral0\xintiiabs }% -\def\xintiiabs #1% -{% - \expandafter\XINT_abs \romannumeral-`0#1% -}% -\def\xintiAbs {\romannumeral0\xintiabs }% -\def\xintiabs #1% -{% - \expandafter\XINT_abs \romannumeral0\xintnum{#1}% -}% -\let\xintAbs\xintiAbs \let\xintabs\xintiabs -\def\XINT_Abs #1{\romannumeral0\XINT_abs #1}% -\def\XINT_abs #1% -{% - \xint_UDsignfork - #1{ }% - -{ #1}% - \krof -}% -\def\XINT_add_A #1#2#3#4#5#6% -{% - \xint_gob_til_W #3\xint_add_az\W - \XINT_add_AB #1{#3#4#5#6}{#2}% -}% -\def\xint_add_az\W\XINT_add_AB #1#2% -{% - \XINT_add_AC_checkcarry #1% -}% -\def\XINT_add_AB #1#2#3#4\W\X\Y\Z #5#6#7#8% -{% - \xint_gob_til_W #5\xint_add_bz\W - \XINT_add_ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z -}% -\def\XINT_add_ABE #1#2#3#4#5#6% -{% - \expandafter\XINT_add_ABEA\the\numexpr #1+10#5#4#3#2+#6.% -}% -\def\XINT_add_ABEA #1#2#3.#4% -{% - \XINT_add_A #2{#3#4}% -}% -\def\xint_add_bz\W\XINT_add_ABE #1#2#3#4#5#6% -{% - \expandafter\XINT_add_CC\the\numexpr #1+10#5#4#3#2.% -}% -\def\XINT_add_CC #1#2#3.#4% -{% - \XINT_add_AC_checkcarry #2{#3#4}% on va examiner et \'eliminer #2 -}% -\def\XINT_add_AC_checkcarry #1% -{% - \xint_gob_til_zero #1\xint_add_AC_nocarry 0\XINT_add_C -}% -\def\xint_add_AC_nocarry 0\XINT_add_C #1#2\W\X\Y\Z -{% - \expandafter - \xint_cleanupzeros_andstop - \romannumeral0% - \XINT_rord_main {}#2% - \xint_relax - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_relax - #1% -}% -\def\XINT_add_C #1#2#3#4#5% -{% - \xint_gob_til_W #2\xint_add_cz\W - \XINT_add_CD {#5#4#3#2}{#1}% -}% -\def\XINT_add_CD #1% -{% - \expandafter\XINT_add_CC\the\numexpr 1+10#1.% -}% -\def\xint_add_cz\W\XINT_add_CD #1#2{ 1#2}% -\def\XINT_addr_A #1#2#3#4#5#6% -{% - \xint_gob_til_W #3\xint_addr_az\W - \XINT_addr_B #1{#3#4#5#6}{#2}% -}% -\def\xint_addr_az\W\XINT_addr_B #1#2% -{% - \XINT_addr_AC_checkcarry #1% -}% -\def\XINT_addr_B #1#2#3#4\W\X\Y\Z #5#6#7#8% -{% - \xint_gob_til_W #5\xint_addr_bz\W - \XINT_addr_E #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z -}% -\def\XINT_addr_E #1#2#3#4#5#6% -{% - \expandafter\XINT_addr_ABEA\the\numexpr #1+10#5#4#3#2+#6\relax -}% -\def\XINT_addr_ABEA #1#2#3#4#5#6#7% -{% - \XINT_addr_A #2{#7#6#5#4#3}% -}% -\def\xint_addr_bz\W\XINT_addr_E #1#2#3#4#5#6% -{% - \expandafter\XINT_addr_CC\the\numexpr #1+10#5#4#3#2\relax -}% -\def\XINT_addr_CC #1#2#3#4#5#6#7% -{% - \XINT_addr_AC_checkcarry #2{#7#6#5#4#3}% -}% -\def\XINT_addr_AC_checkcarry #1% -{% - \xint_gob_til_zero #1\xint_addr_AC_nocarry 0\XINT_addr_C -}% -\def\xint_addr_AC_nocarry 0\XINT_addr_C #1#2\W\X\Y\Z { #1#2}% -\def\XINT_addr_C #1#2#3#4#5% -{% - \xint_gob_til_W #2\xint_addr_cz\W - \XINT_addr_D {#5#4#3#2}{#1}% -}% -\def\XINT_addr_D #1% -{% - \expandafter\XINT_addr_CC\the\numexpr 1+10#1\relax -}% -\def\xint_addr_cz\W\XINT_addr_D #1#2{ #21000}% -\def\XINT_addm_A #1#2#3#4#5#6% -{% - \xint_gob_til_W #3\xint_addm_az\W - \XINT_addm_AB #1{#3#4#5#6}{#2}% -}% -\def\xint_addm_az\W\XINT_addm_AB #1#2% -{% - \XINT_addm_AC_checkcarry #1% -}% -\def\XINT_addm_AB #1#2#3#4\W\X\Y\Z #5#6#7#8% -{% - \XINT_addm_ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z -}% -\def\XINT_addm_ABE #1#2#3#4#5#6% -{% - \expandafter\XINT_addm_ABEA\the\numexpr #1+10#5#4#3#2+#6.% -}% -\def\XINT_addm_ABEA #1#2#3.#4% -{% - \XINT_addm_A #2{#3#4}% -}% -\def\XINT_addm_AC_checkcarry #1% -{% - \xint_gob_til_zero #1\xint_addm_AC_nocarry 0\XINT_addm_C -}% -\def\xint_addm_AC_nocarry 0\XINT_addm_C #1#2\W\X\Y\Z -{% - \expandafter - \xint_cleanupzeros_andstop - \romannumeral0% - \XINT_rord_main {}#2% - \xint_relax - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_relax - #1% -}% -\def\XINT_addm_C #1#2#3#4#5% -{% - \xint_gob_til_W - #5\xint_addm_cw - #4\xint_addm_cx - #3\xint_addm_cy - #2\xint_addm_cz - \W\XINT_addm_CD {#5#4#3#2}{#1}% -}% -\def\XINT_addm_CD #1% -{% - \expandafter\XINT_addm_CC\the\numexpr 1+10#1.% -}% -\def\XINT_addm_CC #1#2#3.#4% -{% - \XINT_addm_AC_checkcarry #2{#3#4}% -}% -\def\xint_addm_cw - #1\xint_addm_cx - #2\xint_addm_cy - #3\xint_addm_cz - \W\XINT_addm_CD -{% - \expandafter\XINT_addm_CDw\the\numexpr 1+#1#2#3.% -}% -\def\XINT_addm_CDw #1.#2#3\X\Y\Z -{% - \XINT_addm_end #1#3% -}% -\def\xint_addm_cx - #1\xint_addm_cy - #2\xint_addm_cz - \W\XINT_addm_CD -{% - \expandafter\XINT_addm_CDx\the\numexpr 1+#1#2.% -}% -\def\XINT_addm_CDx #1.#2#3\Y\Z -{% - \XINT_addm_end #1#3% -}% -\def\xint_addm_cy - #1\xint_addm_cz - \W\XINT_addm_CD -{% - \expandafter\XINT_addm_CDy\the\numexpr 1+#1.% -}% -\def\XINT_addm_CDy #1.#2#3\Z -{% - \XINT_addm_end #1#3% -}% -\def\xint_addm_cz\W\XINT_addm_CD #1#2#3{\XINT_addm_end #1#3}% -\edef\XINT_addm_end #1#2#3#4#5% - {\noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5\relax}% -\def\XINT_addp_A #1#2#3#4#5#6% -{% - \xint_gob_til_W #3\xint_addp_az\W - \XINT_addp_AB #1{#3#4#5#6}{#2}% -}% -\def\xint_addp_az\W\XINT_addp_AB #1#2% -{% - \XINT_addp_AC_checkcarry #1% -}% -\def\XINT_addp_AC_checkcarry #1% -{% - \xint_gob_til_zero #1\xint_addp_AC_nocarry 0\XINT_addp_C -}% -\def\xint_addp_AC_nocarry 0\XINT_addp_C -{% - \XINT_addp_F -}% -\def\XINT_addp_AB #1#2#3#4\W\X\Y\Z #5#6#7#8% -{% - \XINT_addp_ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z -}% -\def\XINT_addp_ABE #1#2#3#4#5#6% -{% - \expandafter\XINT_addp_ABEA\the\numexpr #1+10#5#4#3#2+#6\relax -}% -\def\XINT_addp_ABEA #1#2#3#4#5#6#7% -{% - \XINT_addp_A #2{#7#6#5#4#3}%<-- attention on met donc \`a droite -}% -\def\XINT_addp_C #1#2#3#4#5% -{% - \xint_gob_til_W - #5\xint_addp_cw - #4\xint_addp_cx - #3\xint_addp_cy - #2\xint_addp_cz - \W\XINT_addp_CD {#5#4#3#2}{#1}% -}% -\def\XINT_addp_CD #1% -{% - \expandafter\XINT_addp_CC\the\numexpr 1+10#1\relax -}% -\def\XINT_addp_CC #1#2#3#4#5#6#7% -{% - \XINT_addp_AC_checkcarry #2{#7#6#5#4#3}% -}% -\def\xint_addp_cw - #1\xint_addp_cx - #2\xint_addp_cy - #3\xint_addp_cz - \W\XINT_addp_CD -{% - \expandafter\XINT_addp_CDw\the\numexpr \xint_c_i+10#1#2#3\relax -}% -\def\XINT_addp_CDw #1#2#3#4#5#6% -{% - \xint_gob_til_zeros_iv #2#3#4#5\XINT_addp_endDw_zeros - 0000\XINT_addp_endDw #2#3#4#5% -}% -\def\XINT_addp_endDw_zeros 0000\XINT_addp_endDw 0000#1\X\Y\Z{ #1}% -\def\XINT_addp_endDw #1#2#3#4#5\X\Y\Z{ #5#4#3#2#1}% -\def\xint_addp_cx - #1\xint_addp_cy - #2\xint_addp_cz - \W\XINT_addp_CD -{% - \expandafter\XINT_addp_CDx\the\numexpr \xint_c_i+100#1#2\relax -}% -\def\XINT_addp_CDx #1#2#3#4#5#6% -{% - \xint_gob_til_zeros_iv #2#3#4#5\XINT_addp_endDx_zeros - 0000\XINT_addp_endDx #2#3#4#5% -}% -\def\XINT_addp_endDx_zeros 0000\XINT_addp_endDx 0000#1\Y\Z{ #1}% -\def\XINT_addp_endDx #1#2#3#4#5\Y\Z{ #5#4#3#2#1}% -\def\xint_addp_cy #1\xint_addp_cz\W\XINT_addp_CD -{% - \expandafter\XINT_addp_CDy\the\numexpr \xint_c_i+1000#1\relax -}% -\def\XINT_addp_CDy #1#2#3#4#5#6% -{% - \xint_gob_til_zeros_iv #2#3#4#5\XINT_addp_endDy_zeros - 0000\XINT_addp_endDy #2#3#4#5% -}% -\def\XINT_addp_endDy_zeros 0000\XINT_addp_endDy 0000#1\Z{ #1}% -\def\XINT_addp_endDy #1#2#3#4#5\Z{ #5#4#3#2#1}% -\def\xint_addp_cz\W\XINT_addp_CD #1#2{ #21000}% -\def\XINT_addp_F #1#2#3#4#5% -{% - \xint_gob_til_W - #5\xint_addp_Gw - #4\xint_addp_Gx - #3\xint_addp_Gy - #2\xint_addp_Gz - \W\XINT_addp_G {#2#3#4#5}{#1}% -}% -\def\XINT_addp_G #1#2% -{% - \XINT_addp_F {#2#1}% -}% -\def\xint_addp_Gw - #1\xint_addp_Gx - #2\xint_addp_Gy - #3\xint_addp_Gz - \W\XINT_addp_G #4% -{% - \xint_gob_til_zeros_iv #3#2#10\XINT_addp_endGw_zeros - 0000\XINT_addp_endGw #3#2#10% -}% -\def\XINT_addp_endGw_zeros 0000\XINT_addp_endGw 0000#1\X\Y\Z{ #1}% -\def\XINT_addp_endGw #1#2#3#4#5\X\Y\Z{ #5#1#2#3#4}% -\def\xint_addp_Gx - #1\xint_addp_Gy - #2\xint_addp_Gz - \W\XINT_addp_G #3% -{% - \xint_gob_til_zeros_iv #2#100\XINT_addp_endGx_zeros - 0000\XINT_addp_endGx #2#100% -}% -\def\XINT_addp_endGx_zeros 0000\XINT_addp_endGx 0000#1\Y\Z{ #1}% -\def\XINT_addp_endGx #1#2#3#4#5\Y\Z{ #5#1#2#3#4}% -\def\xint_addp_Gy - #1\xint_addp_Gz - \W\XINT_addp_G #2% -{% - \xint_gob_til_zeros_iv #1000\XINT_addp_endGy_zeros - 0000\XINT_addp_endGy #1000% -}% -\def\XINT_addp_endGy_zeros 0000\XINT_addp_endGy 0000#1\Z{ #1}% -\def\XINT_addp_endGy #1#2#3#4#5\Z{ #5#1#2#3#4}% -\def\xint_addp_Gz\W\XINT_addp_G #1#2{ #2}% -\def\xintiiAdd {\romannumeral0\xintiiadd }% -\def\xintiiadd #1% -{% - \expandafter\xint_iiadd\expandafter{\romannumeral-`0#1}% -}% -\def\xint_iiadd #1#2% -{% - \expandafter\XINT_add_fork \romannumeral-`0#2\Z #1\Z -}% -\def\xintiAdd {\romannumeral0\xintiadd }% -\def\xintiadd #1% -{% - \expandafter\xint_add\expandafter{\romannumeral0\xintnum{#1}}% -}% -\def\xint_add #1#2% -{% - \expandafter\XINT_add_fork \romannumeral0\xintnum{#2}\Z #1\Z -}% -\let\xintAdd\xintiAdd \let\xintadd\xintiadd -\def\XINT_Add #1#2{\romannumeral0\XINT_add_fork #2\Z #1\Z }% -\def\XINT_add #1#2{\XINT_add_fork #2\Z #1\Z }% -\def\XINT_add_fork #1#2\Z #3#4\Z -{% - \xint_UDzerofork - #1\XINT_add_secondiszero - #3\XINT_add_firstiszero - 0 - {\xint_UDsignsfork - #1#3\XINT_add_minusminus % #1 = #3 = - - #1-\XINT_add_minusplus % #1 = - - #3-\XINT_add_plusminus % #3 = - - --\XINT_add_plusplus - \krof }% - \krof - {#2}{#4}#1#3% -}% -\def\XINT_add_secondiszero #1#2#3#4{ #4#2}% -\def\XINT_add_firstiszero #1#2#3#4{ #3#1}% -\def\XINT_add_minusminus #1#2#3#4% -{% - \expandafter\xint_minus_thenstop% - \romannumeral0\XINT_add_pre {#2}{#1}% -}% -\def\XINT_add_minusplus #1#2#3#4% -{% - \XINT_sub_pre {#4#2}{#1}% -}% -\def\XINT_add_plusminus #1#2#3#4% -{% - \XINT_sub_pre {#3#1}{#2}% -}% -\def\XINT_add_plusplus #1#2#3#4% -{% - \XINT_add_pre {#4#2}{#3#1}% -}% -\def\XINT_add_pre #1% -{% - \expandafter\XINT_add_pre_b\expandafter - {\romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z }% -}% -\def\XINT_add_pre_b #1#2% -{% - \expandafter\XINT_add_A - \expandafter0\expandafter{\expandafter}% - \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z - \W\X\Y\Z #1\W\X\Y\Z -}% -\def\xintiiSub {\romannumeral0\xintiisub }% -\def\xintiisub #1% -{% - \expandafter\xint_iisub\expandafter{\romannumeral-`0#1}% -}% -\def\xint_iisub #1#2% -{% - \expandafter\XINT_sub_fork \romannumeral-`0#2\Z #1\Z -}% -\def\xintiSub {\romannumeral0\xintisub }% -\def\xintisub #1% -{% - \expandafter\xint_sub\expandafter{\romannumeral0\xintnum{#1}}% -}% -\def\xint_sub #1#2% -{% - \expandafter\XINT_sub_fork \romannumeral0\xintnum{#2}\Z #1\Z -}% -\def\XINT_Sub #1#2{\romannumeral0\XINT_sub_fork #2\Z #1\Z }% -\def\XINT_sub #1#2{\XINT_sub_fork #2\Z #1\Z }% -\let\xintSub\xintiSub \let\xintsub\xintisub -\def\XINT_sub_fork #1#2\Z #3#4\Z -{% - \xint_UDsignsfork - #1#3\XINT_sub_minusminus - #1-\XINT_sub_minusplus % attention, #3=0 possible - #3-\XINT_sub_plusminus % attention, #1=0 possible - --{\xint_UDzerofork - #1\XINT_sub_secondiszero - #3\XINT_sub_firstiszero - 0\XINT_sub_plusplus - \krof }% - \krof - {#2}{#4}#1#3% -}% -\def\XINT_sub_secondiszero #1#2#3#4{ #4#2}% -\def\XINT_sub_firstiszero #1#2#3#4{ -#3#1}% -\def\XINT_sub_plusplus #1#2#3#4% -{% - \XINT_sub_pre {#4#2}{#3#1}% -}% -\def\XINT_sub_minusminus #1#2#3#4% -{% - \XINT_sub_pre {#1}{#2}% -}% -\def\XINT_sub_minusplus #1#2#3#4% -{% - \xint_gob_til_zero #4\xint_sub_mp0\XINT_add_pre {#4#2}{#1}% -}% -\def\xint_sub_mp0\XINT_add_pre #1#2{ #2}% -\def\XINT_sub_plusminus #1#2#3#4% -{% - \xint_gob_til_zero #3\xint_sub_pm0\expandafter\xint_minus_thenstop% - \romannumeral0\XINT_add_pre {#2}{#3#1}% -}% -\def\xint_sub_pm #1\XINT_add_pre #2#3{ -#2}% -\def\XINT_sub_pre #1% -{% - \expandafter\XINT_sub_pre_b\expandafter - {\romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z }% -}% -\def\XINT_sub_pre_b #1#2% -{% - \expandafter\XINT_sub_A - \expandafter1\expandafter{\expandafter}% - \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z - \W\X\Y\Z #1 \W\X\Y\Z -}% -\def\XINT_sub_A #1#2#3\W\X\Y\Z #4#5#6#7% -{% - \xint_gob_til_W - #4\xint_sub_az - \W\XINT_sub_B #1{#4#5#6#7}{#2}#3\W\X\Y\Z -}% -\def\XINT_sub_B #1#2#3#4#5#6#7% -{% - \xint_gob_til_W - #4\xint_sub_bz - \W\XINT_sub_onestep #1#2{#7#6#5#4}{#3}% -}% -\def\XINT_sub_onestep #1#2#3#4#5#6% -{% - \expandafter\XINT_sub_backtoA\the\numexpr 11#5#4#3#2-#6+#1-\xint_c_i.% -}% -\def\XINT_sub_backtoA #1#2#3.#4% -{% - \XINT_sub_A #2{#3#4}% -}% -\def\xint_sub_bz - \W\XINT_sub_onestep #1#2#3#4#5#6#7% -{% - \xint_UDzerofork - #1\XINT_sub_C % une retenue - 0\XINT_sub_D % pas de retenue - \krof - {#7}#2#3#4#5% -}% -\def\XINT_sub_D #1#2\W\X\Y\Z -{% - \expandafter - \xint_cleanupzeros_andstop - \romannumeral0% - \XINT_rord_main {}#2% - \xint_relax - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_relax - #1% -}% -\def\XINT_sub_C #1#2#3#4#5% -{% - \xint_gob_til_W - #2\xint_sub_cz - \W\XINT_sub_AC_onestep {#5#4#3#2}{#1}% -}% -\def\XINT_sub_AC_onestep #1% -{% - \expandafter\XINT_sub_backtoC\the\numexpr 11#1-\xint_c_i.% -}% -\def\XINT_sub_backtoC #1#2#3.#4% -{% - \XINT_sub_AC_checkcarry #2{#3#4}% la retenue va \^etre examin\'ee -}% -\def\XINT_sub_AC_checkcarry #1% -{% - \xint_gob_til_one #1\xint_sub_AC_nocarry 1\XINT_sub_C -}% -\def\xint_sub_AC_nocarry 1\XINT_sub_C #1#2\W\X\Y\Z -{% - \expandafter - \XINT_cuz_loop - \romannumeral0% - \XINT_rord_main {}#2% - \xint_relax - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_relax - #1\W\W\W\W\W\W\W\Z -}% -\def\xint_sub_cz\W\XINT_sub_AC_onestep #1% -{% - \XINT_cuz -}% -\def\xint_sub_az\W\XINT_sub_B #1#2#3#4#5#6#7% -{% - \xint_gob_til_W - #4\xint_sub_ez - \W\XINT_sub_Eenter #1{#3}#4#5#6#7% -}% -\def\XINT_sub_Eenter #1#2% -{% - \expandafter - \XINT_sub_E\expandafter1\expandafter{\expandafter}% - \romannumeral0% - \XINT_rord_main {}#2% - \xint_relax - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_relax - \W\X\Y\Z #1% -}% -\def\XINT_sub_E #1#2#3#4#5#6% -{% - \xint_gob_til_W #3\xint_sub_F\W - \XINT_sub_Eonestep #1{#6#5#4#3}{#2}% -}% -\def\XINT_sub_Eonestep #1#2% -{% - \expandafter\XINT_sub_backtoE\the\numexpr 109999-#2+#1.% -}% -\def\XINT_sub_backtoE #1#2#3.#4% -{% - \XINT_sub_E #2{#3#4}% -}% -\def\xint_sub_F\W\XINT_sub_Eonestep #1#2#3#4% -{% - \xint_UDonezerofork - #4#1{\XINT_sub_Fdec 0}% soustraire 1. Et faire signe - - #1#4{\XINT_sub_Finc 1}% additionner 1. Et faire signe - - 10\XINT_sub_DD % terminer. Mais avec signe - - \krof - {#3}% -}% -\def\XINT_sub_DD {\expandafter\xint_minus_thenstop\romannumeral0\XINT_sub_D }% -\def\XINT_sub_Fdec #1#2#3#4#5#6% -{% - \xint_gob_til_W #3\xint_sub_Fdec_finish\W - \XINT_sub_Fdec_onestep #1{#6#5#4#3}{#2}% -}% -\def\XINT_sub_Fdec_onestep #1#2% -{% - \expandafter\XINT_sub_backtoFdec\the\numexpr 11#2+#1-\xint_c_i.% -}% -\def\XINT_sub_backtoFdec #1#2#3.#4% -{% - \XINT_sub_Fdec #2{#3#4}% -}% -\def\xint_sub_Fdec_finish\W\XINT_sub_Fdec_onestep #1#2% -{% - \expandafter\xint_minus_thenstop\romannumeral0\XINT_cuz -}% -\def\XINT_sub_Finc #1#2#3#4#5#6% -{% - \xint_gob_til_W #3\xint_sub_Finc_finish\W - \XINT_sub_Finc_onestep #1{#6#5#4#3}{#2}% -}% -\def\XINT_sub_Finc_onestep #1#2% -{% - \expandafter\XINT_sub_backtoFinc\the\numexpr 10#2+#1.% -}% -\def\XINT_sub_backtoFinc #1#2#3.#4% -{% - \XINT_sub_Finc #2{#3#4}% -}% -\def\xint_sub_Finc_finish\W\XINT_sub_Finc_onestep #1#2#3% -{% - \xint_UDzerofork - #1{\expandafter\expandafter\expandafter - \xint_minus_thenstop\xint_cleanupzeros_nostop}% - 0{ -1}% - \krof - #3% -}% -\def\xint_sub_ez\W\XINT_sub_Eenter #1% -{% - \xint_UDzerofork - #1\XINT_sub_K % il y a une retenue - 0\XINT_sub_L % pas de retenue - \krof -}% -\def\XINT_sub_L #1\W\X\Y\Z {\XINT_cuz_loop #1\W\W\W\W\W\W\W\Z }% -\def\XINT_sub_K #1% -{% - \expandafter - \XINT_sub_KK\expandafter1\expandafter{\expandafter}% - \romannumeral0% - \XINT_rord_main {}#1% - \xint_relax - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_relax -}% -\def\XINT_sub_KK #1#2#3#4#5#6% -{% - \xint_gob_til_W #3\xint_sub_KK_finish\W - \XINT_sub_KK_onestep #1{#6#5#4#3}{#2}% -}% -\def\XINT_sub_KK_onestep #1#2% -{% - \expandafter\XINT_sub_backtoKK\the\numexpr 109999-#2+#1.% -}% -\def\XINT_sub_backtoKK #1#2#3.#4% -{% - \XINT_sub_KK #2{#3#4}% -}% -\def\xint_sub_KK_finish\W\XINT_sub_KK_onestep #1#2#3% -{% - \expandafter\xint_minus_thenstop - \romannumeral0\XINT_cuz_loop #3\W\W\W\W\W\W\W\Z -}% \def\xintCmp {\romannumeral0\xintcmp }% \def\xintcmp #1% {% @@ -1284,11 +387,19 @@ \def\xintgt #1#2{\xintifgt{#1}{#2}{1}{0}}% \def\xintLt {\romannumeral0\xintlt }% \def\xintlt #1#2{\xintiflt{#1}{#2}{1}{0}}% +\def\xintLtorEq #1#2{\romannumeral0\xintifgt {#1}{#2}{0}{1}}% +\def\xintGtorEq #1#2{\romannumeral0\xintiflt {#1}{#2}{0}{1}}% +\def\xintNeq #1#2{\romannumeral0\xintifeq {#1}{#2}{0}{1}}% \def\xintIsZero {\romannumeral0\xintiszero }% \def\xintiszero #1{\if0\xintSgn{#1}\xint_afterfi{ 1}\else\xint_afterfi{ 0}\fi}% \def\xintIsNotZero {\romannumeral0\xintisnotzero }% \def\xintisnotzero #1{\if0\xintSgn{#1}\xint_afterfi{ 0}\else\xint_afterfi{ 1}\fi}% +\def\xintiiIsZero {\romannumeral0\xintiiiszero }% +\def\xintiiiszero #1{\if0\xintiiSgn{#1}\xint_afterfi{ 1}\else\xint_afterfi{ 0}\fi}% +\def\xintiiIsNotZero {\romannumeral0\xintiiisnotzero }% +\def\xintiiisnotzero + #1{\if0\xintiiSgn{#1}\xint_afterfi{ 0}\else\xint_afterfi{ 1}\fi}% \let\xintIsTrue\xintIsNotZero \let\xintNot\xintIsZero \let\xintIsFalse\xintIsZero @@ -1412,11 +523,20 @@ {% \expandafter\xint_max\expandafter {\romannumeral0\xintnum{#1}}% }% -\let\xintMax\xintiMax \let\xintmax\xintimax \def\xint_max #1#2% {% \expandafter\XINT_max_pre\expandafter {\romannumeral0\xintnum{#2}}{#1}% }% +\def\xintiiMax {\romannumeral0\xintiimax }% +\def\xintiimax #1% +{% + \expandafter\xint_iimax\expandafter {\romannumeral-`0#1}% +}% +\def\xint_iimax #1#2% +{% + \expandafter\XINT_max_pre\expandafter {\romannumeral-`0#2}{#1}% +}% +\let\xintMax\xintiMax \let\xintmax\xintimax % deprecated, should be only with xintfrac \def\XINT_max_pre #1#2{\XINT_max_fork #1\Z #2\Z {#2}{#1}}% \def\XINT_Max #1#2{\romannumeral0\XINT_max_fork #2\Z #1\Z {#1}{#2}}% \def\XINT_max_fork #1#2\Z #3#4\Z @@ -1471,11 +591,20 @@ {% \expandafter\xint_min\expandafter {\romannumeral0\xintnum{#1}}% }% -\let\xintMin\xintiMin \let\xintmin\xintimin \def\xint_min #1#2% {% \expandafter\XINT_min_pre\expandafter {\romannumeral0\xintnum{#2}}{#1}% }% +\def\xintiiMin {\romannumeral0\xintiimin }% +\def\xintiimin #1% +{% + \expandafter\xint_iimin\expandafter {\romannumeral-`0#1}% +}% +\def\xint_iimin #1#2% +{% + \expandafter\XINT_min_pre\expandafter {\romannumeral-`0#2}{#1}% +}% +\let\xintMin\xintiMin \let\xintmin\xintimin % deprecated \def\XINT_min_pre #1#2{\XINT_min_fork #1\Z #2\Z {#2}{#1}}% \def\XINT_Min #1#2{\romannumeral0\XINT_min_fork #2\Z #1\Z {#1}{#2}}% \def\XINT_min_fork #1#2\Z #3#4\Z @@ -1567,401 +696,6 @@ \W\X\Y\Z #3\W\X\Y\Z }{#2}% }% \def\XINT_sum_NN #1#2{\XINT_sum_loop {#2}{#1}}% -\def\xintiiMul {\romannumeral0\xintiimul }% -\def\xintiimul #1% -{% - \expandafter\xint_iimul\expandafter {\romannumeral-`0#1}% -}% -\def\xint_iimul #1#2% -{% - \expandafter\XINT_mul_fork \romannumeral-`0#2\Z #1\Z -}% -\def\xintiMul {\romannumeral0\xintimul }% -\def\xintimul #1% -{% - \expandafter\xint_mul\expandafter {\romannumeral0\xintnum{#1}}% -}% -\def\xint_mul #1#2% -{% - \expandafter\XINT_mul_fork \romannumeral0\xintnum{#2}\Z #1\Z -}% -\let\xintMul\xintiMul \let\xintmul\xintimul -\def\XINT_Mul #1#2{\romannumeral0\XINT_mul_fork #2\Z #1\Z }% -\def\XINT_mul_fork #1#2\Z #3#4\Z -{% - \xint_UDzerofork - #1\XINT_mul_zero - #3\XINT_mul_zero - 0{\xint_UDsignsfork - #1#3\XINT_mul_minusminus % #1 = #3 = - - #1-{\XINT_mul_minusplus #3}% % #1 = - - #3-{\XINT_mul_plusminus #1}% % #3 = - - --{\XINT_mul_plusplus #1#3}% - \krof }% - \krof - {#2}{#4}% -}% -\def\XINT_mul_zero #1#2{ 0}% -\def\XINT_mul_minusminus #1#2% -{% - \expandafter\XINT_mul_choice_a - \expandafter{\romannumeral0\xintlength {#2}}% - {\romannumeral0\xintlength {#1}}{#1}{#2}% -}% -\def\XINT_mul_minusplus #1#2#3% -{% - \expandafter\xint_minus_thenstop\romannumeral0\expandafter - \XINT_mul_choice_a - \expandafter{\romannumeral0\xintlength {#1#3}}% - {\romannumeral0\xintlength {#2}}{#2}{#1#3}% -}% -\def\XINT_mul_plusminus #1#2#3% -{% - \expandafter\xint_minus_thenstop\romannumeral0\expandafter - \XINT_mul_choice_a - \expandafter{\romannumeral0\xintlength {#3}}% - {\romannumeral0\xintlength {#1#2}}{#1#2}{#3}% -}% -\def\XINT_mul_plusplus #1#2#3#4% -{% - \expandafter\XINT_mul_choice_a - \expandafter{\romannumeral0\xintlength {#2#4}}% - {\romannumeral0\xintlength {#1#3}}{#1#3}{#2#4}% -}% -\def\XINT_mul_choice_a #1#2% -{% - \expandafter\XINT_mul_choice_b\expandafter{#2}{#1}% -}% -\def\XINT_mul_choice_b #1#2% -{% - \ifnum #1<\xint_c_v - \expandafter\XINT_mul_choice_littlebyfirst - \else - \ifnum #2<\xint_c_v - \expandafter\expandafter\expandafter\XINT_mul_choice_littlebysecond - \else - \expandafter\expandafter\expandafter\XINT_mul_choice_compare - \fi - \fi - {#1}{#2}% -}% -\def\XINT_mul_choice_littlebyfirst #1#2#3#4% -{% - \expandafter\XINT_mul_M - \expandafter{\the\numexpr #3\expandafter}% - \romannumeral0\XINT_RQ {}#4\R\R\R\R\R\R\R\R\Z \Z\Z\Z\Z -}% -\def\XINT_mul_choice_littlebysecond #1#2#3#4% -{% - \expandafter\XINT_mul_M - \expandafter{\the\numexpr #4\expandafter}% - \romannumeral0\XINT_RQ {}#3\R\R\R\R\R\R\R\R\Z \Z\Z\Z\Z -}% -\def\XINT_mul_choice_compare #1#2% -{% - \ifnum #1>#2 - \expandafter \XINT_mul_choice_i - \else - \expandafter \XINT_mul_choice_ii - \fi - {#1}{#2}% -}% -\def\XINT_mul_choice_i #1#2% -{% - \ifnum #1<\numexpr\ifcase \numexpr (#2-\xint_c_iii)/\xint_c_iv\relax - \or 330\or 168\or 109\or 80\or 66\or 52\else 0\fi\relax - \expandafter\XINT_mul_choice_same - \else - \expandafter\XINT_mul_choice_permute - \fi -}% -\def\XINT_mul_choice_ii #1#2% -{% - \ifnum #2<\numexpr\ifcase \numexpr (#1-\xint_c_iii)/\xint_c_iv\relax - \or 330\or 168\or 109\or 80\or 66\or 52\else 0\fi\relax - \expandafter\XINT_mul_choice_permute - \else - \expandafter\XINT_mul_choice_same - \fi -}% -\def\XINT_mul_choice_same #1#2% -{% - \expandafter\XINT_mul_enter - \romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z - \Z\Z\Z\Z #2\W\W\W\W -}% -\def\XINT_mul_choice_permute #1#2% -{% - \expandafter\XINT_mul_enter - \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z - \Z\Z\Z\Z #1\W\W\W\W -}% -\def\XINT_mul_Ar #1#2#3#4#5#6% -{% - \xint_gob_til_Z #6\xint_mul_br\Z\XINT_mul_Br #1{#6#5#4#3}{#2}% -}% -\def\xint_mul_br\Z\XINT_mul_Br #1#2% -{% - \XINT_addr_AC_checkcarry #1% -}% -\def\XINT_mul_Br #1#2#3#4\W\X\Y\Z #5#6#7#8% -{% - \expandafter\XINT_mul_ABEAr - \the\numexpr #1+10#2+#8#7#6#5.{#3}#4\W\X\Y\Z -}% -\def\XINT_mul_ABEAr #1#2#3#4#5#6.#7% -{% - \XINT_mul_Ar #2{#7#6#5#4#3}% -}% -\def\XINT_mul_Mr #1% -{% - \expandafter\XINT_mul_Mr_checkifzeroorone\expandafter{\the\numexpr #1}% -}% -\def\XINT_mul_Mr_checkifzeroorone #1% -{% - \ifcase #1 - \expandafter\XINT_mul_Mr_zero - \or - \expandafter\XINT_mul_Mr_one - \else - \expandafter\XINT_mul_Nr - \fi - {0000}{}{#1}% -}% -\def\XINT_mul_Mr_zero #1\Z\Z\Z\Z { 0000}% -\def\XINT_mul_Mr_one #1#2#3#4\Z\Z\Z\Z { #4}% -\def\XINT_mul_Nr #1#2#3#4#5#6#7% -{% - \xint_gob_til_Z #4\xint_mul_pr\Z\XINT_mul_Pr {#1}{#3}{#7#6#5#4}{#2}{#3}% -}% -\def\XINT_mul_Pr #1#2#3% -{% - \expandafter\XINT_mul_Lr\the\numexpr \xint_c_x^viii+#1+#2*#3\relax -}% -\def\XINT_mul_Lr 1#1#2#3#4#5#6#7#8#9% -{% - \XINT_mul_Nr {#1#2#3#4}{#9#8#7#6#5}% -}% -\def\xint_mul_pr\Z\XINT_mul_Pr #1#2#3#4#5% -{% - \xint_gob_til_zeros_iv #1\XINT_mul_Mr_end_nocarry 0000% - \XINT_mul_Mr_end_carry #1{#4}% -}% -\def\XINT_mul_Mr_end_nocarry 0000\XINT_mul_Mr_end_carry 0000#1{ #1}% -\def\XINT_mul_Mr_end_carry #1#2#3#4#5{ #5#4#3#2#1}% -\def\XINT_mul_M #1% -{% - \expandafter\XINT_mul_M_checkifzeroorone\expandafter{\the\numexpr #1}% -}% -\def\XINT_mul_M_checkifzeroorone #1% -{% - \ifcase #1 - \expandafter\XINT_mul_M_zero - \or - \expandafter\XINT_mul_M_one - \else - \expandafter\XINT_mul_N - \fi - {0000}{}{#1}% -}% -\def\XINT_mul_M_zero #1\Z\Z\Z\Z { 0}% -\def\XINT_mul_M_one #1#2#3#4\Z\Z\Z\Z -{% - \expandafter\xint_cleanupzeros_andstop\romannumeral0\xintreverseorder{#4}% -}% -\def\XINT_mul_N #1#2#3#4#5#6#7% -{% - \xint_gob_til_Z #4\xint_mul_p\Z\XINT_mul_P {#1}{#3}{#7#6#5#4}{#2}{#3}% -}% -\def\XINT_mul_P #1#2#3% -{% - \expandafter\XINT_mul_L\the\numexpr \xint_c_x^viii+#1+#2*#3\relax -}% -\def\XINT_mul_L 1#1#2#3#4#5#6#7#8#9% -{% - \XINT_mul_N {#1#2#3#4}{#5#6#7#8#9}% -}% -\def\xint_mul_p\Z\XINT_mul_P #1#2#3#4#5% -{% - \XINT_mul_M_end #1#4% -}% -\edef\XINT_mul_M_end #1#2#3#4#5#6#7#8% -{% - \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8\relax -}% -\def\XINT_mul_enter #1\Z\Z\Z\Z #2#3#4#5% -{% - \xint_gob_til_W #5\XINT_mul_exit_a\W - \XINT_mul_start {#2#3#4#5}#1\Z\Z\Z\Z -}% -\def\XINT_mul_exit_a\W\XINT_mul_start #1% -{% - \XINT_mul_exit_b #1% -}% -\def\XINT_mul_exit_b #1#2#3#4% -{% - \xint_gob_til_W - #2\XINT_mul_exit_ci - #3\XINT_mul_exit_cii - \W\XINT_mul_exit_ciii #1#2#3#4% -}% -\def\XINT_mul_exit_ciii #1\W #2\Z\Z\Z\Z \W\W\W -{% - \XINT_mul_M {#1}#2\Z\Z\Z\Z -}% -\def\XINT_mul_exit_cii\W\XINT_mul_exit_ciii #1\W\W #2\Z\Z\Z\Z \W\W -{% - \XINT_mul_M {#1}#2\Z\Z\Z\Z -}% -\def\XINT_mul_exit_ci\W\XINT_mul_exit_cii - \W\XINT_mul_exit_ciii #1\W\W\W #2\Z\Z\Z\Z \W -{% - \XINT_mul_M {#1}#2\Z\Z\Z\Z -}% -\def\XINT_mul_start #1#2\Z\Z\Z\Z -{% - \expandafter\XINT_mul_main\expandafter - {\romannumeral0\XINT_mul_Mr {#1}#2\Z\Z\Z\Z}#2\Z\Z\Z\Z -}% -\def\XINT_mul_main #1#2\Z\Z\Z\Z #3#4#5#6% -{% - \xint_gob_til_W #6\XINT_mul_finish_a\W - \XINT_mul_compute {#3#4#5#6}{#1}#2\Z\Z\Z\Z -}% -\def\XINT_mul_compute #1#2#3\Z\Z\Z\Z -{% - \expandafter\XINT_mul_main\expandafter - {\romannumeral0\expandafter - \XINT_mul_Ar\expandafter0\expandafter{\expandafter}% - \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z - \W\X\Y\Z 0000#2\W\X\Y\Z }#3\Z\Z\Z\Z -}% -\def\XINT_mul_finish_a\W\XINT_mul_compute #1% -{% - \XINT_mul_finish_b #1% -}% -\def\XINT_mul_finish_b #1#2#3#4% -{% - \xint_gob_til_W - #1\XINT_mul_finish_c - #2\XINT_mul_finish_ci - #3\XINT_mul_finish_cii - \W\XINT_mul_finish_ciii #1#2#3#4% -}% -\def\XINT_mul_finish_ciii #1\W #2#3\Z\Z\Z\Z \W\W\W -{% - \expandafter\XINT_addm_A\expandafter0\expandafter{\expandafter}% - \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 000#2\W\X\Y\Z -}% -\def\XINT_mul_finish_cii - \W\XINT_mul_finish_ciii #1\W\W #2#3\Z\Z\Z\Z \W\W -{% - \expandafter\XINT_addm_A\expandafter0\expandafter{\expandafter}% - \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 00#2\W\X\Y\Z -}% -\def\XINT_mul_finish_ci #1\XINT_mul_finish_ciii #2\W\W\W #3#4\Z\Z\Z\Z \W -{% - \expandafter\XINT_addm_A\expandafter0\expandafter{\expandafter}% - \romannumeral0\XINT_mul_Mr {#2}#4\Z\Z\Z\Z \W\X\Y\Z 0#3\W\X\Y\Z -}% -\def\XINT_mul_finish_c #1\XINT_mul_finish_ciii \W\W\W\W #2#3\Z\Z\Z\Z -{% - \expandafter\xint_cleanupzeros_andstop\romannumeral0\xintreverseorder{#2}% -}% -\def\XINT_mulr_enter #1\Z\Z\Z\Z #2#3#4#5% -{% - \xint_gob_til_W #5\XINT_mulr_exit_a\W - \XINT_mulr_start {#2#3#4#5}#1\Z\Z\Z\Z -}% -\def\XINT_mulr_exit_a\W\XINT_mulr_start #1% -{% - \XINT_mulr_exit_b #1% -}% -\def\XINT_mulr_exit_b #1#2#3#4% -{% - \xint_gob_til_W - #2\XINT_mulr_exit_ci - #3\XINT_mulr_exit_cii - \W\XINT_mulr_exit_ciii #1#2#3#4% -}% -\def\XINT_mulr_exit_ciii #1\W #2\Z\Z\Z\Z \W\W\W -{% - \XINT_mul_Mr {#1}#2\Z\Z\Z\Z -}% -\def\XINT_mulr_exit_cii\W\XINT_mulr_exit_ciii #1\W\W #2\Z\Z\Z\Z \W\W -{% - \XINT_mul_Mr {#1}#2\Z\Z\Z\Z -}% -\def\XINT_mulr_exit_ci\W\XINT_mulr_exit_cii - \W\XINT_mulr_exit_ciii #1\W\W\W #2\Z\Z\Z\Z \W -{% - \XINT_mul_Mr {#1}#2\Z\Z\Z\Z -}% -\def\XINT_mulr_start #1#2\Z\Z\Z\Z -{% - \expandafter\XINT_mulr_main\expandafter - {\romannumeral0\XINT_mul_Mr {#1}#2\Z\Z\Z\Z}#2\Z\Z\Z\Z -}% -\def\XINT_mulr_main #1#2\Z\Z\Z\Z #3#4#5#6% -{% - \xint_gob_til_W #6\XINT_mulr_finish_a\W - \XINT_mulr_compute {#3#4#5#6}{#1}#2\Z\Z\Z\Z -}% -\def\XINT_mulr_compute #1#2#3\Z\Z\Z\Z -{% - \expandafter\XINT_mulr_main\expandafter - {\romannumeral0\expandafter - \XINT_mul_Ar\expandafter0\expandafter{\expandafter}% - \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z - \W\X\Y\Z 0000#2\W\X\Y\Z }#3\Z\Z\Z\Z -}% -\def\XINT_mulr_finish_a\W\XINT_mulr_compute #1% -{% - \XINT_mulr_finish_b #1% -}% -\def\XINT_mulr_finish_b #1#2#3#4% -{% - \xint_gob_til_W - #1\XINT_mulr_finish_c - #2\XINT_mulr_finish_ci - #3\XINT_mulr_finish_cii - \W\XINT_mulr_finish_ciii #1#2#3#4% -}% -\def\XINT_mulr_finish_ciii #1\W #2#3\Z\Z\Z\Z \W\W\W -{% - \expandafter\XINT_addp_A\expandafter0\expandafter{\expandafter}% - \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 000#2\W\X\Y\Z -}% -\def\XINT_mulr_finish_cii - \W\XINT_mulr_finish_ciii #1\W\W #2#3\Z\Z\Z\Z \W\W -{% - \expandafter\XINT_addp_A\expandafter0\expandafter{\expandafter}% - \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 00#2\W\X\Y\Z -}% -\def\XINT_mulr_finish_ci #1\XINT_mulr_finish_ciii #2\W\W\W #3#4\Z\Z\Z\Z \W -{% - \expandafter\XINT_addp_A\expandafter0\expandafter{\expandafter}% - \romannumeral0\XINT_mul_Mr {#2}#4\Z\Z\Z\Z \W\X\Y\Z 0#3\W\X\Y\Z -}% -\def\XINT_mulr_finish_c #1\XINT_mulr_finish_ciii \W\W\W\W #2#3\Z\Z\Z\Z { #2}% -\def\xintiiSqr {\romannumeral0\xintiisqr }% -\def\xintiisqr #1% -{% - \expandafter\XINT_sqr\expandafter {\romannumeral0\xintiiabs{#1}}% -}% -\def\xintiSqr {\romannumeral0\xintisqr }% -\def\xintisqr #1% -{% - \expandafter\XINT_sqr\expandafter {\romannumeral0\xintiabs{#1}}% -}% -\let\xintSqr\xintiSqr \let\xintsqr\xintisqr -\def\XINT_sqr #1% -{% - \expandafter\XINT_mul_enter - \romannumeral0% - \XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z - \Z\Z\Z\Z #1\W\W\W\W -}% \def\xintiiPrd {\romannumeral0\xintiiprd }% \def\xintiiprd #1{\xintiiprdexpr #1\relax }% \let\xintPrd\xintiiPrd @@ -2061,635 +795,6 @@ {% \XINT_mul_M }% -\def\xintiiPow {\romannumeral0\xintiipow }% -\def\xintiipow #1% -{% - \expandafter\xint_pow\romannumeral-`0#1\Z% -}% -\def\xintiPow {\romannumeral0\xintipow }% -\def\xintipow #1% -{% - \expandafter\xint_pow\romannumeral0\xintnum{#1}\Z% -}% -\let\xintPow\xintiPow \let\xintpow\xintipow -\def\xint_pow #1#2\Z -{% - \xint_UDsignfork - #1\XINT_pow_Aneg - -\XINT_pow_Anonneg - \krof - #1{#2}% -}% -\def\XINT_pow_Aneg #1#2#3% -{% - \expandafter\XINT_pow_Aneg_\expandafter{\the\numexpr #3}{#2}% -}% -\def\XINT_pow_Aneg_ #1% -{% - \ifodd #1 - \expandafter\XINT_pow_Aneg_Bodd - \fi - \XINT_pow_Anonneg_ {#1}% -}% -\def\XINT_pow_Aneg_Bodd #1% -{% - \expandafter\XINT_opp\romannumeral0\XINT_pow_Anonneg_ -}% -\def\XINT_pow_Anonneg #1#2#3% -{% - \expandafter\XINT_pow_Anonneg_\expandafter {\the\numexpr #3}{#1#2}% -}% -\def\XINT_pow_Anonneg_ #1#2% -{% - \ifcase\XINT_Cmp {#2}{1} - \expandafter\XINT_pow_AisOne - \or - \expandafter\XINT_pow_AatleastTwo - \else - \expandafter\XINT_pow_AisZero - \fi - {#1}{#2}% -}% -\def\XINT_pow_AisOne #1#2{ 1}% -\def\XINT_pow_AisZero #1#2% -{% - \ifcase\XINT_cntSgn #1\Z - \xint_afterfi { 1}% - \or - \xint_afterfi { 0}% - \else - \xint_afterfi {\xintError:DivisionByZero\space 0}% - \fi -}% -\def\XINT_pow_AatleastTwo #1% -{% - \ifcase\XINT_cntSgn #1\Z - \expandafter\XINT_pow_BisZero - \or - \expandafter\XINT_pow_checkBsize - \else - \expandafter\XINT_pow_BisNegative - \fi - {#1}% -}% -\edef\XINT_pow_BisNegative #1#2% - {\noexpand\xintError:FractionRoundedToZero\space 0}% -\def\XINT_pow_BisZero #1#2{ 1}% -\def\XINT_pow_checkBsize #1% -{% - \ifnum #1>100000 - \expandafter\XINT_pow_BtooBig - \else - \expandafter\XINT_pow_loopI - \fi - {#1}% -}% -\edef\XINT_pow_BtooBig #1#2{\noexpand\xintError:ExponentTooBig\space 0}% -\def\XINT_pow_loopI #1% -{% - \ifnum #1=\xint_c_i\XINT_pow_Iend\fi - \ifodd #1 - \expandafter\XINT_pow_loopI_odd - \else - \expandafter\XINT_pow_loopI_even - \fi - {#1}% -}% -\edef\XINT_pow_Iend\fi #1\fi #2#3{\noexpand\fi\space #3}% -\def\XINT_pow_loopI_even #1#2% -{% - \expandafter\XINT_pow_loopI\expandafter - {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter - {\romannumeral0\xintiisqr {#2}}% -}% -\def\XINT_pow_loopI_odd #1#2% -{% - \expandafter\XINT_pow_loopI_odda\expandafter - {\romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z }{#1}{#2}% -}% -\def\XINT_pow_loopI_odda #1#2#3% -{% - \expandafter\XINT_pow_loopII\expandafter - {\the\numexpr #2/\xint_c_ii-\xint_c_i\expandafter}\expandafter - {\romannumeral0\xintiisqr {#3}}{#1}% -}% -\def\XINT_pow_loopII #1% -{% - \ifnum #1 = \xint_c_i\XINT_pow_IIend\fi - \ifodd #1 - \expandafter\XINT_pow_loopII_odd - \else - \expandafter\XINT_pow_loopII_even - \fi - {#1}% -}% -\def\XINT_pow_loopII_even #1#2% -{% - \expandafter\XINT_pow_loopII\expandafter - {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter - {\romannumeral0\xintiisqr {#2}}% -}% -\def\XINT_pow_loopII_odd #1#2#3% -{% - \expandafter\XINT_pow_loopII_odda\expandafter - {\romannumeral0\XINT_mulr_enter #3\Z\Z\Z\Z #2\W\W\W\W}{#1}{#2}% -}% -\def\XINT_pow_loopII_odda #1#2#3% -{% - \expandafter\XINT_pow_loopII\expandafter - {\the\numexpr #2/\xint_c_ii-\xint_c_i\expandafter}\expandafter - {\romannumeral0\xintiisqr {#3}}{#1}% -}% -\def\XINT_pow_IIend\fi #1\fi #2#3#4% -{% - \fi\XINT_mul_enter #4\Z\Z\Z\Z #3\W\W\W\W -}% -\def\xintiiQuo {\romannumeral0\xintiiquo }% -\def\xintiiRem {\romannumeral0\xintiirem }% -\def\xintiiquo {\expandafter\xint_firstoftwo_thenstop - \romannumeral0\xintiidivision }% -\def\xintiirem {\expandafter\xint_secondoftwo_thenstop - \romannumeral0\xintiidivision }% -\def\xintQuo {\romannumeral0\xintquo }% -\def\xintRem {\romannumeral0\xintrem }% -\def\xintquo {\expandafter\xint_firstoftwo_thenstop - \romannumeral0\xintdivision }% -\def\xintrem {\expandafter\xint_secondoftwo_thenstop - \romannumeral0\xintdivision }% -\def\xintiiDivision {\romannumeral0\xintiidivision }% -\def\xintiidivision #1% -{% - \expandafter\xint_iidivision\expandafter {\romannumeral-`0#1}% -}% -\def\xint_iidivision #1#2% -{% - \expandafter\XINT_div_fork \romannumeral-`0#2\Z #1\Z -}% -\def\xintDivision {\romannumeral0\xintdivision }% -\def\xintdivision #1% -{% - \expandafter\xint_division\expandafter {\romannumeral0\xintnum{#1}}% -}% -\def\xint_division #1#2% -{% - \expandafter\XINT_div_fork \romannumeral0\xintnum{#2}\Z #1\Z -}% -\def\XINT_div_fork #1#2\Z #3#4\Z -{% - \xint_UDzerofork - #1\XINT_div_BisZero - #3\XINT_div_AisZero - 0{\xint_UDsignfork - #1\XINT_div_BisNegative % B < 0 - #3\XINT_div_AisNegative % A < 0, B > 0 - -\XINT_div_plusplus % B > 0, A > 0 - \krof }% - \krof - {#2}{#4}#1#3% #1#2=B, #3#4=A -}% -\edef\XINT_div_BisZero #1#2#3#4{\noexpand\xintError:DivisionByZero\space {0}{0}}% -\def\XINT_div_AisZero #1#2#3#4{ {0}{0}}% -\def\XINT_div_plusplus #1#2#3#4{\XINT_div_prepare {#3#1}{#4#2}}% -\def\XINT_div_BisNegative #1#2#3#4% -{% - \expandafter\XINT_div_BisNegative_b - \romannumeral0\XINT_div_fork #1\Z #4#2\Z -}% -\edef\XINT_div_BisNegative_b #1% -{% - \noexpand\expandafter\space\noexpand\expandafter - {\noexpand\romannumeral0\noexpand\XINT_opp #1}% -}% -\def\XINT_div_AisNegative #1#2#3#4% -{% - \expandafter\XINT_div_AisNegative_b - \romannumeral0\XINT_div_prepare {#3#1}{#2}{#3#1}% -}% -\def\XINT_div_AisNegative_b #1#2% -{% - \if0\XINT_Sgn #2\Z - \expandafter \XINT_div_AisNegative_Rzero - \else - \expandafter \XINT_div_AisNegative_Rpositive - \fi - {#1}{#2}% -}% -\edef\XINT_div_AisNegative_Rzero #1#2#3% -{% - \noexpand\expandafter\space\noexpand\expandafter - {\noexpand\romannumeral0\noexpand\XINT_opp #1}{0}% -}% -\def\XINT_div_AisNegative_Rpositive #1% -{% - \expandafter \XINT_div_AisNegative_Rpositive_b \expandafter - {\romannumeral0\xintiiopp{\xintInc {#1}}}% -}% -\def\XINT_div_AisNegative_Rpositive_b #1#2#3% -{% - \expandafter \xint_exchangetwo_keepbraces_thenstop \expandafter - {\romannumeral0\XINT_sub {#3}{#2}}{#1}% -}% -\def\XINT_div_prepare #1% -{% - \expandafter \XINT_div_prepareB_aa \expandafter - {\romannumeral0\xintlength {#1}}{#1}% B > 0 ici -}% -\def\XINT_div_prepareB_aa #1% -{% - \ifnum #1=\xint_c_i - \expandafter\XINT_div_prepareB_onedigit - \else - \expandafter\XINT_div_prepareB_a - \fi - {#1}% -}% -\def\XINT_div_prepareB_a #1% -{% - \expandafter\XINT_div_prepareB_c\expandafter - {\the\numexpr \xint_c_iv*((#1+\xint_c_i)/\xint_c_iv)}{#1}% -}% -\def\XINT_div_prepareB_onedigit #1#2% -{% - \ifcase#2 - \or\expandafter\XINT_div_BisOne - \or\expandafter\XINT_div_BisTwo - \else\expandafter\XINT_div_prepareB_e - \fi {000}{0}{4}{#2}% -}% -\def\XINT_div_BisOne #1#2#3#4#5{ {#5}{0}}% -\def\XINT_div_BisTwo #1#2#3#4#5% -{% - \expandafter\expandafter\expandafter\XINT_div_BisTwo_a - \ifodd\xintiiLDg{#5} \expandafter1\else \expandafter0\fi {#5}% -}% -\edef\XINT_div_BisTwo_a #1#2% -{% - \noexpand\expandafter\space\noexpand\expandafter - {\noexpand\romannumeral0\noexpand\xinthalf {#2}}{#1}% -}% -\def\XINT_div_prepareB_c #1#2% -{% - \csname XINT_div_prepareB_d\romannumeral\numexpr#1-#2\endcsname - {#1}% -}% -\def\XINT_div_prepareB_d {\XINT_div_prepareB_e {}{0000}}% -\def\XINT_div_prepareB_di {\XINT_div_prepareB_e {0}{000}}% -\def\XINT_div_prepareB_dii {\XINT_div_prepareB_e {00}{00}}% -\def\XINT_div_prepareB_diii {\XINT_div_prepareB_e {000}{0}}% -\def\XINT_div_cleanR #10000.{{#1}}% -\def\XINT_div_prepareB_e #1#2#3#4% -{% - \ifnum#3=\xint_c_iv\expandafter\XINT_div_prepareLittleB_f - \else\expandafter\XINT_div_prepareB_f - \fi - #4#1{#3}{#2}{#1}% -}% -\def\XINT_div_prepareB_f #1#2#3#4#5#{% - \expandafter\XINT_div_prepareB_g - \the\numexpr #1#2#3#4+\xint_c_i\expandafter - .\the\numexpr (#1#2#3#4+\xint_c_i)/\xint_c_ii\expandafter - .\romannumeral0\xintreverseorder {#1#2#3#4#5}.{#1#2#3#4}% -}% -\def\XINT_div_prepareLittleB_f #1#{% - \expandafter\XINT_div_prepareB_g \the\numexpr #1/\xint_c_ii.{}.{}.{#1}% -}% -\def\XINT_div_prepareB_g #1.#2.#3.#4#5#6#7#8% -{% - \XINT_div_prepareA_a {#8#7}{#5}{{#1}{#2}{#4}}{#3}{#6}% -}% -\def\XINT_div_prepareA_a #1% -{% - \expandafter\XINT_div_prepareA_b\expandafter - {\romannumeral0\xintlength {#1}}{#1}% -}% -\def\XINT_div_prepareA_b #1% -{% - \expandafter\XINT_div_prepareA_c\expandafter - {\the\numexpr \xint_c_iv*((#1+\xint_c_i)/\xint_c_iv)}{#1}% -}% -\def\XINT_div_prepareA_c #1#2% -{% - \csname XINT_div_prepareA_d\romannumeral\numexpr #1-#2\endcsname - {#1}% -}% -\def\XINT_div_prepareA_d {\XINT_div_prepareA_e {}}% -\def\XINT_div_prepareA_di {\XINT_div_prepareA_e {0}}% -\def\XINT_div_prepareA_dii {\XINT_div_prepareA_e {00}}% -\def\XINT_div_prepareA_diii {\XINT_div_prepareA_e {000}}% -\def\XINT_div_prepareA_e #1#2#3#4#5% -{% - \XINT_div_start_a {#2}{#4}{#1#3}#5% -}% -\def\XINT_div_start_a #1#2% -{% - \ifnum #2=\xint_c_iv \expandafter\XINT_div_little_b - \else - \ifnum #1 < #2 - \expandafter\expandafter\expandafter\XINT_div_III_aa - \else - \expandafter\expandafter\expandafter\XINT_div_start_b - \fi - \fi - {#1}{#2}% -}% -\def\XINT_div_III_aa #1#2#3#4#5#6#7% -{% - \expandafter\expandafter\expandafter - \XINT_div_III_b\xint_cleanupzeros_nostop #3.{0000}% -}% -\def\XINT_div_III_b #1% -{% - \if0#1% - \expandafter\XINT_div_III_bRzero - \else - \expandafter\XINT_div_III_bRpos - \fi - #1% -}% -\def\XINT_div_III_bRzero 0.#1#2% -{% - \expandafter\space\expandafter - {\romannumeral0\XINT_cuz_loop #1\W\W\W\W\W\W\W\Z}{0}% -}% -\def\XINT_div_III_bRpos #1.#2#3% -{% - \expandafter\XINT_div_III_c \XINT_div_cleanR #1#3.{#2}% -}% -\def\XINT_div_III_c #1#2% -{% - \expandafter\space\expandafter - {\romannumeral0\XINT_cuz_loop #2\W\W\W\W\W\W\W\Z}{#1}% -}% -\def\XINT_div_start_b #1#2#3#4#5#6% -{% - \XINT_div_start_c {#2}.#3.{#6}{{#1}{#2}{{#4}{#5}}{#6}}% -}% -\def\XINT_div_start_c #1#2.#3#4#5#6% -{% - \ifnum #1=\xint_c_iv\XINT_div_start_ca\fi - \expandafter\XINT_div_start_c\expandafter - {\the\numexpr #1-\xint_c_iv}#2#3#4#5#6.% -}% -\def\XINT_div_start_ca\fi\expandafter\XINT_div_start_c\expandafter - #1#2#3#4#5{\fi\XINT_div_start_d {#2#3#4#5}#2#3#4#5}% -\def\XINT_div_start_d #1#2.#3.#4#5#6% -{% - \XINT_div_I_a {#1}{#4}{#2}{#6}{0000}#5{#3}{#6}{}% -}% -\def\XINT_div_I_a #1#2% -{% - \expandafter\XINT_div_I_b\the\numexpr #1/#2.{#1}{#2}% -}% -\def\XINT_div_I_b #1% -{% - \xint_gob_til_zero #1\XINT_div_I_czero 0\XINT_div_I_c #1% -}% -\def\XINT_div_I_czero 0% - \XINT_div_I_c 0.#1#2#3#4#5{\XINT_div_I_g {#5}{#3}}% -\def\XINT_div_I_c #1.#2#3% -{% - \expandafter\XINT_div_I_da\the\numexpr #2-#1*#3.#1.% -}% -\def\XINT_div_I_da #1.% -{% - \ifnum #1>\xint_c_ix - \expandafter\XINT_div_I_dP - \else - \ifnum #1<\xint_c_ - \expandafter\expandafter\expandafter\XINT_div_I_dN - \else - \expandafter\expandafter\expandafter\XINT_div_I_db - \fi - \fi -}% -\def\XINT_div_I_dN #1.% -{% - \expandafter\XINT_div_I_dP\the\numexpr #1-\xint_c_i.% -}% -\def\XINT_div_I_db #1.#2#3% #1=q=un chiffre, #2=alpha, #3=B -{% - \expandafter\XINT_div_I_dc\expandafter - {\romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter - {\romannumeral0\xintreverseorder{#2}}% - {\romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z }}% - #1{#2}{#3}% -}% -\def\XINT_div_I_dc #1#2% -{% - \if-#1% s'arranger pour que si n^^e9gatif on ait renvoy^^e9 alpha=-. - \expandafter\xint_firstoftwo - \else\expandafter\xint_secondoftwo\fi - {\expandafter\XINT_div_I_dP\the\numexpr #2-\xint_c_i.}% - {\XINT_div_I_e {#1}#2}% -}% -\def\XINT_div_I_e #1#2#3#4#5% -{% - \expandafter\XINT_div_I_f \the\numexpr \xint_c_x^iv+#2+#5{#1}% -}% -\def\XINT_div_I_dP #1.#2#3#4% -{% - \expandafter \XINT_div_I_f \the\numexpr \xint_c_x^iv+#1+#4\expandafter - {\romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter - {\romannumeral0\xintreverseorder{#2}}% - {\romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z }}% -}% -\def\XINT_div_I_f 1#1#2#3#4{\XINT_div_I_g {#1#2#3#4}}% -\def\XINT_div_I_g #1#2#3#4#5#6#7#8#9% -{% - \ifnum#3=#4 - \expandafter\XINT_div_III_ab - \else - \expandafter\XINT_div_I_h - \fi - {#5}#2.#7.{{#5}{#6}{#4}{#3}}{#8}{#9#1}% -}% -\def\XINT_div_III_ab #1#2.#3.#4#5% -{% - \expandafter\XINT_div_III_b - \romannumeral0\XINT_cuz_loop #2#3\W\W\W\W\W\W\W\Z.% -}% -\def\XINT_div_I_h #1.#2#3#4#5#6.#7#8% -{% - \XINT_div_II_b #1#2#3#4#5.{#8}{#7}{#6}{#8}% -}% -\def\XINT_div_II_b #1#2#3#4#5#6#7#8#9% -{% - \xint_gob_til_zeros_iv #2#3#4#5\XINT_div_II_skipc 0000% - \XINT_div_II_c #1{#2#3#4#5}{#6#7#8#9}% -}% -\def\XINT_div_II_skipc 0000\XINT_div_II_c #1#2#3#4#5.#6#7% -{% - \XINT_div_II_k #7{#4#5}{#6}{0000}% -}% -\def\XINT_div_II_c #1#2#3#4% -{% - \expandafter\XINT_div_II_d\the\numexpr (#3#4+#2)/#1+\xint_c_ixixixix\relax - {#1}{#2}#3#4% -}% -\def\XINT_div_II_d 1#1#2#3#4#5#6#7.#8% -{% - \expandafter\XINT_div_II_e - \romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter - {\romannumeral0\xintreverseorder{#7}}% - {\romannumeral0\XINT_mul_Mr {#1#2#3#4}#8\Z\Z\Z\Z }.% - {#5}{#6}{#8}{#1#2#3#4}% -}% -\def\XINT_div_II_e #1#2#3#4% -{% - \xint_gob_til_zeros_iv #1#2#3#4\XINT_div_II_skipf 0000% - \XINT_div_II_f #1#2#3#4% -}% -\def\XINT_div_II_skipf 0000\XINT_div_II_f 0000#1.#2#3#4#5#6% -{% - \XINT_div_II_k #6{#1}{#4}{#5}% -}% -\def\XINT_div_II_f #1#2#3#4#5#6#7#8#9.% -{% - \XINT_div_II_fa {#1#2#3#4#5#6#7#8}{#1#2#3#4#5#6#7#8#9}% -}% -\def\XINT_div_II_fa #1#2#3#4% -{% - \expandafter\XINT_div_II_g\expandafter - {\the\numexpr (#1+#4)/#3-\xint_c_i}{#2}% -}% -\def\XINT_div_II_g #1#2#3#4% -{% - \expandafter \XINT_div_II_h - \the\numexpr #4+#1+\xint_c_x^iv\expandafter\expandafter\expandafter - {\expandafter\xint_gobble_iv - \romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter - {\romannumeral0\xintreverseorder{#2}}% - {\romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z }}{#3}% -}% -\def\XINT_div_II_h 1#1#2#3#4#5#6#7% -{% - \XINT_div_II_k #7{#5}{#6}{#1#2#3#4}% -}% -\def\XINT_div_II_k #1#2#3#4#5% -{% - \expandafter\XINT_div_II_l \the\numexpr #4-\xint_c_iv.{#3}#1{#2}#5.% -}% -\def\XINT_div_II_l #1.#2#3#4#5#6#7#8#9% -{% - \XINT_div_II_m {{#1}{#2}{{#3}{#4}}{#5}}{#5}{#6#7#8#9}#6#7#8#9% -}% -\def\XINT_div_II_m #1#2#3#4.#5#6% -{% - \XINT_div_I_a {#3}{#2}{#4}{#5}{#6}#1% -}% -\def\XINT_div_little_b #1#2#3#4#5#6#7% -{% - \XINT_div_little_c #3.{{#4}{#6}}{#1}% -}% -\def\XINT_div_little_c #1#2#3#4#5.#6#7% -{% - \XINT_div_littleI_a {#1#2#3#4}#6{#7}{#5}% -}% -\def\XINT_div_littleI_a #1#2#3% -{% - \expandafter\XINT_div_littleI_b - \the\numexpr (#1+#2)/#3-\xint_c_i{#1}{#2}{#3}% -}% -\def\XINT_div_littleI_b #1% -{% - \xint_gob_til_zero #1\XINT_div_littleI_skip 0\XINT_div_littleI_c #1% -}% -\def\XINT_div_littleI_skip 0\XINT_div_littleI_c 0#1#2#3#4#5% - {\XINT_div_littleII_a {#4}{#1}#5.{{#2}{#3}}{0000}}% -\def\XINT_div_littleI_c #1#2#3#4% -{% - \expandafter\expandafter\expandafter\XINT_div_littleI_e - \expandafter\expandafter\expandafter - {\expandafter\xint_gobble_i\the\numexpr \xint_c_x^iv+#2-#1*#4}#1{{#3}{#4}}% -}% -\def\XINT_div_littleI_e #1#2#3#4#5% - {\XINT_div_littleII_a {#4}{#1}#5.{#3}{000#2}}% -\def\XINT_div_littleII_a #1% -{% - \ifnum#1=\xint_c_iv - \expandafter\XINT_div_littleIII_ab - \else - \expandafter\XINT_div_littleII_b - \fi {#1}% -}% -\def\XINT_div_littleIII_ab #1#2#3.#4% -{% - \expandafter\XINT_div_III_b\the\numexpr #2#3.% -}% -\def\XINT_div_littleII_b #1% -{% - \expandafter\XINT_div_littleII_c\expandafter {\the\numexpr #1-\xint_c_iv}% -}% -\def\XINT_div_littleII_c #1#2#3#4#5#6#7.#8% -{% - \XINT_div_littleII_d {#2#3#4#5#6}#8{#1}{#7}% -}% -\def\XINT_div_littleII_d #1#2#3% -{% - \expandafter\XINT_div_littleII_e\the\numexpr (#1+#2)/#3+\xint_c_ixixixix.% - {#1}{#2}{#3}% -}% -\def\XINT_div_littleII_e 1#1.#2#3#4% -{% - \expandafter\expandafter\expandafter\XINT_div_littleII_f - \expandafter\xint_gobble_i\the\numexpr \xint_c_x^iv+#2-#1*#4.% - {#1}{{#3}{#4}}% -}% -\def\XINT_div_littleII_f #1.#2#3#4#5#6% -{% - \XINT_div_littleII_a {#4}{#1}#5.{#3}{#6#2}% -}% -\def\XINT_div_sub_xpxp #1#2% #1=alpha d^^e9j^^e0 renvers^^e9, #2 se d^^e9veloppe en qB -{% - \expandafter\XINT_div_sub_xpxp_b #2\W\X\Y\Z #1\W\X\Y\Z -}% -\def\XINT_div_sub_xpxp_b -{% - \XINT_div_sub_A 1{}% -}% -\def\XINT_div_sub_A #1#2#3#4#5#6% -{% - \xint_gob_til_W #3\xint_div_sub_az\W - \XINT_div_sub_B #1{#3#4#5#6}{#2}% -}% -\def\XINT_div_sub_B #1#2#3#4\W\X\Y\Z #5#6#7#8% -{% - \xint_gob_til_W #5\xint_div_sub_bz\W - \XINT_div_sub_onestep #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z -}% -\def\XINT_div_sub_onestep #1#2#3#4#5#6% -{% - \expandafter\XINT_div_sub_backtoA - \the\numexpr 11#6-#5#4#3#2+#1-\xint_c_i.% -}% -\def\XINT_div_sub_backtoA #1#2#3.#4% -{% - \XINT_div_sub_A #2{#3#4}% -}% -\def\xint_div_sub_bz\W\XINT_div_sub_onestep #1\Z { -}% -\def\xint_div_sub_az\W\XINT_div_sub_B #1#2{\XINT_div_sub_C #1}% -\def\XINT_div_sub_C #1#2#3#4#5#6% -{% - \xint_gob_til_W #3\xint_div_sub_cz\W - \XINT_div_sub_C_onestep #1{#6#5#4#3}{#2}% -}% -\def\XINT_div_sub_C_onestep #1#2% -{% - \expandafter\XINT_div_sub_backtoC \the\numexpr 11#2+#1-\xint_c_i.% -}% -\def\XINT_div_sub_backtoC #1#2#3.#4% -{% - \XINT_div_sub_C #2{#3#4}% -}% -\def\xint_div_sub_cz\W\XINT_div_sub_C_onestep #1#2% -{% - \if#10% retenue - \expandafter\xint_div_sub_neg - \else\expandafter\xint_div_sub_ok - \fi -}% -\def\xint_div_sub_neg #1{ -}% -\def\xint_div_sub_ok #1{ #1}% \def\xintiiFDg {\romannumeral0\xintiifdg }% \def\xintiifdg #1% {% @@ -2770,6 +875,15 @@ \xint_afterfi{ 0}% \fi }% +\def\xintiiEven {\romannumeral0\xintiieven }% +\def\xintiieven #1% +{% + \ifodd\xintiiLDg{#1} + \xint_afterfi{ 0}% + \else + \xint_afterfi{ 1}% + \fi +}% \def\xintOdd {\romannumeral0\xintodd }% \def\xintodd #1% {% @@ -2779,6 +893,15 @@ \xint_afterfi{ 0}% \fi }% +\def\xintEven {\romannumeral0\xinteven }% +\def\xinteven #1% +{% + \ifodd\xintLDg{#1} + \xint_afterfi{ 0}% + \else + \xint_afterfi{ 1}% + \fi +}% \def\xintDSL {\romannumeral0\xintdsl }% \def\xintdsl #1% {% @@ -3208,92 +1331,17 @@ {% \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7\relax }% -\def\xintDec {\romannumeral0\xintdec }% -\def\xintdec #1% -{% - \expandafter\XINT_dec\romannumeral-`0#1% - \R\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W\W -}% -\def\XINT_dec #1% -{% - \xint_UDzerominusfork - #1-\XINT_dec_zero - 0#1\XINT_dec_neg - 0-{\XINT_dec_pos #1}% - \krof -}% -\def\XINT_dec_zero #1\W\W\W\W\W\W\W\W { -1}% -\def\XINT_dec_neg - {\expandafter\xint_minus_thenstop\romannumeral0\XINT_inc_pos }% -\def\XINT_dec_pos -{% - \expandafter\XINT_dec_a \expandafter{\expandafter}% - \romannumeral0\XINT_OQ {}% -}% -\def\XINT_dec_a #1#2#3#4#5#6#7#8#9% -{% - \expandafter\XINT_dec_b - \the\numexpr 11#9#8#7#6#5#4#3#2-\xint_c_i\relax {#1}% -}% -\def\XINT_dec_b 1#1% -{% - \xint_gob_til_one #1\XINT_dec_A 1\XINT_dec_c -}% -\def\XINT_dec_c #1#2#3#4#5#6#7#8#9{\XINT_dec_a {#1#2#3#4#5#6#7#8#9}}% -\def\XINT_dec_A 1\XINT_dec_c #1#2#3#4#5#6#7#8#9% - {\XINT_dec_B {#1#2#3#4#5#6#7#8#9}}% -\def\XINT_dec_B #1#2\W\W\W\W\W\W\W\W -{% - \expandafter\XINT_dec_cleanup - \romannumeral0\XINT_rord_main {}#2% - \xint_relax - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_relax - #1% -}% -\edef\XINT_dec_cleanup #1#2#3#4#5#6#7#8% - {\noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8\relax }% -\def\xintInc {\romannumeral0\xintinc }% -\def\xintinc #1% -{% - \expandafter\XINT_inc\romannumeral-`0#1% - \R\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W\W -}% -\def\XINT_inc #1% -{% - \xint_UDzerominusfork - #1-\XINT_inc_zero - 0#1\XINT_inc_neg - 0-{\XINT_inc_pos #1}% - \krof -}% -\def\XINT_inc_zero #1\W\W\W\W\W\W\W\W { 1}% -\def\XINT_inc_neg {\expandafter\XINT_opp\romannumeral0\XINT_dec_pos }% -\def\XINT_inc_pos -{% - \expandafter\XINT_inc_a \expandafter{\expandafter}% - \romannumeral0\XINT_OQ {}% -}% -\def\XINT_inc_a #1#2#3#4#5#6#7#8#9% -{% - \xint_gob_til_W #9\XINT_inc_end\W - \expandafter\XINT_inc_b - \the\numexpr 10#9#8#7#6#5#4#3#2+\xint_c_i\relax {#1}% -}% -\def\XINT_inc_b 1#1% -{% - \xint_gob_til_zero #1\XINT_inc_A 0\XINT_inc_c -}% -\def\XINT_inc_c #1#2#3#4#5#6#7#8#9{\XINT_inc_a {#1#2#3#4#5#6#7#8#9}}% -\def\XINT_inc_A 0\XINT_inc_c #1#2#3#4#5#6#7#8#9% - {\XINT_dec_B {#1#2#3#4#5#6#7#8#9}}% -\def\XINT_inc_end\W #1\relax #2{ 1#2}% +\def\xintiiSqrt {\romannumeral0\xintiisqrt }% +\def\xintiisqrt + {\expandafter\XINT_sqrt_post\romannumeral0\xintiisquareroot }% +\def\XINT_sqrt_post #1#2{\XINT_dec_pos #1\R\R\R\R\R\R\R\R\Z + \W\W\W\W\W\W\W\W }% +\def\xintiiSquareRoot {\romannumeral0\xintiisquareroot }% +\def\xintiisquareroot #1% + {\expandafter\XINT_sqrt_checkin\romannumeral-`0#1\Z}% \def\xintiSqrt {\romannumeral0\xintisqrt }% \def\xintisqrt {\expandafter\XINT_sqrt_post\romannumeral0\xintisquareroot }% -\def\XINT_sqrt_post #1#2{\XINT_dec_pos #1\R\R\R\R\R\R\R\R\Z - \W\W\W\W\W\W\W\W }% \def\xintiSquareRoot {\romannumeral0\xintisquareroot }% \def\xintisquareroot #1% {\expandafter\XINT_sqrt_checkin\romannumeral0\xintnum{#1}\Z}% @@ -3464,70 +1512,11 @@ {#2}{#1}% }% \def\XINT_sqrt_big_end #1#2#3#4{ {#3}{#2}}% -\def\xintIsTrue:csv #1{\expandafter\XINT_istrue:_a\romannumeral-`0#1,,^}% -\def\XINT_istrue:_a {\XINT_istrue:_b {}}% -\def\XINT_istrue:_b #1#2,% - {\expandafter\XINT_istrue:_c\romannumeral-`0#2,{#1}}% -\def\XINT_istrue:_c #1{\if #1,\expandafter\XINT_:_f - \else\expandafter\XINT_istrue:_d\fi #1}% -\def\XINT_istrue:_d #1,% - {\expandafter\XINT_istrue:_e\romannumeral0\xintisnotzero {#1},}% -\def\XINT_istrue:_e #1,#2{\XINT_istrue:_b {#2,#1}}% -\def\XINT_:_f ,#1#2^{\xint_gobble_i #1}% -\def\xintANDof:csv #1{\expandafter\XINT_andof:_a\romannumeral-`0#1,,^}% -\def\XINT_andof:_a {\expandafter\XINT_andof:_b\romannumeral-`0}% -\def\XINT_andof:_b #1{\if #1,\expandafter\XINT_andof:_e - \else\expandafter\XINT_andof:_c\fi #1}% -\def\XINT_andof:_c #1,{\xintifTrueAelseB {#1}{\XINT_andof:_a}{\XINT_andof:_no}}% -\def\XINT_andof:_no #1^{0}% -\def\XINT_andof:_e #1^{1}% works with empty list -\def\xintORof:csv #1{\expandafter\XINT_orof:_a\romannumeral-`0#1,,^}% -\def\XINT_orof:_a {\expandafter\XINT_orof:_b\romannumeral-`0}% -\def\XINT_orof:_b #1{\if #1,\expandafter\XINT_orof:_e - \else\expandafter\XINT_orof:_c\fi #1}% -\def\XINT_orof:_c #1,{\xintifTrueAelseB{#1}{\XINT_orof:_yes}{\XINT_orof:_a}}% -\def\XINT_orof:_yes #1^{1}% -\def\XINT_orof:_e #1^{0}% works with empty list -\def\xintXORof:csv #1{\expandafter\XINT_xorof:_a\expandafter - 0\romannumeral-`0#1,,^}% -\def\XINT_xorof:_a #1#2,{\expandafter\XINT_xorof:_b\romannumeral-`0#2,#1}% -\def\XINT_xorof:_b #1{\if #1,\expandafter\XINT_:_e - \else\expandafter\XINT_xorof:_c\fi #1}% -\def\XINT_xorof:_c #1,#2% - {\xintifTrueAelseB {#1}{\if #20\xint_afterfi{\XINT_xorof:_a 1}% - \else\xint_afterfi{\XINT_xorof:_a 0}\fi}% - {\XINT_xorof:_a #2}% - }% -\def\XINT_:_e ,#1#2^{#1}% allows empty list -\def\xintiMaxof:csv #1{\expandafter\XINT_imaxof:_b\romannumeral-`0#1,,}% -\def\XINT_imaxof:_b #1,#2,{\expandafter\XINT_imaxof:_c\romannumeral-`0#2,{#1},}% -\def\XINT_imaxof:_c #1{\if #1,\expandafter\XINT_of:_e - \else\expandafter\XINT_imaxof:_d\fi #1}% -\def\XINT_imaxof:_d #1,{\expandafter\XINT_imaxof:_b\romannumeral0\xintimax {#1}}% -\def\XINT_of:_e ,#1,{#1}% -\let\xintMaxof:csv\xintiMaxof:csv -\def\xintiMinof:csv #1{\expandafter\XINT_iminof:_b\romannumeral-`0#1,,}% -\def\XINT_iminof:_b #1,#2,{\expandafter\XINT_iminof:_c\romannumeral-`0#2,{#1},}% -\def\XINT_iminof:_c #1{\if #1,\expandafter\XINT_of:_e - \else\expandafter\XINT_iminof:_d\fi #1}% -\def\XINT_iminof:_d #1,{\expandafter\XINT_iminof:_b\romannumeral0\xintimin {#1}}% -\let\xintMinof:csv\xintiMinof:csv -\def\xintiiSum:csv #1{\expandafter\XINT_iisum:_a\romannumeral-`0#1,,^}% -\def\XINT_iisum:_a {\XINT_iisum:_b {0}}% -\def\XINT_iisum:_b #1#2,{\expandafter\XINT_iisum:_c\romannumeral-`0#2,{#1}}% -\def\XINT_iisum:_c #1{\if #1,\expandafter\XINT_:_e - \else\expandafter\XINT_iisum:_d\fi #1}% -\def\XINT_iisum:_d #1,#2{\expandafter\XINT_iisum:_b\expandafter - {\romannumeral0\xintiiadd {#2}{#1}}}% -\let\xintSum:csv\xintiiSum:csv -\def\xintiiPrd:csv #1{\expandafter\XINT_iiprd:_a\romannumeral-`0#1,,^}% -\def\XINT_iiprd:_a {\XINT_iiprd:_b {1}}% -\def\XINT_iiprd:_b #1#2,{\expandafter\XINT_iiprd:_c\romannumeral-`0#2,{#1}}% -\def\XINT_iiprd:_c #1{\if #1,\expandafter\XINT_:_e - \else\expandafter\XINT_iiprd:_d\fi #1}% -\def\XINT_iiprd:_d #1,#2{\expandafter\XINT_iiprd:_b\expandafter - {\romannumeral0\xintiimul {#2}{#1}}}% -\let\xintPrd:csv\xintiiPrd:csv +\def\xintiiE {\romannumeral0\xintiie }% used in \xintMod. +\def\xintiie #1#2% + {\expandafter\XINT_iie\the\numexpr #2\expandafter.\expandafter{\romannumeral-`0#1}}% +\def\XINT_iie #1.#2{\ifnum#1>\xint_c_ \xint_dothis{\xint_dsh {#2}{-#1}}\fi + \xint_orthat{ #2}}% \XINT_restorecatcodes_endinput% \endinput %% diff --git a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty index 38ccb72f41b..001062ba53a 100644 --- a/Master/texmf-dist/tex/generic/xint/xintbinhex.sty +++ b/Master/texmf-dist/tex/generic/xint/xintbinhex.sty @@ -20,11 +20,11 @@ %% original source files, as listed above, are part of the %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) -%%---------------------------------------------------------------- -%% The xint bundle (version 1.09n of April 1st, 2014) -%% xintbinhex: Expandable binary and hexadecimal conversions +%% --------------------------------------------------------------- +%% The xint bundle v1.1 (2014/10/28) %% Copyright (C) 2013-2014 by Jean-Francois Burnol -%%---------------------------------------------------------------- +%% xintbinhex: Expandable binary and hexadecimal conversions +%% --------------------------------------------------------------- \begingroup\catcode61\catcode48\catcode32=10\relax% \catcode13=5 % ^^M \endlinechar=13 % @@ -36,10 +36,9 @@ \catcode45=12 % - \catcode46=12 % . \catcode58=12 % : - \def\space { }% \let\z\endgroup \expandafter\let\expandafter\x\csname ver@xintbinhex.sty\endcsname - \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname + \expandafter\let\expandafter\w\csname ver@xintcore.sty\endcsname \expandafter \ifx\csname PackageInfo\endcsname\relax \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% @@ -52,56 +51,26 @@ \aftergroup\endinput \else \ifx\x\relax % plain-TeX, first loading of xintbinhex.sty - \ifx\w\relax % but xint.sty not yet loaded. - \y{xintbinhex}{now issuing \string\input\space xint.sty}% - \def\z{\endgroup\input xint.sty\relax}% + \ifx\w\relax % but xintcore.sty not yet loaded. + \def\z{\endgroup\input xintcore.sty\relax}% \fi \else \def\empty {}% \ifx\x\empty % LaTeX, first loading, % variable is initialized, but \ProvidesPackage not yet seen - \ifx\w\relax % xint.sty not yet loaded. - \y{xintbinhex}{now issuing \string\RequirePackage{xint}}% - \def\z{\endgroup\RequirePackage{xint}}% + \ifx\w\relax % xintcore.sty not yet loaded. + \def\z{\endgroup\RequirePackage{xintcore}}% \fi \else - \y{xintbinhex}{I was already loaded, aborting input}% - \aftergroup\endinput + \aftergroup\endinput % xintbinhex already loaded. \fi \fi \fi \z% -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode123=1 % { - \catcode125=2 % } - \catcode64=11 % @ - \catcode35=6 % # - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode58=12 % : - \ifdefined\PackageInfo - \def\y#1#2{\PackageInfo{#1}{#2}}% - \else - \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% - \fi - \def\empty {}% - \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname - \ifx\w\relax % Plain TeX, user gave a file name at the prompt - \y{xintbinhex}{Loading of package xint failed, aborting input}% - \aftergroup\endinput - \fi - \ifx\w\empty % LaTeX, user gave a file name at the prompt - \y{xintbinhex}{Loading of package xint failed, aborting input}% - \aftergroup\endinput - \fi -\endgroup% -\XINTsetupcatcodes% +\XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintbinhex}% - [2014/04/01 v1.09n Expandable binary and hexadecimal conversions (jfB)]% + [2014/10/28 v1.1 Expandable binary and hexadecimal conversions (jfB)]% \chardef\xint_c_xvi 16 \chardef\xint_c_ii^vii 128 \mathchardef\xint_c_ii^viii 256 @@ -110,19 +79,19 @@ \newcount\xint_c_ii^xvi \xint_c_ii^xvi 65536 \newcount\xint_c_x^v \xint_c_x^v 100000 \newcount\xint_c_x^ix \xint_c_x^ix 1000000000 -\def\XINT_tmpa #1{% +\def\XINT_tmpa #1{\ifx\relax#1\else \expandafter\edef\csname XINT_sdth_#1\endcsname {\ifcase #1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or - 8\or 9\or A\or B\or C\or D\or E\or F\fi}}% -\xintApplyInline\XINT_tmpa - {{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}}% -\def\XINT_tmpa #1{% + 8\or 9\or A\or B\or C\or D\or E\or F\fi}% + \expandafter\XINT_tmpa\fi }% +\XINT_tmpa {0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}\relax +\def\XINT_tmpa #1{\ifx\relax#1\else \expandafter\edef\csname XINT_sdtb_#1\endcsname {\ifcase #1 0000\or 0001\or 0010\or 0011\or 0100\or 0101\or 0110\or 0111\or - 1000\or 1001\or 1010\or 1011\or 1100\or 1101\or 1110\or 1111\fi}}% -\xintApplyInline\XINT_tmpa - {{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}}% + 1000\or 1001\or 1010\or 1011\or 1100\or 1101\or 1110\or 1111\fi}% + \expandafter\XINT_tmpa\fi }% +\XINT_tmpa {0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}\relax \let\XINT_tmpa\relax \expandafter\def\csname XINT_sbtd_0000\endcsname {0}% \expandafter\def\csname XINT_sbtd_0001\endcsname {1}% diff --git a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty index 8aa2b5c2b53..c9db663a45d 100644 --- a/Master/texmf-dist/tex/generic/xint/xintcfrac.sty +++ b/Master/texmf-dist/tex/generic/xint/xintcfrac.sty @@ -20,11 +20,11 @@ %% original source files, as listed above, are part of the %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) -%%---------------------------------------------------------------- -%% The xint bundle (version 1.09n of April 1st, 2014) -%% xintcfrac: Expandable continued fractions with xint package +%% --------------------------------------------------------------- +%% The xint bundle v1.1 (2014/10/28) %% Copyright (C) 2013-2014 by Jean-Francois Burnol -%%---------------------------------------------------------------- +%% xintcfrac: Expandable continued fractions with xint package +%% --------------------------------------------------------------- \begingroup\catcode61\catcode48\catcode32=10\relax% \catcode13=5 % ^^M \endlinechar=13 % @@ -36,7 +36,6 @@ \catcode45=12 % - \catcode46=12 % . \catcode58=12 % : - \def\space { }% \let\z\endgroup \expandafter\let\expandafter\x\csname ver@xintcfrac.sty\endcsname \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname @@ -53,7 +52,6 @@ \else \ifx\x\relax % plain-TeX, first loading of xintcfrac.sty \ifx\w\relax % but xintfrac.sty not yet loaded. - \y{xintcfrac}{now issuing \string\input\space xintfrac.sty}% \def\z{\endgroup\input xintfrac.sty\relax}% \fi \else @@ -61,47 +59,18 @@ \ifx\x\empty % LaTeX, first loading, % variable is initialized, but \ProvidesPackage not yet seen \ifx\w\relax % xintfrac.sty not yet loaded. - \y{xintcfrac}{now issuing \string\RequirePackage{xintfrac}}% \def\z{\endgroup\RequirePackage{xintfrac}}% \fi \else - \y{xintcfrac}{I was already loaded, aborting input}% - \aftergroup\endinput + \aftergroup\endinput % xintcfrac already loaded. \fi \fi \fi \z% -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode123=1 % { - \catcode125=2 % } - \catcode64=11 % @ - \catcode35=6 % # - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode58=12 % : - \ifdefined\PackageInfo - \def\y#1#2{\PackageInfo{#1}{#2}}% - \else - \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% - \fi - \def\empty {}% - \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname - \ifx\w\relax % Plain TeX, user gave a file name at the prompt - \y{xintcfrac}{Loading of package xintfrac failed, aborting input}% - \aftergroup\endinput - \fi - \ifx\w\empty % LaTeX, user gave a file name at the prompt - \y{xintcfrac}{Loading of package xintfrac failed, aborting input}% - \aftergroup\endinput - \fi -\endgroup% -\XINTsetupcatcodes% +\XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintcfrac}% - [2014/04/01 v1.09n Expandable continued fractions with xint package (jfB)]% + [2014/10/28 v1.1 Expandable continued fractions with xint package (jfB)]% \def\xintCFrac {\romannumeral0\xintcfrac }% \def\xintcfrac #1% {% diff --git a/Master/texmf-dist/tex/generic/xint/xintcore.sty b/Master/texmf-dist/tex/generic/xint/xintcore.sty new file mode 100644 index 00000000000..a23eb23cb84 --- /dev/null +++ b/Master/texmf-dist/tex/generic/xint/xintcore.sty @@ -0,0 +1,2104 @@ +%% +%% This is file `xintcore.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xint.dtx (with options: `xintcore') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from xintcore.sty. +%% +%% For distribution of the original source see the terms +%% for copying and modification in the file xint.dtx. +%% +%% This generated file may be distributed as long as the +%% original source files, as listed above, are part of the +%% same distribution. (The sources need not necessarily be +%% in the same archive or directory.) +%% --------------------------------------------------------------- +%% The xint bundle v1.1 (2014/10/28) +%% Copyright (C) 2013-2014 by Jean-Francois Burnol +%% xintcore: Expandable arithmetic on big integers +%% --------------------------------------------------------------- +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode123=1 % { + \catcode125=2 % } + \catcode64=11 % @ + \catcode35=6 % # + \catcode44=12 % , + \catcode45=12 % - + \catcode46=12 % . + \catcode58=12 % : + \let\z\endgroup + \expandafter\let\expandafter\x\csname ver@xintcore.sty\endcsname + \expandafter\let\expandafter\w\csname ver@xintkernel.sty\endcsname + \expandafter + \ifx\csname PackageInfo\endcsname\relax + \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% + \else + \def\y#1#2{\PackageInfo{#1}{#2}}% + \fi + \expandafter + \ifx\csname numexpr\endcsname\relax + \y{xintcore}{\numexpr not available, aborting input}% + \aftergroup\endinput + \else + \ifx\x\relax % plain-TeX, first loading of xintcore.sty + \ifx\w\relax % but xintkernel.sty not yet loaded. + \def\z{\endgroup\input xintkernel.sty\relax}% + \fi + \else + \def\empty {}% + \ifx\x\empty % LaTeX, first loading, + % variable is initialized, but \ProvidesPackage not yet seen + \ifx\w\relax % xintkernel.sty not yet loaded. + \def\z{\endgroup\RequirePackage{xintkernel}}% + \fi + \else + \aftergroup\endinput % xinttools already loaded. + \fi + \fi + \fi +\z% +\XINTsetupcatcodes% defined in xintkernel.sty +\XINT_providespackage +\ProvidesPackage{xintcore}% + [2014/10/28 v1.1 Expandable arithmetic on big integers (jfB)]% +\def\xint_minus_thenstop { -}% +\def\xint_gob_til_zeros_iii #1000{}% +\def\xint_gob_til_zeros_iv #10000{}% +\def\xint_gob_til_one #11{}% +\def\xint_gob_til_G #1G{}% +\def\xint_gob_til_minus #1-{}% +\def\xint_gob_til_relax #1\relax {}% +\def\xint_exchangetwo_keepbraces #1#2{{#2}{#1}}% +\def\xint_exchangetwo_keepbraces_thenstop #1#2{ {#2}{#1}}% +\def\xint_UDzerofork #10#2#3\krof {#2}% +\def\xint_UDsignfork #1-#2#3\krof {#2}% +\def\xint_UDwfork #1\W#2#3\krof {#2}% +\def\xint_UDzerosfork #100#2#3\krof {#2}% +\def\xint_UDonezerofork #110#2#3\krof {#2}% +\def\xint_UDsignsfork #1--#2#3\krof {#2}% +\chardef\xint_c_ix 9 +\chardef\xint_c_x 10 +\chardef\xint_c_ii^v 32 % not used in xint, common to xintfrac and xintbinhex +\chardef\xint_c_ii^vi 64 +\mathchardef\xint_c_ixixixix 9999 +\mathchardef\xint_c_x^iv 10000 +\newcount\xint_c_x^viii \xint_c_x^viii 100000000 +\def\XINT_RQ #1#2#3#4#5#6#7#8#9% +{% + \xint_gob_til_R #9\XINT_RQ_end_a\R\XINT_RQ {#9#8#7#6#5#4#3#2#1}% +}% +\def\XINT_RQ_end_a\R\XINT_RQ #1#2\Z +{% + \XINT_RQ_end_b #1\Z +}% +\def\XINT_RQ_end_b #1#2#3#4#5#6#7#8% +{% + \xint_gob_til_R + #8\XINT_RQ_end_viii + #7\XINT_RQ_end_vii + #6\XINT_RQ_end_vi + #5\XINT_RQ_end_v + #4\XINT_RQ_end_iv + #3\XINT_RQ_end_iii + #2\XINT_RQ_end_ii + \R\XINT_RQ_end_i + \Z #2#3#4#5#6#7#8% +}% +\def\XINT_RQ_end_viii #1\Z #2#3#4#5#6#7#8#9\Z { #9}% +\def\XINT_RQ_end_vii #1\Z #2#3#4#5#6#7#8#9\Z { #8#9000}% +\def\XINT_RQ_end_vi #1\Z #2#3#4#5#6#7#8#9\Z { #7#8#900}% +\def\XINT_RQ_end_v #1\Z #2#3#4#5#6#7#8#9\Z { #6#7#8#90}% +\def\XINT_RQ_end_iv #1\Z #2#3#4#5#6#7#8#9\Z { #5#6#7#8#9}% +\def\XINT_RQ_end_iii #1\Z #2#3#4#5#6#7#8#9\Z { #4#5#6#7#8#9000}% +\def\XINT_RQ_end_ii #1\Z #2#3#4#5#6#7#8#9\Z { #3#4#5#6#7#8#900}% +\def\XINT_RQ_end_i \Z #1#2#3#4#5#6#7#8\Z { #1#2#3#4#5#6#7#80}% +\def\XINT_OQ #1#2#3#4#5#6#7#8#9% +{% + \xint_gob_til_R #9\XINT_OQ_end_a\R\XINT_OQ {#9#8#7#6#5#4#3#2#1}% +}% +\def\XINT_OQ_end_a\R\XINT_OQ #1#2\Z +{% + \XINT_OQ_end_b #1\Z +}% +\def\XINT_OQ_end_b #1#2#3#4#5#6#7#8% +{% + \xint_gob_til_R + #8\XINT_OQ_end_viii + #7\XINT_OQ_end_vii + #6\XINT_OQ_end_vi + #5\XINT_OQ_end_v + #4\XINT_OQ_end_iv + #3\XINT_OQ_end_iii + #2\XINT_OQ_end_ii + \R\XINT_OQ_end_i + \Z #2#3#4#5#6#7#8% +}% +\def\XINT_OQ_end_viii #1\Z #2#3#4#5#6#7#8#9\Z { #9}% +\def\XINT_OQ_end_vii #1\Z #2#3#4#5#6#7#8#9\Z { #8#90000000}% +\def\XINT_OQ_end_vi #1\Z #2#3#4#5#6#7#8#9\Z { #7#8#9000000}% +\def\XINT_OQ_end_v #1\Z #2#3#4#5#6#7#8#9\Z { #6#7#8#900000}% +\def\XINT_OQ_end_iv #1\Z #2#3#4#5#6#7#8#9\Z { #5#6#7#8#90000}% +\def\XINT_OQ_end_iii #1\Z #2#3#4#5#6#7#8#9\Z { #4#5#6#7#8#9000}% +\def\XINT_OQ_end_ii #1\Z #2#3#4#5#6#7#8#9\Z { #3#4#5#6#7#8#900}% +\def\XINT_OQ_end_i \Z #1#2#3#4#5#6#7#8\Z { #1#2#3#4#5#6#7#80}% +\edef\xint_cleanupzeros_andstop #1#2#3#4% +{% + \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4\relax +}% +\def\xint_cleanupzeros_nostop #1#2#3#4% +{% + \the\numexpr #1#2#3#4\relax +}% +\def\XINT_rev_andcuz #1% +{% + \expandafter\xint_cleanupzeros_andstop + \romannumeral0\XINT_rord_main {}#1% + \xint_relax + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_relax +}% +\def\XINT_cuz #1% +{% + \XINT_cuz_loop #1\W\W\W\W\W\W\W\Z% +}% +\def\XINT_cuz_loop #1#2#3#4#5#6#7#8% +{% + \xint_gob_til_W #8\xint_cuz_end_a\W + \xint_gob_til_Z #8\xint_cuz_end_A\Z + \XINT_cuz_check_a {#1#2#3#4#5#6#7#8}% +}% +\def\xint_cuz_end_a #1\XINT_cuz_check_a #2% +{% + \xint_cuz_end_b #2% +}% +\edef\xint_cuz_end_b #1#2#3#4#5\Z +{% + \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4\relax +}% +\def\xint_cuz_end_A \Z\XINT_cuz_check_a #1{ 0}% +\def\XINT_cuz_check_a #1% +{% + \expandafter\XINT_cuz_check_b\the\numexpr #1\relax +}% +\def\XINT_cuz_check_b #1% +{% + \xint_gob_til_zero #1\xint_cuz_backtoloop 0\XINT_cuz_stop #1% +}% +\def\XINT_cuz_stop #1\W #2\Z{ #1}% +\def\xint_cuz_backtoloop 0\XINT_cuz_stop 0{\XINT_cuz_loop }% +\def\xintiNum {\romannumeral0\xintinum }% +\def\xintinum #1% +{% + \expandafter\XINT_num_loop + \romannumeral-`0#1\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\Z +}% +\let\xintNum\xintiNum \let\xintnum\xintinum +\def\XINT_num #1% +{% + \XINT_num_loop #1\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\Z +}% +\def\XINT_num_loop #1#2#3#4#5#6#7#8% +{% + \xint_gob_til_xint_relax #8\XINT_num_end\xint_relax + \XINT_num_NumEight #1#2#3#4#5#6#7#8% +}% +\edef\XINT_num_end\xint_relax\XINT_num_NumEight #1\xint_relax #2\Z +{% + \noexpand\expandafter\space\noexpand\the\numexpr #1+\xint_c_\relax +}% +\def\XINT_num_NumEight #1#2#3#4#5#6#7#8% +{% + \ifnum \numexpr #1#2#3#4#5#6#7#8+\xint_c_= \xint_c_ + \xint_afterfi {\expandafter\XINT_num_keepsign_a + \the\numexpr #1#2#3#4#5#6#7#81\relax}% + \else + \xint_afterfi {\expandafter\XINT_num_finish + \the\numexpr #1#2#3#4#5#6#7#8\relax}% + \fi +}% +\def\XINT_num_keepsign_a #1% +{% + \xint_gob_til_one#1\XINT_num_gobacktoloop 1\XINT_num_keepsign_b +}% +\def\XINT_num_gobacktoloop 1\XINT_num_keepsign_b {\XINT_num_loop }% +\def\XINT_num_keepsign_b #1{\XINT_num_loop -}% +\def\XINT_num_finish #1\xint_relax #2\Z { #1}% +\def\xintiiSgn {\romannumeral0\xintiisgn }% +\def\xintiisgn #1% +{% + \expandafter\XINT_sgn \romannumeral-`0#1\Z% +}% +\def\xintSgn {\romannumeral0\xintsgn }% +\def\xintsgn #1% +{% + \expandafter\XINT_sgn \romannumeral0\xintnum{#1}\Z% +}% +\def\XINT_sgn #1#2\Z +{% + \xint_UDzerominusfork + #1-{ 0}% + 0#1{ -1}% + 0-{ 1}% + \krof +}% +\def\XINT_Sgn #1#2\Z +{% + \xint_UDzerominusfork + #1-{0}% + 0#1{-1}% + 0-{1}% + \krof +}% +\def\XINT_cntSgn #1#2\Z +{% + \xint_UDzerominusfork + #1-\xint_c_ + 0#1\m@ne % I will not allocate a count only for -1? + 0-\xint_c_i + \krof +}% +\def\xintiiOpp {\romannumeral0\xintiiopp }% +\def\xintiiopp #1% +{% + \expandafter\XINT_opp \romannumeral-`0#1% +}% +\def\xintiOpp {\romannumeral0\xintiopp }% +\def\xintiopp #1% +{% + \expandafter\XINT_opp \romannumeral0\xintnum{#1}% +}% +\let\xintOpp\xintiOpp \let\xintopp\xintiopp +\def\XINT_Opp #1{\romannumeral0\XINT_opp #1}% +\def\XINT_opp #1% +{% + \xint_UDzerominusfork + #1-{ 0}% zero + 0#1{ }% negative + 0-{ -#1}% positive + \krof +}% +\def\xintiiAbs {\romannumeral0\xintiiabs }% +\def\xintiiabs #1% +{% + \expandafter\XINT_abs \romannumeral-`0#1% +}% +\def\xintiAbs {\romannumeral0\xintiabs }% +\def\xintiabs #1% +{% + \expandafter\XINT_abs \romannumeral0\xintnum{#1}% +}% +\let\xintAbs\xintiAbs \let\xintabs\xintiabs +\def\XINT_Abs #1{\romannumeral0\XINT_abs #1}% +\def\XINT_abs #1% +{% + \xint_UDsignfork + #1{ }% + -{ #1}% + \krof +}% +\def\XINT_add_A #1#2#3#4#5#6% +{% + \xint_gob_til_W #3\xint_add_az\W + \XINT_add_AB #1{#3#4#5#6}{#2}% +}% +\def\xint_add_az\W\XINT_add_AB #1#2% +{% + \XINT_add_AC_checkcarry #1% +}% +\def\XINT_add_AB #1#2#3#4\W\X\Y\Z #5#6#7#8% +{% + \xint_gob_til_W #5\xint_add_bz\W + \XINT_add_ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z +}% +\def\XINT_add_ABE #1#2#3#4#5#6% +{% + \expandafter\XINT_add_ABEA\the\numexpr #1+10#5#4#3#2+#6.% +}% +\def\XINT_add_ABEA #1#2#3.#4% +{% + \XINT_add_A #2{#3#4}% +}% +\def\xint_add_bz\W\XINT_add_ABE #1#2#3#4#5#6% +{% + \expandafter\XINT_add_CC\the\numexpr #1+10#5#4#3#2.% +}% +\def\XINT_add_CC #1#2#3.#4% +{% + \XINT_add_AC_checkcarry #2{#3#4}% on va examiner et \'eliminer #2 +}% +\def\XINT_add_AC_checkcarry #1% +{% + \xint_gob_til_zero #1\xint_add_AC_nocarry 0\XINT_add_C +}% +\def\xint_add_AC_nocarry 0\XINT_add_C #1#2\W\X\Y\Z +{% + \expandafter + \xint_cleanupzeros_andstop + \romannumeral0% + \XINT_rord_main {}#2% + \xint_relax + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_relax + #1% +}% +\def\XINT_add_C #1#2#3#4#5% +{% + \xint_gob_til_W #2\xint_add_cz\W + \XINT_add_CD {#5#4#3#2}{#1}% +}% +\def\XINT_add_CD #1% +{% + \expandafter\XINT_add_CC\the\numexpr 1+10#1.% +}% +\def\xint_add_cz\W\XINT_add_CD #1#2{ 1#2}% +\def\XINT_addr_A #1#2#3#4#5#6% +{% + \xint_gob_til_W #3\xint_addr_az\W + \XINT_addr_B #1{#3#4#5#6}{#2}% +}% +\def\xint_addr_az\W\XINT_addr_B #1#2% +{% + \XINT_addr_AC_checkcarry #1% +}% +\def\XINT_addr_B #1#2#3#4\W\X\Y\Z #5#6#7#8% +{% + \xint_gob_til_W #5\xint_addr_bz\W + \XINT_addr_E #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z +}% +\def\XINT_addr_E #1#2#3#4#5#6% +{% + \expandafter\XINT_addr_ABEA\the\numexpr #1+10#5#4#3#2+#6\relax +}% +\def\XINT_addr_ABEA #1#2#3#4#5#6#7% +{% + \XINT_addr_A #2{#7#6#5#4#3}% +}% +\def\xint_addr_bz\W\XINT_addr_E #1#2#3#4#5#6% +{% + \expandafter\XINT_addr_CC\the\numexpr #1+10#5#4#3#2\relax +}% +\def\XINT_addr_CC #1#2#3#4#5#6#7% +{% + \XINT_addr_AC_checkcarry #2{#7#6#5#4#3}% +}% +\def\XINT_addr_AC_checkcarry #1% +{% + \xint_gob_til_zero #1\xint_addr_AC_nocarry 0\XINT_addr_C +}% +\def\xint_addr_AC_nocarry 0\XINT_addr_C #1#2\W\X\Y\Z { #1#2}% +\def\XINT_addr_C #1#2#3#4#5% +{% + \xint_gob_til_W #2\xint_addr_cz\W + \XINT_addr_D {#5#4#3#2}{#1}% +}% +\def\XINT_addr_D #1% +{% + \expandafter\XINT_addr_CC\the\numexpr 1+10#1\relax +}% +\def\xint_addr_cz\W\XINT_addr_D #1#2{ #21000}% +\def\XINT_addm_A #1#2#3#4#5#6% +{% + \xint_gob_til_W #3\xint_addm_az\W + \XINT_addm_AB #1{#3#4#5#6}{#2}% +}% +\def\xint_addm_az\W\XINT_addm_AB #1#2% +{% + \XINT_addm_AC_checkcarry #1% +}% +\def\XINT_addm_AB #1#2#3#4\W\X\Y\Z #5#6#7#8% +{% + \XINT_addm_ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z +}% +\def\XINT_addm_ABE #1#2#3#4#5#6% +{% + \expandafter\XINT_addm_ABEA\the\numexpr #1+10#5#4#3#2+#6.% +}% +\def\XINT_addm_ABEA #1#2#3.#4% +{% + \XINT_addm_A #2{#3#4}% +}% +\def\XINT_addm_AC_checkcarry #1% +{% + \xint_gob_til_zero #1\xint_addm_AC_nocarry 0\XINT_addm_C +}% +\def\xint_addm_AC_nocarry 0\XINT_addm_C #1#2\W\X\Y\Z +{% + \expandafter + \xint_cleanupzeros_andstop + \romannumeral0% + \XINT_rord_main {}#2% + \xint_relax + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_relax + #1% +}% +\def\XINT_addm_C #1#2#3#4#5% +{% + \xint_gob_til_W + #5\xint_addm_cw + #4\xint_addm_cx + #3\xint_addm_cy + #2\xint_addm_cz + \W\XINT_addm_CD {#5#4#3#2}{#1}% +}% +\def\XINT_addm_CD #1% +{% + \expandafter\XINT_addm_CC\the\numexpr 1+10#1.% +}% +\def\XINT_addm_CC #1#2#3.#4% +{% + \XINT_addm_AC_checkcarry #2{#3#4}% +}% +\def\xint_addm_cw + #1\xint_addm_cx + #2\xint_addm_cy + #3\xint_addm_cz + \W\XINT_addm_CD +{% + \expandafter\XINT_addm_CDw\the\numexpr 1+#1#2#3.% +}% +\def\XINT_addm_CDw #1.#2#3\X\Y\Z +{% + \XINT_addm_end #1#3% +}% +\def\xint_addm_cx + #1\xint_addm_cy + #2\xint_addm_cz + \W\XINT_addm_CD +{% + \expandafter\XINT_addm_CDx\the\numexpr 1+#1#2.% +}% +\def\XINT_addm_CDx #1.#2#3\Y\Z +{% + \XINT_addm_end #1#3% +}% +\def\xint_addm_cy + #1\xint_addm_cz + \W\XINT_addm_CD +{% + \expandafter\XINT_addm_CDy\the\numexpr 1+#1.% +}% +\def\XINT_addm_CDy #1.#2#3\Z +{% + \XINT_addm_end #1#3% +}% +\def\xint_addm_cz\W\XINT_addm_CD #1#2#3{\XINT_addm_end #1#3}% +\edef\XINT_addm_end #1#2#3#4#5% + {\noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5\relax}% +\def\XINT_addp_A #1#2#3#4#5#6% +{% + \xint_gob_til_W #3\xint_addp_az\W + \XINT_addp_AB #1{#3#4#5#6}{#2}% +}% +\def\xint_addp_az\W\XINT_addp_AB #1#2% +{% + \XINT_addp_AC_checkcarry #1% +}% +\def\XINT_addp_AC_checkcarry #1% +{% + \xint_gob_til_zero #1\xint_addp_AC_nocarry 0\XINT_addp_C +}% +\def\xint_addp_AC_nocarry 0\XINT_addp_C +{% + \XINT_addp_F +}% +\def\XINT_addp_AB #1#2#3#4\W\X\Y\Z #5#6#7#8% +{% + \XINT_addp_ABE #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z +}% +\def\XINT_addp_ABE #1#2#3#4#5#6% +{% + \expandafter\XINT_addp_ABEA\the\numexpr #1+10#5#4#3#2+#6\relax +}% +\def\XINT_addp_ABEA #1#2#3#4#5#6#7% +{% + \XINT_addp_A #2{#7#6#5#4#3}%<-- attention on met donc \`a droite +}% +\def\XINT_addp_C #1#2#3#4#5% +{% + \xint_gob_til_W + #5\xint_addp_cw + #4\xint_addp_cx + #3\xint_addp_cy + #2\xint_addp_cz + \W\XINT_addp_CD {#5#4#3#2}{#1}% +}% +\def\XINT_addp_CD #1% +{% + \expandafter\XINT_addp_CC\the\numexpr 1+10#1\relax +}% +\def\XINT_addp_CC #1#2#3#4#5#6#7% +{% + \XINT_addp_AC_checkcarry #2{#7#6#5#4#3}% +}% +\def\xint_addp_cw + #1\xint_addp_cx + #2\xint_addp_cy + #3\xint_addp_cz + \W\XINT_addp_CD +{% + \expandafter\XINT_addp_CDw\the\numexpr \xint_c_i+10#1#2#3\relax +}% +\def\XINT_addp_CDw #1#2#3#4#5#6% +{% + \xint_gob_til_zeros_iv #2#3#4#5\XINT_addp_endDw_zeros + 0000\XINT_addp_endDw #2#3#4#5% +}% +\def\XINT_addp_endDw_zeros 0000\XINT_addp_endDw 0000#1\X\Y\Z{ #1}% +\def\XINT_addp_endDw #1#2#3#4#5\X\Y\Z{ #5#4#3#2#1}% +\def\xint_addp_cx + #1\xint_addp_cy + #2\xint_addp_cz + \W\XINT_addp_CD +{% + \expandafter\XINT_addp_CDx\the\numexpr \xint_c_i+100#1#2\relax +}% +\def\XINT_addp_CDx #1#2#3#4#5#6% +{% + \xint_gob_til_zeros_iv #2#3#4#5\XINT_addp_endDx_zeros + 0000\XINT_addp_endDx #2#3#4#5% +}% +\def\XINT_addp_endDx_zeros 0000\XINT_addp_endDx 0000#1\Y\Z{ #1}% +\def\XINT_addp_endDx #1#2#3#4#5\Y\Z{ #5#4#3#2#1}% +\def\xint_addp_cy #1\xint_addp_cz\W\XINT_addp_CD +{% + \expandafter\XINT_addp_CDy\the\numexpr \xint_c_i+1000#1\relax +}% +\def\XINT_addp_CDy #1#2#3#4#5#6% +{% + \xint_gob_til_zeros_iv #2#3#4#5\XINT_addp_endDy_zeros + 0000\XINT_addp_endDy #2#3#4#5% +}% +\def\XINT_addp_endDy_zeros 0000\XINT_addp_endDy 0000#1\Z{ #1}% +\def\XINT_addp_endDy #1#2#3#4#5\Z{ #5#4#3#2#1}% +\def\xint_addp_cz\W\XINT_addp_CD #1#2{ #21000}% +\def\XINT_addp_F #1#2#3#4#5% +{% + \xint_gob_til_W + #5\xint_addp_Gw + #4\xint_addp_Gx + #3\xint_addp_Gy + #2\xint_addp_Gz + \W\XINT_addp_G {#2#3#4#5}{#1}% +}% +\def\XINT_addp_G #1#2% +{% + \XINT_addp_F {#2#1}% +}% +\def\xint_addp_Gw + #1\xint_addp_Gx + #2\xint_addp_Gy + #3\xint_addp_Gz + \W\XINT_addp_G #4% +{% + \xint_gob_til_zeros_iv #3#2#10\XINT_addp_endGw_zeros + 0000\XINT_addp_endGw #3#2#10% +}% +\def\XINT_addp_endGw_zeros 0000\XINT_addp_endGw 0000#1\X\Y\Z{ #1}% +\def\XINT_addp_endGw #1#2#3#4#5\X\Y\Z{ #5#1#2#3#4}% +\def\xint_addp_Gx + #1\xint_addp_Gy + #2\xint_addp_Gz + \W\XINT_addp_G #3% +{% + \xint_gob_til_zeros_iv #2#100\XINT_addp_endGx_zeros + 0000\XINT_addp_endGx #2#100% +}% +\def\XINT_addp_endGx_zeros 0000\XINT_addp_endGx 0000#1\Y\Z{ #1}% +\def\XINT_addp_endGx #1#2#3#4#5\Y\Z{ #5#1#2#3#4}% +\def\xint_addp_Gy + #1\xint_addp_Gz + \W\XINT_addp_G #2% +{% + \xint_gob_til_zeros_iv #1000\XINT_addp_endGy_zeros + 0000\XINT_addp_endGy #1000% +}% +\def\XINT_addp_endGy_zeros 0000\XINT_addp_endGy 0000#1\Z{ #1}% +\def\XINT_addp_endGy #1#2#3#4#5\Z{ #5#1#2#3#4}% +\def\xint_addp_Gz\W\XINT_addp_G #1#2{ #2}% +\def\xintiiAdd {\romannumeral0\xintiiadd }% +\def\xintiiadd #1{\expandafter\xint_iiadd\romannumeral-`0#1\Z }% +\def\xint_iiadd #1#2\Z #3% +{% + \expandafter\XINT_add_fork\expandafter #1\romannumeral-`0#3\Z #2\Z +}% +\def\xintiAdd {\romannumeral0\xintiadd }% +\def\xintiadd #1% +{% + \expandafter\xint_add\romannumeral0\xintnum{#1}\Z +}% +\def\xint_add #1#2\Z #3% +{% + \expandafter\XINT_add_fork\expandafter #1\romannumeral0\xintnum{#3}\Z #2\Z +}% +\let\xintAdd\xintiAdd \let\xintadd\xintiadd +\def\XINT_add_fork #1#2% +{% + \xint_UDzerofork + #1\XINT_add_firstiszero + #2\XINT_add_secondiszero + 0{}% + \krof + \xint_UDsignsfork + #1#2\XINT_add_minusminus + #1-\XINT_add_minusplus + #2-\XINT_add_plusminus + --\XINT_add_plusplus + \krof #1#2% +}% +\def\XINT_add_firstiszero #1\krof #2#3\Z #4\Z { #3}% +\def\XINT_add_secondiszero #1\krof #2#3\Z #4\Z { #2#4}% +\def\XINT_add_plusplus #1#2#3\Z #4\Z {\XINT_add_pre {#1#4}{#2#3}}% +\def\XINT_add_minusminus #1#2#3\Z #4\Z + {\expandafter\xint_minus_thenstop\romannumeral0\XINT_add_pre {#4}{#3}}% +\def\XINT_add_minusplus #1#2#3\Z #4\Z {\XINT_sub_pre {#2#3}{#4}}% +\def\XINT_add_plusminus #1#2#3\Z #4\Z {\XINT_sub_pre {#1#4}{#3}}% +\def\XINT_add_pre #1% +{% + \expandafter\XINT_add_pre_b\expandafter + {\romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z }% +}% +\def\XINT_add_pre_b #1#2% +{% + \expandafter\XINT_add_A + \expandafter0\expandafter{\expandafter}% + \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z + \W\X\Y\Z #1\W\X\Y\Z +}% +\def\xintiiSub {\romannumeral0\xintiisub }% +\def\xintiisub #1{\expandafter\xint_iisub\romannumeral-`0#1\Z }% +\def\xint_iisub #1#2\Z #3% +{% + \expandafter\XINT_sub_fork\expandafter #1\romannumeral-`0#3\Z #2\Z +}% +\def\xintiSub {\romannumeral0\xintisub }% +\def\xintisub #1% +{% + \expandafter\xint_sub\romannumeral0\xintnum{#1}\Z +}% +\def\xint_sub #1#2\Z #3% +{% + \expandafter\XINT_sub_fork\expandafter #1\romannumeral0\xintnum{#3}\Z #2\Z +}% +\let\xintSub\xintiSub \let\xintsub\xintisub +\def\XINT_sub_fork #1#2% +{% + \xint_UDzerofork + #1\XINT_sub_firstiszero + #2\XINT_sub_secondiszero + 0{}% + \krof + \xint_UDsignsfork + #1#2\XINT_sub_minusminus + #1-\XINT_sub_minusplus + #2-\XINT_sub_plusminus + --\XINT_sub_plusplus + \krof #1#2% +}% +\def\XINT_sub_firstiszero #1\krof #2#3\Z #4\Z {\XINT_opp #3}% +\def\XINT_sub_secondiszero #1\krof #2#3\Z #4\Z { #2#4}% +\def\XINT_sub_plusplus #1#2#3\Z #4\Z {\XINT_sub_pre {#1#4}{#2#3}}% +\def\XINT_sub_minusminus #1#2#3\Z #4\Z {\XINT_sub_pre {#3}{#4}}% +\def\XINT_sub_minusplus #1#2#3\Z #4\Z + {\expandafter\xint_minus_thenstop\romannumeral0\XINT_add_pre {#4}{#2#3}}% +\def\XINT_sub_plusminus #1#2#3\Z #4\Z {\XINT_add_pre {#1#4}{#3}}% +\def\XINT_sub_pre #1% +{% + \expandafter\XINT_sub_pre_b\expandafter + {\romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z }% +}% +\def\XINT_sub_pre_b #1#2% +{% + \expandafter\XINT_sub_A + \expandafter1\expandafter{\expandafter}% + \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z + \W\X\Y\Z #1 \W\X\Y\Z +}% +\def\XINT_sub_A #1#2#3\W\X\Y\Z #4#5#6#7% +{% + \xint_gob_til_W + #4\xint_sub_az + \W\XINT_sub_B #1{#4#5#6#7}{#2}#3\W\X\Y\Z +}% +\def\XINT_sub_B #1#2#3#4#5#6#7% +{% + \xint_gob_til_W + #4\xint_sub_bz + \W\XINT_sub_onestep #1#2{#7#6#5#4}{#3}% +}% +\def\XINT_sub_onestep #1#2#3#4#5#6% +{% + \expandafter\XINT_sub_backtoA\the\numexpr 11#5#4#3#2-#6+#1-\xint_c_i.% +}% +\def\XINT_sub_backtoA #1#2#3.#4% +{% + \XINT_sub_A #2{#3#4}% +}% +\def\xint_sub_bz + \W\XINT_sub_onestep #1#2#3#4#5#6#7% +{% + \xint_UDzerofork + #1\XINT_sub_C % une retenue + 0\XINT_sub_D % pas de retenue + \krof + {#7}#2#3#4#5% +}% +\def\XINT_sub_D #1#2\W\X\Y\Z +{% + \expandafter + \xint_cleanupzeros_andstop + \romannumeral0% + \XINT_rord_main {}#2% + \xint_relax + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_relax + #1% +}% +\def\XINT_sub_C #1#2#3#4#5% +{% + \xint_gob_til_W + #2\xint_sub_cz + \W\XINT_sub_AC_onestep {#5#4#3#2}{#1}% +}% +\def\XINT_sub_AC_onestep #1% +{% + \expandafter\XINT_sub_backtoC\the\numexpr 11#1-\xint_c_i.% +}% +\def\XINT_sub_backtoC #1#2#3.#4% +{% + \XINT_sub_AC_checkcarry #2{#3#4}% la retenue va \^etre examin\'ee +}% +\def\XINT_sub_AC_checkcarry #1% +{% + \xint_gob_til_one #1\xint_sub_AC_nocarry 1\XINT_sub_C +}% +\def\xint_sub_AC_nocarry 1\XINT_sub_C #1#2\W\X\Y\Z +{% + \expandafter + \XINT_cuz_loop + \romannumeral0% + \XINT_rord_main {}#2% + \xint_relax + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_relax + #1\W\W\W\W\W\W\W\Z +}% +\def\xint_sub_cz\W\XINT_sub_AC_onestep #1% +{% + \XINT_cuz +}% +\def\xint_sub_az\W\XINT_sub_B #1#2#3#4#5#6#7% +{% + \xint_gob_til_W + #4\xint_sub_ez + \W\XINT_sub_Eenter #1{#3}#4#5#6#7% +}% +\def\XINT_sub_Eenter #1#2% +{% + \expandafter + \XINT_sub_E\expandafter1\expandafter{\expandafter}% + \romannumeral0% + \XINT_rord_main {}#2% + \xint_relax + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_relax + \W\X\Y\Z #1% +}% +\def\XINT_sub_E #1#2#3#4#5#6% +{% + \xint_gob_til_W #3\xint_sub_F\W + \XINT_sub_Eonestep #1{#6#5#4#3}{#2}% +}% +\def\XINT_sub_Eonestep #1#2% +{% + \expandafter\XINT_sub_backtoE\the\numexpr 109999-#2+#1.% +}% +\def\XINT_sub_backtoE #1#2#3.#4% +{% + \XINT_sub_E #2{#3#4}% +}% +\def\xint_sub_F\W\XINT_sub_Eonestep #1#2#3#4% +{% + \xint_UDonezerofork + #4#1{\XINT_sub_Fdec 0}% soustraire 1. Et faire signe - + #1#4{\XINT_sub_Finc 1}% additionner 1. Et faire signe - + 10\XINT_sub_DD % terminer. Mais avec signe - + \krof + {#3}% +}% +\def\XINT_sub_DD {\expandafter\xint_minus_thenstop\romannumeral0\XINT_sub_D }% +\def\XINT_sub_Fdec #1#2#3#4#5#6% +{% + \xint_gob_til_W #3\xint_sub_Fdec_finish\W + \XINT_sub_Fdec_onestep #1{#6#5#4#3}{#2}% +}% +\def\XINT_sub_Fdec_onestep #1#2% +{% + \expandafter\XINT_sub_backtoFdec\the\numexpr 11#2+#1-\xint_c_i.% +}% +\def\XINT_sub_backtoFdec #1#2#3.#4% +{% + \XINT_sub_Fdec #2{#3#4}% +}% +\def\xint_sub_Fdec_finish\W\XINT_sub_Fdec_onestep #1#2% +{% + \expandafter\xint_minus_thenstop\romannumeral0\XINT_cuz +}% +\def\XINT_sub_Finc #1#2#3#4#5#6% +{% + \xint_gob_til_W #3\xint_sub_Finc_finish\W + \XINT_sub_Finc_onestep #1{#6#5#4#3}{#2}% +}% +\def\XINT_sub_Finc_onestep #1#2% +{% + \expandafter\XINT_sub_backtoFinc\the\numexpr 10#2+#1.% +}% +\def\XINT_sub_backtoFinc #1#2#3.#4% +{% + \XINT_sub_Finc #2{#3#4}% +}% +\def\xint_sub_Finc_finish\W\XINT_sub_Finc_onestep #1#2#3% +{% + \xint_UDzerofork + #1{\expandafter\expandafter\expandafter + \xint_minus_thenstop\xint_cleanupzeros_nostop}% + 0{ -1}% + \krof + #3% +}% +\def\xint_sub_ez\W\XINT_sub_Eenter #1% +{% + \xint_UDzerofork + #1\XINT_sub_K % il y a une retenue + 0\XINT_sub_L % pas de retenue + \krof +}% +\def\XINT_sub_L #1\W\X\Y\Z {\XINT_cuz_loop #1\W\W\W\W\W\W\W\Z }% +\def\XINT_sub_K #1% +{% + \expandafter + \XINT_sub_KK\expandafter1\expandafter{\expandafter}% + \romannumeral0% + \XINT_rord_main {}#1% + \xint_relax + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_relax +}% +\def\XINT_sub_KK #1#2#3#4#5#6% +{% + \xint_gob_til_W #3\xint_sub_KK_finish\W + \XINT_sub_KK_onestep #1{#6#5#4#3}{#2}% +}% +\def\XINT_sub_KK_onestep #1#2% +{% + \expandafter\XINT_sub_backtoKK\the\numexpr 109999-#2+#1.% +}% +\def\XINT_sub_backtoKK #1#2#3.#4% +{% + \XINT_sub_KK #2{#3#4}% +}% +\def\xint_sub_KK_finish\W\XINT_sub_KK_onestep #1#2#3% +{% + \expandafter\xint_minus_thenstop + \romannumeral0\XINT_cuz_loop #3\W\W\W\W\W\W\W\Z +}% +\def\xintiiMul {\romannumeral0\xintiimul }% +\def\xintiimul #1% +{% + \expandafter\xint_iimul\expandafter {\romannumeral-`0#1}% +}% +\def\xint_iimul #1#2% +{% + \expandafter\XINT_mul_fork \romannumeral-`0#2\Z #1\Z +}% +\def\xintiMul {\romannumeral0\xintimul }% +\def\xintimul #1% +{% + \expandafter\xint_mul\expandafter {\romannumeral0\xintnum{#1}}% +}% +\def\xint_mul #1#2% +{% + \expandafter\XINT_mul_fork \romannumeral0\xintnum{#2}\Z #1\Z +}% +\let\xintMul\xintiMul \let\xintmul\xintimul +\def\XINT_Mul #1#2{\romannumeral0\XINT_mul_fork #2\Z #1\Z }% +\def\XINT_mul_fork #1#2\Z #3#4\Z +{% + \xint_UDzerofork + #1\XINT_mul_zero + #3\XINT_mul_zero + 0{}% + \krof + \xint_UDsignsfork + #1#3\XINT_mul_minusminus % #1 = #3 = - + #1-{\XINT_mul_minusplus #3}% % #1 = - + #3-{\XINT_mul_plusminus #1}% % #3 = - + --{\XINT_mul_plusplus #1#3}% + \krof + {#2}{#4}% +}% +\def\XINT_mul_zero #1\krof #2#3{ 0}% +\def\XINT_mul_minusminus #1#2% +{% + \expandafter\XINT_mul_choice_a + \expandafter{\romannumeral0\xintlength {#2}}% + {\romannumeral0\xintlength {#1}}{#1}{#2}% +}% +\def\XINT_mul_minusplus #1#2#3% +{% + \expandafter\xint_minus_thenstop\romannumeral0\expandafter + \XINT_mul_choice_a + \expandafter{\romannumeral0\xintlength {#1#3}}% + {\romannumeral0\xintlength {#2}}{#2}{#1#3}% +}% +\def\XINT_mul_plusminus #1#2#3% +{% + \expandafter\xint_minus_thenstop\romannumeral0\expandafter + \XINT_mul_choice_a + \expandafter{\romannumeral0\xintlength {#3}}% + {\romannumeral0\xintlength {#1#2}}{#1#2}{#3}% +}% +\def\XINT_mul_plusplus #1#2#3#4% +{% + \expandafter\XINT_mul_choice_a + \expandafter{\romannumeral0\xintlength {#2#4}}% + {\romannumeral0\xintlength {#1#3}}{#1#3}{#2#4}% +}% +\def\XINT_mul_choice_a #1#2% +{% + \expandafter\XINT_mul_choice_b\expandafter{#2}{#1}% +}% +\def\XINT_mul_choice_b #1#2% +{% + \ifnum #1<\xint_c_v + \expandafter\XINT_mul_choice_littlebyfirst + \else + \ifnum #2<\xint_c_v + \expandafter\expandafter\expandafter\XINT_mul_choice_littlebysecond + \else + \expandafter\expandafter\expandafter\XINT_mul_choice_compare + \fi + \fi + {#1}{#2}% +}% +\def\XINT_mul_choice_littlebyfirst #1#2#3#4% +{% + \expandafter\XINT_mul_M + \expandafter{\the\numexpr #3\expandafter}% + \romannumeral0\XINT_RQ {}#4\R\R\R\R\R\R\R\R\Z \Z\Z\Z\Z +}% +\def\XINT_mul_choice_littlebysecond #1#2#3#4% +{% + \expandafter\XINT_mul_M + \expandafter{\the\numexpr #4\expandafter}% + \romannumeral0\XINT_RQ {}#3\R\R\R\R\R\R\R\R\Z \Z\Z\Z\Z +}% +\def\XINT_mul_choice_compare #1#2% +{% + \ifnum #1>#2 + \expandafter \XINT_mul_choice_i + \else + \expandafter \XINT_mul_choice_ii + \fi + {#1}{#2}% +}% +\def\XINT_mul_choice_i #1#2% +{% + \ifnum #1<\numexpr\ifcase \numexpr (#2-\xint_c_iii)/\xint_c_iv\relax + \or 330\or 168\or 109\or 80\or 66\or 52\else 0\fi\relax + \expandafter\XINT_mul_choice_same + \else + \expandafter\XINT_mul_choice_permute + \fi +}% +\def\XINT_mul_choice_ii #1#2% +{% + \ifnum #2<\numexpr\ifcase \numexpr (#1-\xint_c_iii)/\xint_c_iv\relax + \or 330\or 168\or 109\or 80\or 66\or 52\else 0\fi\relax + \expandafter\XINT_mul_choice_permute + \else + \expandafter\XINT_mul_choice_same + \fi +}% +\def\XINT_mul_choice_same #1#2% +{% + \expandafter\XINT_mul_enter + \romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z + \Z\Z\Z\Z #2\W\W\W\W +}% +\def\XINT_mul_choice_permute #1#2% +{% + \expandafter\XINT_mul_enter + \romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z + \Z\Z\Z\Z #1\W\W\W\W +}% +\def\XINT_mul_Ar #1#2#3#4#5#6% +{% + \xint_gob_til_Z #6\xint_mul_br\Z\XINT_mul_Br #1{#6#5#4#3}{#2}% +}% +\def\xint_mul_br\Z\XINT_mul_Br #1#2% +{% + \XINT_addr_AC_checkcarry #1% +}% +\def\XINT_mul_Br #1#2#3#4\W\X\Y\Z #5#6#7#8% +{% + \expandafter\XINT_mul_ABEAr + \the\numexpr #1+10#2+#8#7#6#5.{#3}#4\W\X\Y\Z +}% +\def\XINT_mul_ABEAr #1#2#3#4#5#6.#7% +{% + \XINT_mul_Ar #2{#7#6#5#4#3}% +}% +\def\XINT_mul_Mr #1% +{% + \expandafter\XINT_mul_Mr_checkifzeroorone\expandafter{\the\numexpr #1}% +}% +\def\XINT_mul_Mr_checkifzeroorone #1% +{% + \ifcase #1 + \expandafter\XINT_mul_Mr_zero + \or + \expandafter\XINT_mul_Mr_one + \else + \expandafter\XINT_mul_Nr + \fi + {0000}{}{#1}% +}% +\def\XINT_mul_Mr_zero #1\Z\Z\Z\Z { 0000}% +\def\XINT_mul_Mr_one #1#2#3#4\Z\Z\Z\Z { #4}% +\def\XINT_mul_Nr #1#2#3#4#5#6#7% +{% + \xint_gob_til_Z #4\xint_mul_pr\Z\XINT_mul_Pr {#1}{#3}{#7#6#5#4}{#2}{#3}% +}% +\def\XINT_mul_Pr #1#2#3% +{% + \expandafter\XINT_mul_Lr\the\numexpr \xint_c_x^viii+#1+#2*#3\relax +}% +\def\XINT_mul_Lr 1#1#2#3#4#5#6#7#8#9% +{% + \XINT_mul_Nr {#1#2#3#4}{#9#8#7#6#5}% +}% +\def\xint_mul_pr\Z\XINT_mul_Pr #1#2#3#4#5% +{% + \xint_gob_til_zeros_iv #1\XINT_mul_Mr_end_nocarry 0000% + \XINT_mul_Mr_end_carry #1{#4}% +}% +\def\XINT_mul_Mr_end_nocarry 0000\XINT_mul_Mr_end_carry 0000#1{ #1}% +\def\XINT_mul_Mr_end_carry #1#2#3#4#5{ #5#4#3#2#1}% +\def\XINT_mul_M #1% +{% + \expandafter\XINT_mul_M_checkifzeroorone\expandafter{\the\numexpr #1}% +}% +\def\XINT_mul_M_checkifzeroorone #1% +{% + \ifcase #1 + \expandafter\XINT_mul_M_zero + \or + \expandafter\XINT_mul_M_one + \else + \expandafter\XINT_mul_N + \fi + {0000}{}{#1}% +}% +\def\XINT_mul_M_zero #1\Z\Z\Z\Z { 0}% +\def\XINT_mul_M_one #1#2#3#4\Z\Z\Z\Z +{% + \expandafter\xint_cleanupzeros_andstop\romannumeral0\xintreverseorder{#4}% +}% +\def\XINT_mul_N #1#2#3#4#5#6#7% +{% + \xint_gob_til_Z #4\xint_mul_p\Z\XINT_mul_P {#1}{#3}{#7#6#5#4}{#2}{#3}% +}% +\def\XINT_mul_P #1#2#3% +{% + \expandafter\XINT_mul_L\the\numexpr \xint_c_x^viii+#1+#2*#3\relax +}% +\def\XINT_mul_L 1#1#2#3#4#5#6#7#8#9% +{% + \XINT_mul_N {#1#2#3#4}{#5#6#7#8#9}% +}% +\def\xint_mul_p\Z\XINT_mul_P #1#2#3#4#5% +{% + \XINT_mul_M_end #1#4% +}% +\edef\XINT_mul_M_end #1#2#3#4#5#6#7#8% +{% + \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8\relax +}% +\def\XINT_mul_enter #1\Z\Z\Z\Z #2#3#4#5% +{% + \xint_gob_til_W #5\XINT_mul_exit_a\W + \XINT_mul_start {#2#3#4#5}#1\Z\Z\Z\Z +}% +\def\XINT_mul_exit_a\W\XINT_mul_start #1% +{% + \XINT_mul_exit_b #1% +}% +\def\XINT_mul_exit_b #1#2#3#4% +{% + \xint_gob_til_W + #2\XINT_mul_exit_ci + #3\XINT_mul_exit_cii + \W\XINT_mul_exit_ciii #1#2#3#4% +}% +\def\XINT_mul_exit_ciii #1\W #2\Z\Z\Z\Z \W\W\W +{% + \XINT_mul_M {#1}#2\Z\Z\Z\Z +}% +\def\XINT_mul_exit_cii\W\XINT_mul_exit_ciii #1\W\W #2\Z\Z\Z\Z \W\W +{% + \XINT_mul_M {#1}#2\Z\Z\Z\Z +}% +\def\XINT_mul_exit_ci\W\XINT_mul_exit_cii + \W\XINT_mul_exit_ciii #1\W\W\W #2\Z\Z\Z\Z \W +{% + \XINT_mul_M {#1}#2\Z\Z\Z\Z +}% +\def\XINT_mul_start #1#2\Z\Z\Z\Z +{% + \expandafter\XINT_mul_main\expandafter + {\romannumeral0\XINT_mul_Mr {#1}#2\Z\Z\Z\Z}#2\Z\Z\Z\Z +}% +\def\XINT_mul_main #1#2\Z\Z\Z\Z #3#4#5#6% +{% + \xint_gob_til_W #6\XINT_mul_finish_a\W + \XINT_mul_compute {#3#4#5#6}{#1}#2\Z\Z\Z\Z +}% +\def\XINT_mul_compute #1#2#3\Z\Z\Z\Z +{% + \expandafter\XINT_mul_main\expandafter + {\romannumeral0\expandafter + \XINT_mul_Ar\expandafter0\expandafter{\expandafter}% + \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z + \W\X\Y\Z 0000#2\W\X\Y\Z }#3\Z\Z\Z\Z +}% +\def\XINT_mul_finish_a\W\XINT_mul_compute #1% +{% + \XINT_mul_finish_b #1% +}% +\def\XINT_mul_finish_b #1#2#3#4% +{% + \xint_gob_til_W + #1\XINT_mul_finish_c + #2\XINT_mul_finish_ci + #3\XINT_mul_finish_cii + \W\XINT_mul_finish_ciii #1#2#3#4% +}% +\def\XINT_mul_finish_ciii #1\W #2#3\Z\Z\Z\Z \W\W\W +{% + \expandafter\XINT_addm_A\expandafter0\expandafter{\expandafter}% + \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 000#2\W\X\Y\Z +}% +\def\XINT_mul_finish_cii + \W\XINT_mul_finish_ciii #1\W\W #2#3\Z\Z\Z\Z \W\W +{% + \expandafter\XINT_addm_A\expandafter0\expandafter{\expandafter}% + \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 00#2\W\X\Y\Z +}% +\def\XINT_mul_finish_ci #1\XINT_mul_finish_ciii #2\W\W\W #3#4\Z\Z\Z\Z \W +{% + \expandafter\XINT_addm_A\expandafter0\expandafter{\expandafter}% + \romannumeral0\XINT_mul_Mr {#2}#4\Z\Z\Z\Z \W\X\Y\Z 0#3\W\X\Y\Z +}% +\def\XINT_mul_finish_c #1\XINT_mul_finish_ciii \W\W\W\W #2#3\Z\Z\Z\Z +{% + \expandafter\xint_cleanupzeros_andstop\romannumeral0\xintreverseorder{#2}% +}% +\def\XINT_mulr_enter #1\Z\Z\Z\Z #2#3#4#5% +{% + \xint_gob_til_W #5\XINT_mulr_exit_a\W + \XINT_mulr_start {#2#3#4#5}#1\Z\Z\Z\Z +}% +\def\XINT_mulr_exit_a\W\XINT_mulr_start #1% +{% + \XINT_mulr_exit_b #1% +}% +\def\XINT_mulr_exit_b #1#2#3#4% +{% + \xint_gob_til_W + #2\XINT_mulr_exit_ci + #3\XINT_mulr_exit_cii + \W\XINT_mulr_exit_ciii #1#2#3#4% +}% +\def\XINT_mulr_exit_ciii #1\W #2\Z\Z\Z\Z \W\W\W +{% + \XINT_mul_Mr {#1}#2\Z\Z\Z\Z +}% +\def\XINT_mulr_exit_cii\W\XINT_mulr_exit_ciii #1\W\W #2\Z\Z\Z\Z \W\W +{% + \XINT_mul_Mr {#1}#2\Z\Z\Z\Z +}% +\def\XINT_mulr_exit_ci\W\XINT_mulr_exit_cii + \W\XINT_mulr_exit_ciii #1\W\W\W #2\Z\Z\Z\Z \W +{% + \XINT_mul_Mr {#1}#2\Z\Z\Z\Z +}% +\def\XINT_mulr_start #1#2\Z\Z\Z\Z +{% + \expandafter\XINT_mulr_main\expandafter + {\romannumeral0\XINT_mul_Mr {#1}#2\Z\Z\Z\Z}#2\Z\Z\Z\Z +}% +\def\XINT_mulr_main #1#2\Z\Z\Z\Z #3#4#5#6% +{% + \xint_gob_til_W #6\XINT_mulr_finish_a\W + \XINT_mulr_compute {#3#4#5#6}{#1}#2\Z\Z\Z\Z +}% +\def\XINT_mulr_compute #1#2#3\Z\Z\Z\Z +{% + \expandafter\XINT_mulr_main\expandafter + {\romannumeral0\expandafter + \XINT_mul_Ar\expandafter0\expandafter{\expandafter}% + \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z + \W\X\Y\Z 0000#2\W\X\Y\Z }#3\Z\Z\Z\Z +}% +\def\XINT_mulr_finish_a\W\XINT_mulr_compute #1% +{% + \XINT_mulr_finish_b #1% +}% +\def\XINT_mulr_finish_b #1#2#3#4% +{% + \xint_gob_til_W + #1\XINT_mulr_finish_c + #2\XINT_mulr_finish_ci + #3\XINT_mulr_finish_cii + \W\XINT_mulr_finish_ciii #1#2#3#4% +}% +\def\XINT_mulr_finish_ciii #1\W #2#3\Z\Z\Z\Z \W\W\W +{% + \expandafter\XINT_addp_A\expandafter0\expandafter{\expandafter}% + \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 000#2\W\X\Y\Z +}% +\def\XINT_mulr_finish_cii + \W\XINT_mulr_finish_ciii #1\W\W #2#3\Z\Z\Z\Z \W\W +{% + \expandafter\XINT_addp_A\expandafter0\expandafter{\expandafter}% + \romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z \W\X\Y\Z 00#2\W\X\Y\Z +}% +\def\XINT_mulr_finish_ci #1\XINT_mulr_finish_ciii #2\W\W\W #3#4\Z\Z\Z\Z \W +{% + \expandafter\XINT_addp_A\expandafter0\expandafter{\expandafter}% + \romannumeral0\XINT_mul_Mr {#2}#4\Z\Z\Z\Z \W\X\Y\Z 0#3\W\X\Y\Z +}% +\def\XINT_mulr_finish_c #1\XINT_mulr_finish_ciii \W\W\W\W #2#3\Z\Z\Z\Z { #2}% +\def\xintiiSqr {\romannumeral0\xintiisqr }% +\def\xintiisqr #1% +{% + \expandafter\XINT_sqr\expandafter {\romannumeral0\xintiiabs{#1}}% +}% +\def\xintiSqr {\romannumeral0\xintisqr }% +\def\xintisqr #1% +{% + \expandafter\XINT_sqr\expandafter {\romannumeral0\xintiabs{#1}}% +}% +\let\xintSqr\xintiSqr \let\xintsqr\xintisqr +\def\XINT_sqr #1% +{% + \expandafter\XINT_mul_enter + \romannumeral0% + \XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z + \Z\Z\Z\Z #1\W\W\W\W +}% +\def\xintiiPow {\romannumeral0\xintiipow }% +\def\xintiipow #1% +{% + \expandafter\xint_pow\romannumeral-`0#1\Z% +}% +\def\xintiPow {\romannumeral0\xintipow }% +\def\xintipow #1% +{% + \expandafter\xint_pow\romannumeral0\xintnum{#1}\Z% +}% +\let\xintPow\xintiPow \let\xintpow\xintipow +\def\xint_pow #1#2\Z +{% + \xint_UDsignfork + #1\XINT_pow_Aneg + -\XINT_pow_Anonneg + \krof + #1{#2}% +}% +\def\XINT_pow_Aneg #1#2#3% +{% + \expandafter\XINT_pow_Aneg_\expandafter{\the\numexpr #3}#2\Z +}% +\def\XINT_pow_Aneg_ #1% +{% + \ifodd #1 + \expandafter\XINT_pow_Aneg_Bodd + \fi + \XINT_pow_Anonneg_ {#1}% +}% +\def\XINT_pow_Aneg_Bodd #1% +{% + \expandafter\XINT_opp\romannumeral0\XINT_pow_Anonneg_ +}% +\def\XINT_pow_Anonneg #1#2#3% +{% + \expandafter\XINT_pow_Anonneg_\expandafter {\the\numexpr #3}#1#2\Z +}% +\def\XINT_pow_Anonneg_ #1#2#3\Z +{% + \if\relax #3\relax\xint_dothis + {\ifcase #2 \expandafter\XINT_pow_AisZero + \or\expandafter\XINT_pow_AisOne + \else\expandafter\XINT_pow_AatleastTwo + \fi }\fi + \xint_orthat \XINT_pow_AatleastTwo {#1}{#2#3}% +}% +\def\XINT_pow_AisOne #1#2{ 1}% +\def\XINT_pow_AisZero #1#2% +{% + \ifcase\XINT_cntSgn #1\Z + \xint_afterfi { 1}% + \or + \xint_afterfi { 0}% + \else + \xint_afterfi {\xintError:DivisionByZero\space 0}% + \fi +}% +\def\XINT_pow_AatleastTwo #1% +{% + \ifcase\XINT_cntSgn #1\Z + \expandafter\XINT_pow_BisZero + \or + \expandafter\XINT_pow_checkBsize + \else + \expandafter\XINT_pow_BisNegative + \fi + {#1}% +}% +\edef\XINT_pow_BisNegative #1#2% + {\noexpand\xintError:FractionRoundedToZero\space 0}% +\def\XINT_pow_BisZero #1#2{ 1}% +\def\XINT_pow_checkBsize #1% +{% + \ifnum #1>100000 + \expandafter\XINT_pow_BtooBig + \else + \expandafter\XINT_pow_loopI + \fi + {#1}% +}% +\edef\XINT_pow_BtooBig #1#2{\noexpand\xintError:ExponentTooBig\space 0}% +\def\XINT_pow_loopI #1% +{% + \ifnum #1=\xint_c_i\XINT_pow_Iend\fi + \ifodd #1 + \expandafter\XINT_pow_loopI_odd + \else + \expandafter\XINT_pow_loopI_even + \fi + {#1}% +}% +\edef\XINT_pow_Iend\fi #1\fi #2#3{\noexpand\fi\space #3}% +\def\XINT_pow_loopI_even #1#2% +{% + \expandafter\XINT_pow_loopI\expandafter + {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter + {\romannumeral0\xintiisqr {#2}}% +}% +\def\XINT_pow_loopI_odd #1#2% +{% + \expandafter\XINT_pow_loopI_odda\expandafter + {\romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z }{#1}{#2}% +}% +\def\XINT_pow_loopI_odda #1#2#3% +{% + \expandafter\XINT_pow_loopII\expandafter + {\the\numexpr #2/\xint_c_ii-\xint_c_i\expandafter}\expandafter + {\romannumeral0\xintiisqr {#3}}{#1}% +}% +\def\XINT_pow_loopII #1% +{% + \ifnum #1 = \xint_c_i\XINT_pow_IIend\fi + \ifodd #1 + \expandafter\XINT_pow_loopII_odd + \else + \expandafter\XINT_pow_loopII_even + \fi + {#1}% +}% +\def\XINT_pow_loopII_even #1#2% +{% + \expandafter\XINT_pow_loopII\expandafter + {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter + {\romannumeral0\xintiisqr {#2}}% +}% +\def\XINT_pow_loopII_odd #1#2#3% +{% + \expandafter\XINT_pow_loopII_odda\expandafter + {\romannumeral0\XINT_mulr_enter #3\Z\Z\Z\Z #2\W\W\W\W}{#1}{#2}% +}% +\def\XINT_pow_loopII_odda #1#2#3% +{% + \expandafter\XINT_pow_loopII\expandafter + {\the\numexpr #2/\xint_c_ii-\xint_c_i\expandafter}\expandafter + {\romannumeral0\xintiisqr {#3}}{#1}% +}% +\def\XINT_pow_IIend\fi #1\fi #2#3#4% +{% + \fi\XINT_mul_enter #4\Z\Z\Z\Z #3\W\W\W\W +}% +\def\xintiiQuo {\romannumeral0\xintiiquo }% +\def\xintiiRem {\romannumeral0\xintiirem }% +\def\xintiiquo {\expandafter\xint_firstoftwo_thenstop\romannumeral0\xintiidivision }% +\def\xintiirem {\expandafter\xint_secondoftwo_thenstop\romannumeral0\xintiidivision }% +\def\xintiQuo {\romannumeral0\xintiquo }% +\def\xintiRem {\romannumeral0\xintirem }% +\def\xintiquo {\expandafter\xint_firstoftwo_thenstop\romannumeral0\xintidivision }% +\def\xintirem {\expandafter\xint_secondoftwo_thenstop\romannumeral0\xintidivision }% +\let\xintQuo\xintiQuo\let\xintquo\xintiquo % deprecated (1.1) +\let\xintRem\xintiRem\let\xintrem\xintirem % deprecated (1.1) +\def\xintiDivision {\romannumeral0\xintidivision }% +\def\xintidivision #1{\expandafter\XINT_division\romannumeral0\xintnum{#1}\Z }% +\let\xintDivision\xintiDivision \let\xintdivision\xintidivision % deprecated +\def\XINT_division #1#2\Z #3{\expandafter\XINT_iidivision_a\expandafter #1% + \romannumeral0\xintnum{#3}\Z #2\Z }% +\def\xintiiDivision {\romannumeral0\xintiidivision }% +\def\xintiidivision #1{\expandafter\XINT_iidivision \romannumeral-`0#1\Z }% +\def\XINT_iidivision #1#2\Z #3{\expandafter\XINT_iidivision_a\expandafter #1% + \romannumeral-`0#3\Z #2\Z }% +\def\XINT_iidivision_a #1#2% #1 de A, #2 de B. +{% + \if0#2\xint_dothis\XINT_iidivision_divbyzero\fi + \if0#1\xint_dothis\XINT_iidivision_aiszero\fi + \if-#2\xint_dothis{\expandafter\XINT_iidivision_bneg + \romannumeral0\XINT_iidivision_bpos #1}\fi + \xint_orthat{\XINT_iidivision_bpos #1#2}% +}% +\def\XINT_iidivision_divbyzero #1\Z #2\Z {\xintError:DivisionByZero\space {0}{0}}% +\def\XINT_iidivision_aiszero #1\Z #2\Z { {0}{0}}% +\def\XINT_iidivision_bneg #1% q->-q, r unchanged + {\expandafter\space\expandafter{\romannumeral0\XINT_opp #1}}% +\def\XINT_iidivision_bpos #1% +{% + \xint_UDsignfork + #1\XINT_iidivision_aneg + -{\XINT_iidivision_apos #1}% + \krof +}% +\def\XINT_iidivision_apos #1#2\Z #3\Z{\XINT_div_prepare {#2}{#1#3}}% +\def\XINT_iidivision_aneg #1\Z #2\Z + {\expandafter + \XINT_iidivision_aneg_b\romannumeral0\XINT_div_prepare {#1}{#2}{#1}}% +\def\XINT_iidivision_aneg_b #1#2{\if0\XINT_Sgn #2\Z + \expandafter\XINT_iidivision_aneg_rzero + \else + \expandafter\XINT_iidivision_aneg_rpos + \fi {#1}{#2}}% +\def\XINT_iidivision_aneg_rzero #1#2#3{ {-#1}{0}}% necessarily q was >0 +\def\XINT_iidivision_aneg_rpos #1% +{% + \expandafter\XINT_iidivision_aneg_end\expandafter + {\expandafter-\romannumeral0\xintinc {#1}}% q-> -(1+q) +}% +\def\XINT_iidivision_aneg_end #1#2#3% +{% + \expandafter\xint_exchangetwo_keepbraces_thenstop + \expandafter{\romannumeral0\XINT_sub_pre {#3}{#2}}{#1}% r-> b-r +}% +\def\XINT_div_prepare #1% +{% + \expandafter \XINT_div_prepareB_aa \expandafter + {\romannumeral0\xintlength {#1}}{#1}% B > 0 ici +}% +\def\XINT_div_prepareB_aa #1% +{% + \ifnum #1=\xint_c_i + \expandafter\XINT_div_prepareB_onedigit + \else + \expandafter\XINT_div_prepareB_a + \fi + {#1}% +}% +\def\XINT_div_prepareB_a #1% +{% + \expandafter\XINT_div_prepareB_c\expandafter + {\the\numexpr \xint_c_iv*((#1+\xint_c_i)/\xint_c_iv)}{#1}% +}% +\def\XINT_div_prepareB_onedigit #1#2% +{% + \ifcase#2 + \or\expandafter\XINT_div_BisOne + \or\expandafter\XINT_div_BisTwo + \else\expandafter\XINT_div_prepareB_e + \fi {000}{0}{4}{#2}% +}% +\def\XINT_div_BisOne #1#2#3#4#5{ {#5}{0}}% +\def\XINT_div_BisTwo #1#2#3#4#5% +{% + \expandafter\expandafter\expandafter\XINT_div_BisTwo_a + \ifodd\xintiiLDg{#5} \expandafter1\else \expandafter0\fi {#5}% +}% +\edef\XINT_div_BisTwo_a #1#2% +{% + \noexpand\expandafter\space\noexpand\expandafter + {\noexpand\romannumeral0\noexpand\xinthalf {#2}}{#1}% +}% +\def\XINT_div_prepareB_c #1#2% +{% + \csname XINT_div_prepareB_d\romannumeral\numexpr#1-#2\endcsname + {#1}% +}% +\def\XINT_div_prepareB_d {\XINT_div_prepareB_e {}{0000}}% +\def\XINT_div_prepareB_di {\XINT_div_prepareB_e {0}{000}}% +\def\XINT_div_prepareB_dii {\XINT_div_prepareB_e {00}{00}}% +\def\XINT_div_prepareB_diii {\XINT_div_prepareB_e {000}{0}}% +\def\XINT_div_cleanR #10000.{{#1}}% +\def\XINT_div_prepareB_e #1#2#3#4% +{% + \ifnum#3=\xint_c_iv\expandafter\XINT_div_prepareLittleB_f + \else\expandafter\XINT_div_prepareB_f + \fi + #4#1{#3}{#2}{#1}% +}% +\def\XINT_div_prepareB_f #1#2#3#4#5#{% + \expandafter\XINT_div_prepareB_g + \the\numexpr #1#2#3#4+\xint_c_i\expandafter + .\the\numexpr (#1#2#3#4+\xint_c_i)/\xint_c_ii\expandafter + .\romannumeral0\xintreverseorder {#1#2#3#4#5}.{#1#2#3#4}% +}% +\def\XINT_div_prepareLittleB_f #1#{% + \expandafter\XINT_div_prepareB_g \the\numexpr #1/\xint_c_ii.{}.{}.{#1}% +}% +\def\XINT_div_prepareB_g #1.#2.#3.#4#5#6#7#8% +{% + \XINT_div_prepareA_a {#8#7}{#5}{{#1}{#2}{#4}}{#3}{#6}% +}% +\def\XINT_div_prepareA_a #1% +{% + \expandafter\XINT_div_prepareA_b\expandafter + {\romannumeral0\xintlength {#1}}{#1}% +}% +\def\XINT_div_prepareA_b #1% +{% + \expandafter\XINT_div_prepareA_c\expandafter + {\the\numexpr \xint_c_iv*((#1+\xint_c_i)/\xint_c_iv)}{#1}% +}% +\def\XINT_div_prepareA_c #1#2% +{% + \csname XINT_div_prepareA_d\romannumeral\numexpr #1-#2\endcsname + {#1}% +}% +\def\XINT_div_prepareA_d {\XINT_div_prepareA_e {}}% +\def\XINT_div_prepareA_di {\XINT_div_prepareA_e {0}}% +\def\XINT_div_prepareA_dii {\XINT_div_prepareA_e {00}}% +\def\XINT_div_prepareA_diii {\XINT_div_prepareA_e {000}}% +\def\XINT_div_prepareA_e #1#2#3#4#5% +{% + \XINT_div_start_a {#2}{#4}{#1#3}#5% +}% +\def\XINT_div_start_a #1#2% +{% + \ifnum #2=\xint_c_iv \expandafter\XINT_div_little_b + \else + \ifnum #1 < #2 + \expandafter\expandafter\expandafter\XINT_div_III_aa + \else + \expandafter\expandafter\expandafter\XINT_div_start_b + \fi + \fi + {#1}{#2}% +}% +\def\XINT_div_III_aa #1#2#3#4#5#6#7% +{% + \expandafter\expandafter\expandafter + \XINT_div_III_b\xint_cleanupzeros_nostop #3.{0000}% +}% +\def\XINT_div_III_b #1% +{% + \if0#1% + \expandafter\XINT_div_III_bRzero + \else + \expandafter\XINT_div_III_bRpos + \fi + #1% +}% +\def\XINT_div_III_bRzero 0.#1#2% +{% + \expandafter\space\expandafter + {\romannumeral0\XINT_cuz_loop #1\W\W\W\W\W\W\W\Z}{0}% +}% +\def\XINT_div_III_bRpos #1.#2#3% +{% + \expandafter\XINT_div_III_c \XINT_div_cleanR #1#3.{#2}% +}% +\def\XINT_div_III_c #1#2% +{% + \expandafter\space\expandafter + {\romannumeral0\XINT_cuz_loop #2\W\W\W\W\W\W\W\Z}{#1}% +}% +\def\XINT_div_start_b #1#2#3#4#5#6% +{% + \XINT_div_start_c {#2}.#3.{#6}{{#1}{#2}{{#4}{#5}}{#6}}% +}% +\def\XINT_div_start_c #1#2.#3#4#5#6% +{% + \ifnum #1=\xint_c_iv\XINT_div_start_ca\fi + \expandafter\XINT_div_start_c\expandafter + {\the\numexpr #1-\xint_c_iv}#2#3#4#5#6.% +}% +\def\XINT_div_start_ca\fi\expandafter\XINT_div_start_c\expandafter + #1#2#3#4#5{\fi\XINT_div_start_d {#2#3#4#5}#2#3#4#5}% +\def\XINT_div_start_d #1#2.#3.#4#5#6% +{% + \XINT_div_I_a {#1}{#4}{#2}{#6}{0000}#5{#3}{#6}{}% +}% +\def\XINT_div_I_a #1#2% +{% + \expandafter\XINT_div_I_b\the\numexpr #1/#2.{#1}{#2}% +}% +\def\XINT_div_I_b #1% +{% + \xint_gob_til_zero #1\XINT_div_I_czero 0\XINT_div_I_c #1% +}% +\def\XINT_div_I_czero 0% + \XINT_div_I_c 0.#1#2#3#4#5{\XINT_div_I_g {#5}{#3}}% +\def\XINT_div_I_c #1.#2#3% +{% + \expandafter\XINT_div_I_da\the\numexpr #2-#1*#3.#1.% +}% +\def\XINT_div_I_da #1.% +{% + \ifnum #1>\xint_c_ix + \expandafter\XINT_div_I_dP + \else + \ifnum #1<\xint_c_ + \expandafter\expandafter\expandafter\XINT_div_I_dN + \else + \expandafter\expandafter\expandafter\XINT_div_I_db + \fi + \fi +}% +\def\XINT_div_I_dN #1.% +{% + \expandafter\XINT_div_I_dP\the\numexpr #1-\xint_c_i.% +}% +\def\XINT_div_I_db #1.#2#3% #1=q=un chiffre, #2=alpha, #3=B +{% + \expandafter\XINT_div_I_dc\expandafter + {\romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter + {\romannumeral0\xintreverseorder{#2}}% + {\romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z }}% + #1{#2}{#3}% +}% +\def\XINT_div_I_dc #1#2% +{% + \if-#1% s'arranger pour que si n\'egatif on ait renvoy\'e alpha=-. + \expandafter\xint_firstoftwo + \else\expandafter\xint_secondoftwo\fi + {\expandafter\XINT_div_I_dP\the\numexpr #2-\xint_c_i.}% + {\XINT_div_I_e {#1}#2}% +}% +\def\XINT_div_I_e #1#2#3#4#5% +{% + \expandafter\XINT_div_I_f \the\numexpr \xint_c_x^iv+#2+#5{#1}% +}% +\def\XINT_div_I_dP #1.#2#3#4% +{% + \expandafter \XINT_div_I_f \the\numexpr \xint_c_x^iv+#1+#4\expandafter + {\romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter + {\romannumeral0\xintreverseorder{#2}}% + {\romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z }}% +}% +\def\XINT_div_I_f 1#1#2#3#4{\XINT_div_I_g {#1#2#3#4}}% +\def\XINT_div_I_g #1#2#3#4#5#6#7#8#9% +{% + \ifnum#3=#4 + \expandafter\XINT_div_III_ab + \else + \expandafter\XINT_div_I_h + \fi + {#5}#2.#7.{{#5}{#6}{#4}{#3}}{#8}{#9#1}% +}% +\def\XINT_div_III_ab #1#2.#3.#4#5% +{% + \expandafter\XINT_div_III_b + \romannumeral0\XINT_cuz_loop #2#3\W\W\W\W\W\W\W\Z.% +}% +\def\XINT_div_I_h #1.#2#3#4#5#6.#7#8% +{% + \XINT_div_II_b #1#2#3#4#5.{#8}{#7}{#6}{#8}% +}% +\def\XINT_div_II_b #1#2#3#4#5#6#7#8#9% +{% + \xint_gob_til_zeros_iv #2#3#4#5\XINT_div_II_skipc 0000% + \XINT_div_II_c #1{#2#3#4#5}{#6#7#8#9}% +}% +\def\XINT_div_II_skipc 0000\XINT_div_II_c #1#2#3#4#5.#6#7% +{% + \XINT_div_II_k #7{#4#5}{#6}{0000}% +}% +\def\XINT_div_II_c #1#2#3#4% +{% + \expandafter\XINT_div_II_d\the\numexpr (#3#4+#2)/#1+\xint_c_ixixixix\relax + {#1}{#2}#3#4% +}% +\def\XINT_div_II_d 1#1#2#3#4#5#6#7.#8% +{% + \expandafter\XINT_div_II_e + \romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter + {\romannumeral0\xintreverseorder{#7}}% + {\romannumeral0\XINT_mul_Mr {#1#2#3#4}#8\Z\Z\Z\Z }.% + {#5}{#6}{#8}{#1#2#3#4}% +}% +\def\XINT_div_II_e #1#2#3#4% +{% + \xint_gob_til_zeros_iv #1#2#3#4\XINT_div_II_skipf 0000% + \XINT_div_II_f #1#2#3#4% +}% +\def\XINT_div_II_skipf 0000\XINT_div_II_f 0000#1.#2#3#4#5#6% +{% + \XINT_div_II_k #6{#1}{#4}{#5}% +}% +\def\XINT_div_II_f #1#2#3#4#5#6#7#8#9.% +{% + \XINT_div_II_fa {#1#2#3#4#5#6#7#8}{#1#2#3#4#5#6#7#8#9}% +}% +\def\XINT_div_II_fa #1#2#3#4% +{% + \expandafter\XINT_div_II_g\expandafter + {\the\numexpr (#1+#4)/#3-\xint_c_i}{#2}% +}% +\def\XINT_div_II_g #1#2#3#4% +{% + \expandafter \XINT_div_II_h + \the\numexpr #4+#1+\xint_c_x^iv\expandafter\expandafter\expandafter + {\expandafter\xint_gobble_iv + \romannumeral0\expandafter\XINT_div_sub_xpxp\expandafter + {\romannumeral0\xintreverseorder{#2}}% + {\romannumeral0\XINT_mul_Mr {#1}#3\Z\Z\Z\Z }}{#3}% +}% +\def\XINT_div_II_h 1#1#2#3#4#5#6#7% +{% + \XINT_div_II_k #7{#5}{#6}{#1#2#3#4}% +}% +\def\XINT_div_II_k #1#2#3#4#5% +{% + \expandafter\XINT_div_II_l \the\numexpr #4-\xint_c_iv.{#3}#1{#2}#5.% +}% +\def\XINT_div_II_l #1.#2#3#4#5#6#7#8#9% +{% + \XINT_div_II_m {{#1}{#2}{{#3}{#4}}{#5}}{#5}{#6#7#8#9}#6#7#8#9% +}% +\def\XINT_div_II_m #1#2#3#4.#5#6% +{% + \XINT_div_I_a {#3}{#2}{#4}{#5}{#6}#1% +}% +\def\XINT_div_little_b #1#2#3#4#5#6#7% +{% + \XINT_div_little_c #3.{{#4}{#6}}{#1}% +}% +\def\XINT_div_little_c #1#2#3#4#5.#6#7% +{% + \XINT_div_littleI_a {#1#2#3#4}#6{#7}{#5}% +}% +\def\XINT_div_littleI_a #1#2#3% +{% + \expandafter\XINT_div_littleI_b + \the\numexpr (#1+#2)/#3-\xint_c_i{#1}{#2}{#3}% +}% +\def\XINT_div_littleI_b #1% +{% + \xint_gob_til_zero #1\XINT_div_littleI_skip 0\XINT_div_littleI_c #1% +}% +\def\XINT_div_littleI_skip 0\XINT_div_littleI_c 0#1#2#3#4#5% + {\XINT_div_littleII_a {#4}{#1}#5.{{#2}{#3}}{0000}}% +\def\XINT_div_littleI_c #1#2#3#4% +{% + \expandafter\expandafter\expandafter\XINT_div_littleI_e + \expandafter\expandafter\expandafter + {\expandafter\xint_gobble_i\the\numexpr \xint_c_x^iv+#2-#1*#4}#1{{#3}{#4}}% +}% +\def\XINT_div_littleI_e #1#2#3#4#5% + {\XINT_div_littleII_a {#4}{#1}#5.{#3}{000#2}}% +\def\XINT_div_littleII_a #1% +{% + \ifnum#1=\xint_c_iv + \expandafter\XINT_div_littleIII_ab + \else + \expandafter\XINT_div_littleII_b + \fi {#1}% +}% +\def\XINT_div_littleIII_ab #1#2#3.#4% +{% + \expandafter\XINT_div_III_b\the\numexpr #2#3.% +}% +\def\XINT_div_littleII_b #1% +{% + \expandafter\XINT_div_littleII_c\expandafter {\the\numexpr #1-\xint_c_iv}% +}% +\def\XINT_div_littleII_c #1#2#3#4#5#6#7.#8% +{% + \XINT_div_littleII_d {#2#3#4#5#6}#8{#1}{#7}% +}% +\def\XINT_div_littleII_d #1#2#3% +{% + \expandafter\XINT_div_littleII_e\the\numexpr (#1+#2)/#3+\xint_c_ixixixix.% + {#1}{#2}{#3}% +}% +\def\XINT_div_littleII_e 1#1.#2#3#4% +{% + \expandafter\expandafter\expandafter\XINT_div_littleII_f + \expandafter\xint_gobble_i\the\numexpr \xint_c_x^iv+#2-#1*#4.% + {#1}{{#3}{#4}}% +}% +\def\XINT_div_littleII_f #1.#2#3#4#5#6% +{% + \XINT_div_littleII_a {#4}{#1}#5.{#3}{#6#2}% +}% +\def\XINT_div_sub_xpxp #1#2% #1=alpha d\'ej\`a renvers\'e, #2 se d\'eveloppe en qB +{% + \expandafter\XINT_div_sub_xpxp_b #2\W\X\Y\Z #1\W\X\Y\Z +}% +\def\XINT_div_sub_xpxp_b +{% + \XINT_div_sub_A 1{}% +}% +\def\XINT_div_sub_A #1#2#3#4#5#6% +{% + \xint_gob_til_W #3\xint_div_sub_az\W + \XINT_div_sub_B #1{#3#4#5#6}{#2}% +}% +\def\XINT_div_sub_B #1#2#3#4\W\X\Y\Z #5#6#7#8% +{% + \xint_gob_til_W #5\xint_div_sub_bz\W + \XINT_div_sub_onestep #1#2{#8#7#6#5}{#3}#4\W\X\Y\Z +}% +\def\XINT_div_sub_onestep #1#2#3#4#5#6% +{% + \expandafter\XINT_div_sub_backtoA + \the\numexpr 11#6-#5#4#3#2+#1-\xint_c_i.% +}% +\def\XINT_div_sub_backtoA #1#2#3.#4% +{% + \XINT_div_sub_A #2{#3#4}% +}% +\def\xint_div_sub_bz\W\XINT_div_sub_onestep #1\Z { -}% +\def\xint_div_sub_az\W\XINT_div_sub_B #1#2{\XINT_div_sub_C #1}% +\def\XINT_div_sub_C #1#2#3#4#5#6% +{% + \xint_gob_til_W #3\xint_div_sub_cz\W + \XINT_div_sub_C_onestep #1{#6#5#4#3}{#2}% +}% +\def\XINT_div_sub_C_onestep #1#2% +{% + \expandafter\XINT_div_sub_backtoC \the\numexpr 11#2+#1-\xint_c_i.% +}% +\def\XINT_div_sub_backtoC #1#2#3.#4% +{% + \XINT_div_sub_C #2{#3#4}% +}% +\def\xint_div_sub_cz\W\XINT_div_sub_C_onestep #1#2% +{% + \if#10% retenue + \expandafter\xint_div_sub_neg + \else\expandafter\xint_div_sub_ok + \fi +}% +\def\xint_div_sub_neg #1{ -}% +\def\xint_div_sub_ok #1{ #1}% +\def\xintiDivRound {\romannumeral0\xintidivround }% +\def\xintidivround #1{\expandafter\XINT_iidivround\romannumeral0\xintnum{#1}\Z }% +\def\xintiiDivRound {\romannumeral0\xintiidivround }% +\def\xintiidivround #1{\expandafter\XINT_iidivround \romannumeral-`0#1\Z }% +\def\XINT_iidivround #1#2\Z #3{\expandafter\XINT_iidivround_a\expandafter #1% + \romannumeral-`0#3\Z #2\Z }% +\def\XINT_iidivround_a #1#2% #1 de A, #2 de B. +{% + \if0#2\xint_dothis\XINT_iidivround_divbyzero\fi + \if0#1\xint_dothis\XINT_iidivround_aiszero\fi + \if-#2\xint_dothis{\XINT_iidivround_bneg #1}\fi + \xint_orthat{\XINT_iidivround_bpos #1#2}% +}% +\def\XINT_iidivround_divbyzero #1\Z #2\Z {\xintError:DivisionByZero\space 0}% +\def\XINT_iidivround_aiszero #1\Z #2\Z { 0}% +\def\XINT_iidivround_bpos #1% +{% + \xint_UDsignfork + #1{\xintiiopp\XINT_iidivround_pos {}}% + -{\XINT_iidivround_pos #1}% + \krof +}% +\def\XINT_iidivround_bneg #1% +{% + \xint_UDsignfork + #1{\XINT_iidivround_pos {}}% + -{\xintiiopp\XINT_iidivround_pos #1}% + \krof +}% +\def\XINT_iidivround_pos #1#2\Z #3\Z{\expandafter\XINT_iidivround_pos_a + \romannumeral0\XINT_div_prepare {#2}{#1#30}}% +\def\XINT_iidivround_pos_a #1#2{\xintReverseOrder {#1\XINT_iidivround_pos_b}\Z }% +\def\XINT_iidivround_pos_b #1#2{\xint_gob_til_Z #2\XINT_iidivround_pos_small\Z + \XINT_iidivround_pos_c #1#2}% +\def\XINT_iidivround_pos_c #1#2\Z {\ifnum #1>\xint_c_iv + \expandafter\XINT_iidivround_pos_up + \else \expandafter\xintreverseorder + \fi {#2}}% +\def\XINT_iidivround_pos_up #1{\xintinc {\xintReverseOrder{#1}}}% +\def\XINT_iidivround_pos_small\Z\XINT_iidivround_pos_c #1#2% + {\ifnum #1>\xint_c_iv\expandafter\xint_secondoftwo\else\expandafter + \xint_firstoftwo\fi { 0}{ 1}}% +\def\xintiDivTrunc {\romannumeral0\xintidivtrunc }% +\def\xintidivtrunc #1{\expandafter\XINT_iidivtrunc\romannumeral0\xintnum{#1}\Z }% +\def\xintiiDivTrunc {\romannumeral0\xintiidivtrunc }% +\def\xintiidivtrunc #1{\expandafter\XINT_iidivtrunc \romannumeral-`0#1\Z }% +\def\XINT_iidivtrunc #1#2\Z #3{\expandafter\XINT_iidivtrunc_a\expandafter #1% + \romannumeral-`0#3\Z #2\Z }% +\def\XINT_iidivtrunc_a #1#2% #1 de A, #2 de B. +{% + \if0#2\xint_dothis\XINT_iidivround_divbyzero\fi + \if0#1\xint_dothis\XINT_iidivround_aiszero\fi + \if-#2\xint_dothis{\XINT_iidivtrunc_bneg #1}\fi + \xint_orthat{\XINT_iidivtrunc_bpos #1#2}% +}% +\def\XINT_iidivtrunc_bpos #1% +{% + \xint_UDsignfork + #1{\xintiiopp\XINT_iidivtrunc_pos {}}% + -{\XINT_iidivtrunc_pos #1}% + \krof +}% +\def\XINT_iidivtrunc_bneg #1% +{% + \xint_UDsignfork + #1{\XINT_iidivtrunc_pos {}}% + -{\xintiiopp\XINT_iidivtrunc_pos #1}% + \krof +}% +\def\XINT_iidivtrunc_pos #1#2\Z #3\Z% + {\expandafter\xint_firstoftwo_thenstop\romannumeral0\XINT_div_prepare {#2}{#1#3}}% +\def\xintiMod {\romannumeral0\xintimod }% +\def\xintimod #1{\expandafter\XINT_iimod\romannumeral0\xintnum{#1}\Z }% +\def\xintiiMod {\romannumeral0\xintiimod }% +\def\xintiimod #1{\expandafter\XINT_iimod \romannumeral-`0#1\Z }% +\def\XINT_iimod #1#2\Z #3{\expandafter\XINT_iimod_a\expandafter #1% + \romannumeral-`0#3\Z #2\Z }% +\def\XINT_iimod_a #1#2% #1 de A, #2 de B. +{% + \if0#2\xint_dothis\XINT_iidivround_divbyzero\fi + \if0#1\xint_dothis\XINT_iidivround_aiszero\fi + \if-#2\xint_dothis{\XINT_iimod_bneg #1}\fi + \xint_orthat{\XINT_iimod_bpos #1#2}% +}% +\def\XINT_iimod_bpos #1% +{% + \xint_UDsignfork + #1{\xintiiopp\XINT_iimod_pos {}}% + -{\XINT_iimod_pos #1}% + \krof +}% +\def\XINT_iimod_bneg #1% +{% + \xint_UDsignfork + #1{\xintiiopp\XINT_iimod_pos {}}% + -{\XINT_iimod_pos #1}% + \krof +}% +\def\XINT_iimod_pos #1#2\Z #3\Z% + {\expandafter\xint_secondoftwo_thenstop\romannumeral0\XINT_div_prepare {#2}{#1#3}}% +\def\xintDec {\romannumeral0\xintdec }% +\def\xintdec #1% +{% + \expandafter\XINT_dec\romannumeral-`0#1% + \R\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W\W +}% +\def\XINT_dec #1% +{% + \xint_UDzerominusfork + #1-\XINT_dec_zero + 0#1\XINT_dec_neg + 0-{\XINT_dec_pos #1}% + \krof +}% +\def\XINT_dec_zero #1\W\W\W\W\W\W\W\W { -1}% +\def\XINT_dec_neg + {\expandafter\xint_minus_thenstop\romannumeral0\XINT_inc_pos }% +\def\XINT_dec_pos +{% + \expandafter\XINT_dec_a \expandafter{\expandafter}% + \romannumeral0\XINT_OQ {}% +}% +\def\XINT_dec_a #1#2#3#4#5#6#7#8#9% +{% + \expandafter\XINT_dec_b + \the\numexpr 11#9#8#7#6#5#4#3#2-\xint_c_i\relax {#1}% +}% +\def\XINT_dec_b 1#1% +{% + \xint_gob_til_one #1\XINT_dec_A 1\XINT_dec_c +}% +\def\XINT_dec_c #1#2#3#4#5#6#7#8#9{\XINT_dec_a {#1#2#3#4#5#6#7#8#9}}% +\def\XINT_dec_A 1\XINT_dec_c #1#2#3#4#5#6#7#8#9% + {\XINT_dec_B {#1#2#3#4#5#6#7#8#9}}% +\def\XINT_dec_B #1#2\W\W\W\W\W\W\W\W +{% + \expandafter\XINT_dec_cleanup + \romannumeral0\XINT_rord_main {}#2% + \xint_relax + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_relax + #1% +}% +\edef\XINT_dec_cleanup #1#2#3#4#5#6#7#8% + {\noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4#5#6#7#8\relax }% +\def\xintInc {\romannumeral0\xintinc }% +\def\xintinc #1% +{% + \expandafter\XINT_inc\romannumeral-`0#1% + \R\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W\W +}% +\def\XINT_inc #1% +{% + \xint_UDzerominusfork + #1-\XINT_inc_zero + 0#1\XINT_inc_neg + 0-{\XINT_inc_pos #1}% + \krof +}% +\def\XINT_inc_zero #1\W\W\W\W\W\W\W\W { 1}% +\def\XINT_inc_neg {\expandafter\XINT_opp\romannumeral0\XINT_dec_pos }% +\def\XINT_inc_pos +{% + \expandafter\XINT_inc_a \expandafter{\expandafter}% + \romannumeral0\XINT_OQ {}% +}% +\def\XINT_inc_a #1#2#3#4#5#6#7#8#9% +{% + \xint_gob_til_W #9\XINT_inc_end\W + \expandafter\XINT_inc_b + \the\numexpr 10#9#8#7#6#5#4#3#2+\xint_c_i\relax {#1}% +}% +\def\XINT_inc_b 1#1% +{% + \xint_gob_til_zero #1\XINT_inc_A 0\XINT_inc_c +}% +\def\XINT_inc_c #1#2#3#4#5#6#7#8#9{\XINT_inc_a {#1#2#3#4#5#6#7#8#9}}% +\def\XINT_inc_A 0\XINT_inc_c #1#2#3#4#5#6#7#8#9% + {\XINT_dec_B {#1#2#3#4#5#6#7#8#9}}% +\def\XINT_inc_end\W #1\relax #2{ 1#2}% +\XINT_restorecatcodes_endinput% +\endinput +%% +%% End of file `xintcore.sty'. diff --git a/Master/texmf-dist/tex/generic/xint/xintexpr.sty b/Master/texmf-dist/tex/generic/xint/xintexpr.sty index 3f60831f485..a73c5736307 100644 --- a/Master/texmf-dist/tex/generic/xint/xintexpr.sty +++ b/Master/texmf-dist/tex/generic/xint/xintexpr.sty @@ -20,11 +20,11 @@ %% original source files, as listed above, are part of the %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) -%%---------------------------------------------------------------- -%% The xint bundle (version 1.09n of April 1st, 2014) -%% xintexpr: Expandable expression parser +%% --------------------------------------------------------------- +%% The xint bundle v1.1 (2014/10/28) %% Copyright (C) 2013-2014 by Jean-Francois Burnol -%%---------------------------------------------------------------- +%% xintexpr: Expandable expression parser +%% --------------------------------------------------------------- \begingroup\catcode61\catcode48\catcode32=10\relax% \catcode13=5 % ^^M \endlinechar=13 % @@ -36,10 +36,10 @@ \catcode45=12 % - \catcode46=12 % . \catcode58=12 % : - \def\space { }% - \let\z\endgroup + \def\z {\endgroup}% \expandafter\let\expandafter\x\csname ver@xintexpr.sty\endcsname \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname + \expandafter\let\expandafter\t\csname ver@xinttools.sty\endcsname \expandafter \ifx\csname PackageInfo\endcsname\relax \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% @@ -53,287 +53,349 @@ \else \ifx\x\relax % plain-TeX, first loading of xintexpr.sty \ifx\w\relax % but xintfrac.sty not yet loaded. - \y{xintexpr}{now issuing \string\input\space xintfrac.sty}% - \def\z{\endgroup\input xintfrac.sty\relax}% + \expandafter\def\expandafter\z\expandafter + {\z\input xintfrac.sty\relax}% + \fi + \ifx\t\relax % but xinttools.sty not yet loaded. + \expandafter\def\expandafter\z\expandafter + {\z\input xinttools.sty\relax}% \fi \else \def\empty {}% \ifx\x\empty % LaTeX, first loading, % variable is initialized, but \ProvidesPackage not yet seen \ifx\w\relax % xintfrac.sty not yet loaded. - \y{xintexpr}{now issuing \string\RequirePackage{xintfrac}}% - \def\z{\endgroup\RequirePackage{xintfrac}}% + \expandafter\def\expandafter\z\expandafter + {\z\RequirePackage{xintfrac}}% + \fi + \ifx\t\relax % xinttools.sty not yet loaded. + \expandafter\def\expandafter\z\expandafter + {\z\RequirePackage{xinttools}}% \fi \else - \y{xintexpr}{I was already loaded, aborting input}% - \aftergroup\endinput + \aftergroup\endinput % xintexpr already loaded. \fi \fi \fi \z% -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode123=1 % { - \catcode125=2 % } - \catcode64=11 % @ - \catcode35=6 % # - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode58=12 % : - \ifdefined\PackageInfo - \def\y#1#2{\PackageInfo{#1}{#2}}% - \else - \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% - \fi - \def\empty {}% - \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname - \ifx\w\relax % Plain TeX, user gave a file name at the prompt - \y{xintexpr}{Loading of package xintfrac failed, aborting input}% - \aftergroup\endinput - \fi - \ifx\w\empty % LaTeX, user gave a file name at the prompt - \y{xintexpr}{Loading of package xintfrac failed, aborting input}% - \aftergroup\endinput - \fi -\endgroup% \XINTsetupcatcodes% \XINT_providespackage \ProvidesPackage{xintexpr}% - [2014/04/01 v1.09n Expandable expression parser (jfB)]% -\def\xint_gob_til_! #1!{}% nota bene: this ! has catcode 11 -\expandafter\def\expandafter -\XINT_expr_lock\expandafter#\expandafter1\expandafter !\expandafter - {\expandafter\expandafter\space\csname .=#1\endcsname }% + [2014/10/28 v1.1 Expandable expression parser (jfB)]% +\def\xint_gob_til_! #1!{}% this ! has catcode 11 +\edef\XINT_expr_lockscan#1!{\noexpand\expandafter\space\noexpand\csname .=#1\endcsname }% +\edef\XINT_expr_lockit #1{\noexpand\expandafter\space\noexpand\csname .=#1\endcsname }% +\def\XINT_expr_inintpart #1!{\XINT_num{#1}}% +\def\XINT_expr_infracpart #1e#2!{#1![\the\numexpr#2-\xintLength{#1}]!}% +\def\XINT_expr_inexppart e#1!{![\the\numexpr #1]!}% \def\XINT_expr_unlock {\expandafter\XINT_expr_unlock_a\string }% \def\XINT_expr_unlock_a #1.={}% \def\XINT_expr_unexpectedtoken {\xintError:ignored }% -\def\XINT_newexpr_setprefix #1>{\noexpand\romannumeral-`0}% -\def\xint_UDxintrelaxfork #1\xint_relax #2#3\krof {#2}% -\def\xint_protect {\noexpand\xint_protect\noexpand }% 1.09j -\def\XINT_expr_done {!\XINT_expr_usethe\xint_protect\XINT_expr_print }% -\let\XINT_iiexpr_done \XINT_expr_done -\def\XINT_iexpr_done {!\XINT_expr_usethe\xint_protect\XINT_iexpr_print }% -\def\XINT_flexpr_done {!\XINT_expr_usethe\xint_protect\XINT_flexpr_print }% -\def\XINT_boolexpr_done {!\XINT_expr_usethe\xint_protect\XINT_boolexpr_print }% -\protected\def\XINT_expr_usethe #1#2#3% modified in 1.09j - {\xintError:missing_xintthe!\show#3missing xintthe (see log)!}% -\def\xintthe #1{\romannumeral-`0\expandafter\xint_gobble_iii\romannumeral-`0#1}% -\let\XINT_expr_print \XINT_expr_unlock -\def\XINT_iexpr_print #1{\xintRound:csv {\XINT_expr_unlock #1}}% -\def\XINT_flexpr_print #1{\xintFloat:csv {\XINT_expr_unlock #1}}% -\def\XINT_boolexpr_print #1{\xintIsTrue:csv{\XINT_expr_unlock #1}}% +\let\XINT_expr_done\space +\def\XINT_expr_wrap { !\XINT_expr_usethe\XINT_protectii\XINT_expr_print }% +\def\XINT_iiexpr_wrap { !\XINT_expr_usethe\XINT_protectii\XINT_iiexpr_print }% +\def\XINT_protectii #1{\noexpand\XINT_protectii\noexpand #1\noexpand }% +\protected\def\XINT_expr_usethe\XINT_protectii {\xintError:missing_xintthe!}% +\def\XINT_expr_print #1{\xintSPRaw::csv {\XINT_expr_unlock #1}}% +\def\XINT_iiexpr_print #1{\xintCSV::csv {\XINT_expr_unlock #1}}% +\def\XINT_boolexpr_print #1{\xintIsTrue::csv {\XINT_expr_unlock #1}}% \def\xintexpr {\romannumeral0\xinteval }% +\def\xintiexpr {\romannumeral0\xintieval }% \def\xintfloatexpr {\romannumeral0\xintfloateval }% \def\xintiiexpr {\romannumeral0\xintiieval }% -\def\xinteval - {\expandafter\XINT_expr_until_end_a \romannumeral-`0\XINT_expr_getnext }% -\def\xintfloateval - {\expandafter\XINT_flexpr_until_end_a\romannumeral-`0\XINT_expr_getnext }% -\def\xintiieval - {\expandafter\XINT_iiexpr_until_end_a\romannumeral-`0\XINT_expr_getnext }% \def\xinttheexpr - {\romannumeral-`0\expandafter\xint_gobble_iii\romannumeral0\xinteval }% -\def\xintthefloatexpr - {\romannumeral-`0\expandafter\xint_gobble_iii\romannumeral0\xintfloateval }% + {\romannumeral-`0\expandafter\XINT_expr_print\romannumeral0\xintbareeval }% +\def\xinttheiexpr {\romannumeral-`0\xintthe\xintiexpr }% +\def\xintthefloatexpr {\romannumeral-`0\xintthe\xintfloatexpr }% \def\xinttheiiexpr - {\romannumeral-`0\expandafter\xint_gobble_iii\romannumeral0\xintiieval }% -\def\xintiexpr {\romannumeral0\expandafter\expandafter\expandafter - \XINT_iexpr_done \expandafter\xint_gobble_iv\romannumeral0\xinteval }% -\def\xinttheiexpr {\romannumeral-`0\expandafter\expandafter\expandafter - \XINT_iexpr_print\expandafter\xint_gobble_iv\romannumeral0\xinteval }% -\def\xintboolexpr {\romannumeral0\expandafter\expandafter\expandafter - \XINT_boolexpr_done \expandafter\xint_gobble_iv\romannumeral0\xinteval }% -\def\xinttheboolexpr {\romannumeral-`0\expandafter\expandafter\expandafter - \XINT_boolexpr_print\expandafter\xint_gobble_iv\romannumeral0\xinteval }% -\let\xintnumexpr \xintiexpr % deprecated -\let\xintthenumexpr\xinttheiexpr % deprecated -\def\xintifboolexpr #1% - {\romannumeral0\xintifnotzero {\xinttheexpr #1\relax}}% -\def\xintifboolfloatexpr #1% - {\romannumeral0\xintifnotzero {\xintthefloatexpr #1\relax}}% -\def\xintifbooliiexpr #1% - {\romannumeral0\xintifnotzero {\xinttheiiexpr #1\relax}}% -\def\XINT_expr_getnext -{% - \expandafter\XINT_expr_getnext_checkforbraced_a - \romannumeral-`0\romannumeral-`0% + {\romannumeral-`0\expandafter\XINT_iiexpr_print\romannumeral0\xintbareiieval }% +\def\xintthe #1{\romannumeral-`0\expandafter\xint_gobble_iii\romannumeral-`0#1}% +\def\xintthecoords #1{\romannumeral-`0\expandafter\expandafter\expandafter + \XINT_thecoords_a + \expandafter\xint_gobble_iii\romannumeral0#1}% +\def\XINT_thecoords_a #1#2% #1=print macro, indispensible for scientific notation + {\expandafter\XINT_expr_unlock\csname.=\expandafter\XINT_thecoords_b + \romannumeral-`0#1#2,!,!,^\endcsname }% +\def\XINT_thecoords_b #1#2,#3#4,% + {\xint_gob_til_! #3\XINT_thecoords_c ! (#1#2, #3#4)\XINT_thecoords_b }% +\def\XINT_thecoords_c #1^{}% +\def\xintbareeval + {\expandafter\XINT_expr_until_end_a\romannumeral-`0\XINT_expr_getnext }% +\def\xintbarefloateval + {\expandafter\XINT_flexpr_until_end_a\romannumeral-`0\XINT_expr_getnext }% +\def\xintbareiieval + {\expandafter\XINT_iiexpr_until_end_a\romannumeral-`0\XINT_expr_getnext }% +\def\xinteval {\expandafter\XINT_expr_wrap\romannumeral0\xintbareeval }% +\def\xintiieval {\expandafter\XINT_iiexpr_wrap\romannumeral0\xintbareiieval }% +\def\xintieval #1% + {\ifx [#1\expandafter\XINT_iexpr_withopt\else\expandafter\XINT_iexpr_noopt \fi #1}% +\def\XINT_iexpr_noopt + {\expandafter\XINT_iexpr_wrap \expandafter 0\romannumeral0\xintbareeval }% +\def\XINT_iexpr_withopt [#1]% +{% + \expandafter\XINT_iexpr_wrap\expandafter + {\the\numexpr \xint_zapspaces #1 \xint_bye\xint_bye\expandafter}% + \romannumeral0\xintbareeval +}% +\def\XINT_iexpr_wrap #1#2% +{% + \expandafter\XINT_expr_wrap + \csname .=\xintRound::csv {#1}{\XINT_expr_unlock #2}\endcsname +}% +\def\xintfloateval #1% +{% + \ifx [#1\expandafter\XINT_flexpr_withopt_a\else\expandafter\XINT_flexpr_noopt + \fi #1% }% -\def\XINT_expr_getnext_checkforbraced_a #1% was done later in <1.09i +\def\XINT_flexpr_noopt {% - \expandafter\XINT_expr_getnext_checkforbraced_b\expandafter - {\romannumeral-`0#1}% + \expandafter\XINT_flexpr_withopt_b\expandafter\xinttheDigits + \romannumeral0\xintbarefloateval }% -\def\XINT_expr_getnext_checkforbraced_b #1% +\def\XINT_flexpr_withopt_a [#1]% {% - \XINT_expr_getnext_checkforbraced_c #1\xint_relax\Z {#1}% + \expandafter\XINT_flexpr_withopt_b\expandafter + {\the\numexpr\xint_zapspaces #1 \xint_bye\xint_bye\expandafter}% + \romannumeral0\xintbarefloateval }% -\def\XINT_expr_getnext_checkforbraced_c #1#2% +\def\XINT_flexpr_withopt_b #1#2% {% - \xint_UDxintrelaxfork - #1\XINT_expr_getnext_wasemptyorspace - #2\XINT_expr_getnext_gotonetoken_wehope - \xint_relax\XINT_expr_getnext_gotbracedstuff - \krof -}% doubly braced things are not acceptable, will cause errors. -\def\XINT_expr_getnext_wasemptyorspace #1{\XINT_expr_getnext }% -\def\XINT_expr_getnext_gotbracedstuff #1\xint_relax\Z #2% + \expandafter\XINT_flexpr_wrap\csname .;#1.=% ; and not : as before b'cause NewExpr + \XINTinFloat::csv {#1}{\XINT_expr_unlock #2}\endcsname +}% +\def\XINT_flexpr_wrap { !\XINT_expr_usethe\XINT_protectii\XINT_flexpr_print }% +\def\XINT_flexpr_print #1% {% - \expandafter\XINT_expr_getop\csname .=#2\endcsname + \expandafter\xintPFloat::csv + \romannumeral-`0\expandafter\XINT_expr_unlock_sp\string #1!% }% -\def\XINT_expr_getnext_gotonetoken_wehope\Z #1% +\catcode`: 12 + \def\XINT_expr_unlock_sp #1.;#2.=#3!{{#2}{#3}}% +\catcode`: 11 +\def\xintboolexpr {\romannumeral0\expandafter\expandafter\expandafter + \XINT_boolexpr_done \expandafter\xint_gobble_iv\romannumeral0\xinteval }% +\def\xinttheboolexpr {\romannumeral-`0\expandafter\expandafter\expandafter + \XINT_boolexpr_print\expandafter\xint_gobble_iv\romannumeral0\xinteval }% +\def\XINT_boolexpr_done { !\XINT_expr_usethe\XINT_protectii\XINT_boolexpr_print }% +\def\xintifboolexpr #1{\romannumeral0\xintifnotzero {\xinttheexpr #1\relax}}% +\def\xintifboolfloatexpr #1{\romannumeral0\xintifnotzero {\xintthefloatexpr #1\relax}}% +\def\xintifbooliiexpr #1{\romannumeral0\xintifnotzero {\xinttheiiexpr #1\relax}}% +\def\XINT_::_end #1,#2{\xint_gobble_i #2}% +\def\xintCSV::csv #1{\expandafter\XINT_csv::_a\romannumeral-`0#1,^,}% +\def\XINT_csv::_a {\XINT_csv::_b {}}% +\def\XINT_csv::_b #1#2,{\XINT_csv::_c #2,{#1}}% +\def\XINT_csv::_c #1{\if ^#1\expandafter\XINT_::_end\fi\XINT_csv::_d #1}% +\def\XINT_csv::_d #1,#2{\XINT_csv::_b {#2, #1}}% possibly, item #1 is empty. +\def\xintSPRaw {\romannumeral0\xintspraw }% +\def\xintspraw #1{\expandafter\XINT_spraw\romannumeral-`0#1[\W]}% +\def\XINT_spraw #1[#2#3]{\xint_gob_til_W #2\XINT_spraw_a\W\XINT_spraw_p #1[#2#3]}% +\def\XINT_spraw_a\W\XINT_spraw_p #1[\W]{ #1}% +\def\XINT_spraw_p #1[\W]{\xintpraw {#1}}% +\def\xintSPRaw::csv #1{\romannumeral0\expandafter\XINT_spraw::_a\romannumeral-`0#1,^,}% +\def\XINT_spraw::_a {\XINT_spraw::_b {}}% +\def\XINT_spraw::_b #1#2,{\XINT_spraw::_c #2,{#1}}% +\def\XINT_spraw::_c #1{\if ,#1\xint_dothis\XINT_spraw::_e\fi + \if ^#1\xint_dothis\XINT_::_end\fi + \xint_orthat\XINT_spraw::_d #1}% +\def\XINT_spraw::_d #1,{\expandafter\XINT_spraw::_e\romannumeral0\XINT_spraw #1[\W],}% +\def\XINT_spraw::_e #1,#2{\XINT_spraw::_b {#2, #1}}% +\def\xintIsTrue::csv #1{\romannumeral0\expandafter\XINT_istrue::_a\romannumeral-`0#1,^,}% +\def\XINT_istrue::_a {\XINT_istrue::_b {}}% +\def\XINT_istrue::_b #1#2,{\XINT_istrue::_c #2,{#1}}% +\def\XINT_istrue::_c #1{\if ,#1\xint_dothis\XINT_istrue::_e\fi + \if ^#1\xint_dothis\XINT_::_end\fi + \xint_orthat\XINT_istrue::_d #1}% +\def\XINT_istrue::_d #1,{\expandafter\XINT_istrue::_e\romannumeral0\xintisnotzero {#1},}% +\def\XINT_istrue::_e #1,#2{\XINT_istrue::_b {#2, #1}}% +\def\XINT_:::_end #1,#2#3{\xint_gobble_i #3}% +\def\xintRound::csv #1#2{\romannumeral0\expandafter\XINT_round::_b\expandafter + {\the\numexpr#1\expandafter}\expandafter{\expandafter}\romannumeral-`0#2,^,}% +\def\XINT_round::_b #1#2#3,{\XINT_round::_c #3,{#1}{#2}}% +\def\XINT_round::_c #1{\if ,#1\xint_dothis\XINT_round::_e\fi + \if ^#1\xint_dothis\XINT_:::_end\fi + \xint_orthat\XINT_round::_d #1}% +\def\XINT_round::_d #1,#2{% + \expandafter\XINT_round::_e\romannumeral0\ifnum#2>\xint_c_ + \expandafter\xintround\else\expandafter\xintiround\fi {#2}{#1},{#2}}% +\def\XINT_round::_e #1,#2#3{\XINT_round::_b {#2}{#3, #1}}% +\def\XINTinFloat::csv #1#2{\romannumeral0\expandafter\XINT_infloat::_b\expandafter + {\the\numexpr #1\expandafter}\expandafter{\expandafter}\romannumeral-`0#2,^,}% +\def\XINT_infloat::_b #1#2#3,{\XINT_infloat::_c #3,{#1}{#2}}% +\def\XINT_infloat::_c #1{\if ,#1\xint_dothis\XINT_infloat::_e\fi + \if ^#1\xint_dothis\XINT_:::_end\fi + \xint_orthat\XINT_infloat::_d #1}% +\def\XINT_infloat::_d #1,#2% + {\expandafter\XINT_infloat::_e\romannumeral0\XINTinfloat [#2]{#1},{#2}}% +\def\XINT_infloat::_e #1,#2#3{\XINT_infloat::_b {#2}{#3, #1}}% +\def\xintPFloat::csv #1#2{\romannumeral0\expandafter\XINT_pfloat::_b\expandafter + {\the\numexpr #1\expandafter}\expandafter{\expandafter}\romannumeral-`0#2,^,}% +\def\XINT_pfloat::_b #1#2#3,{\XINT_pfloat::_c #3,{#1}{#2}}% +\def\XINT_pfloat::_c #1{\if ,#1\xint_dothis\XINT_pfloat::_e\fi + \if ^#1\xint_dothis\XINT_:::_end\fi + \xint_orthat\XINT_pfloat::_d #1}% +\def\XINT_pfloat::_d #1,#2% + {\expandafter\XINT_pfloat::_e\romannumeral0\XINT_pfloat_opt [\xint_relax #2]{#1},{#2}}% +\def\XINT_pfloat::_e #1,#2#3{\XINT_pfloat::_b {#2}{#3, #1}}% +\def\XINT_expr_getnext #1% +{% + \expandafter\XINT_expr_getnext_a\romannumeral-`0#1% +}% +\def\XINT_expr_getnext_a #1% {% screens out sub-expressions and \count or \dimen registers/variables \xint_gob_til_! #1\XINT_expr_subexpr !% recall this ! has catcode 11 \ifcat\relax#1% \count or \numexpr etc... token or count, dimen, skip cs - \expandafter\XINT_expr_countdimenetc_fork + \expandafter\XINT_expr_countetc \else - \expandafter\expandafter\expandafter - \XINT_expr_getnext_onetoken_fork\expandafter\string + \expandafter\expandafter\expandafter\XINT_expr_getnextfork\expandafter\string \fi #1% }% \def\XINT_expr_subexpr !#1\fi !{\expandafter\XINT_expr_getop\xint_gobble_iii }% -\def\XINT_expr_countdimenetc_fork #1% +\def\XINT_expr_countetc #1% {% \ifx\count#1\else\ifx#1\dimen\else\ifx#1\numexpr\else\ifx#1\dimexpr\else - \ifx\skip#1\else\ifx\glueexpr#1\else - \XINT_expr_unpackvariable - \fi\fi\fi\fi\fi\fi + \ifx\skip#1\else\ifx\glueexpr#1\else\ifx\fontdimen#1\else + \XINT_expr_unpackvar + \fi\fi\fi\fi\fi\fi\fi \expandafter\XINT_expr_getnext\number #1% }% -\def\XINT_expr_unpackvariable\fi\fi\fi\fi\fi\fi\expandafter\XINT_expr_getnext - \number #1{\fi\fi\fi\fi\fi\fi - \expandafter\XINT_expr_getop\csname .=\number#1\endcsname }% +\def\XINT_expr_unpackvar\fi\fi\fi\fi\fi\fi\fi\expandafter\XINT_expr_getnext\number #1% + {\fi\fi\fi\fi\fi\fi\fi\expandafter\XINT_expr_getop\csname .=\number#1\endcsname }% \begingroup \lccode`*=`# \lowercase{\endgroup -\def\XINT_expr_sixwayfork #1(-.+*#2#3\krof {#2}% -\def\XINT_expr_getnext_onetoken_fork #1% -{% The * is in truth catcode 12 #. For (hacking) use with \xintNewExpr. - \XINT_expr_sixwayfork - #1-.+*{\xint_c_xviii ({}}% back to until for oparen triggering - (#1.+*{-}% - (-#1+*{\XINT_expr_scandec_II .}% - (-.#1*{\XINT_expr_getnext }% - (-.+#1{\XINT_expr_scandec_II }% - (-.+*{\XINT_expr_scan_dec_or_func #1}% - \krof +\def\XINT_expr_getnextfork #1{% + \if#1*\xint_dothis {\XINT_expr_scan_macropar *}\fi + \if#1[\xint_dothis {\xint_c_xviii ({}}\fi + \if#1+\xint_dothis \XINT_expr_getnext \fi + \if#1.\xint_dothis {\XINT_expr_scandec_II\XINT_expr_infracpart}\fi + \if#1-\xint_dothis -\fi + \if#1(\xint_dothis {\xint_c_xviii ({}}\fi + \xint_orthat {\XINT_expr_scan_nbr_or_func #1}% }}% -\def\XINT_expr_scan_dec_or_func #1% this #1 has necessarily here catcode 12 +\def\XINT_expr_scan_macropar #1#2{\expandafter\XINT_expr_getop\csname .=#1#2\endcsname }% +\catcode96 11 % ` +\def\XINT_expr_scan_nbr_or_func #1% this #1 has necessarily here catcode 12 {% - \ifnum \xint_c_ix<1#1 - \expandafter\XINT_expr_scandec_I - \else - \if #1"\expandafter\expandafter\expandafter\XINT_expr_scanhex_I - \else % We assume we are dealing with a function name!! - \expandafter\expandafter\expandafter\XINT_expr_scanfunc - \fi - \fi #1% + \if "#1\xint_dothis \XINT_expr_scanhex_I\fi + \if `#1\xint_dothis {\XINT_expr_onlitteral_`}\fi + \ifnum \xint_c_ix<1#1 \xint_dothis \XINT_expr_scandec_I\fi + \xint_orthat \XINT_expr_scanfunc #1% }% -\def\XINT_expr_scanfunc +\catcode96 12 % ` +\def\XINT_expr_scandec_I {% - \expandafter\XINT_expr_func\romannumeral-`0\XINT_expr_scanfunc_c + \expandafter\XINT_expr_getop\romannumeral-`0\expandafter + \XINT_expr_lockscan\romannumeral0\expandafter\XINT_expr_inintpart + \romannumeral-`0\XINT_expr_scanintpart_b }% -\def\XINT_expr_scanfunc_c #1% +\def\XINT_expr_scandec_II {% - \expandafter #1\romannumeral-`0\expandafter - \XINT_expr_scanfunc_a\romannumeral-`0\romannumeral-`0% + \expandafter\XINT_expr_getop\romannumeral-`0\expandafter + \XINT_expr_lockscan\romannumeral0\expandafter\XINT_expr_inintpart + \romannumeral-`0\XINT_expr_scanfracpart_b +}% +\def\XINT_expr_scanintpart_a #1% +{% careful that ! has catcode letter here + \ifcat \relax #1\xint_dothis{!!#1}\fi % stops the scan + \if e#1\xint_dothis{\expandafter\XINT_expr_inexppart + \romannumeral-`0\XINT_expr_scanexppart_a e}\fi + \if E#1\xint_dothis{\expandafter\XINT_expr_inexppart + \romannumeral-`0\XINT_expr_scanexppart_a e}\fi + % \if @#1\xint_dothis{!*#1}\fi % tacit multiplication later + % \if _#1\xint_dothis{!*#1}\fi % tacit multiplication for variables + \ifcat a#1\xint_dothis{!!*#1}\fi % includes subexpressions (#1=! letter) + \xint_orthat {\expandafter\XINT_expr_scanintpart_aa\string #1}% }% -\def\XINT_expr_scanfunc_a #1% please no braced things here! +\def\XINT_expr_scanintpart_aa #1% {% - \ifcat #1\relax % missing opening parenthesis, probably - \expandafter\XINT_expr_scanfunc_panic - \else - \xint_afterfi{\expandafter\XINT_expr_scanfunc_b \string #1}% - \fi + \if .#1\xint_dothis\XINT_expr_scandec_transition\fi + \ifnum \xint_c_ix<1#1 \xint_dothis\XINT_expr_scanintpart_b\fi + \xint_orthat {!!}#1% }% -\def\xint_UDparenfork #1()#2#3\krof {#2}% -\def\XINT_expr_scanfunc_b #1% +\def\XINT_expr_scanintpart_b #1#2% {% - \xint_UDparenfork - #1){(}% and then \XINT_expr_func - (#1{(}% and then \XINT_expr_func (this is for bool/toggle names) - (){\XINT_expr_scanfunc_c #1}% - \krof + \expandafter #1\romannumeral-`0\expandafter + \XINT_expr_scanintpart_a\romannumeral-`0#2% }% -\def\XINT_expr_scanfunc_panic {\xintError:bigtroubleahead(0\relax }% -\def\XINT_expr_func #1(% common to expr and flexpr and iiexpr +\def\XINT_expr_scandec_transition .#1% {% - \xint_c_xviii @{#1}% functions have the highest priority. + \expandafter\XINT_expr_scandec_trans_a\romannumeral-`0#1% }% -\def\XINT_expr_scandec_I +\def\XINT_expr_scandec_trans_a #1% {% - \expandafter\XINT_expr_getop\romannumeral-`0\expandafter - \XINT_expr_lock\romannumeral-`0\XINT_expr_scanintpart_b + \if .#1\xint_dothis{!!..}\fi + \xint_orthat {\expandafter\XINT_expr_infracpart + \romannumeral-`0\XINT_expr_scanfracpart_a #1}% }% -\def\XINT_expr_scandec_II +\def\XINT_expr_scanfracpart_a #1% {% - \expandafter\XINT_expr_getop\romannumeral-`0\expandafter - \XINT_expr_lock\romannumeral-`0\XINT_expr_scanfracpart_b -}% -\def\XINT_expr_scanintpart_a #1% Please no braced material: 123{FORBIDDEN} -{% careful that ! has catcode letter here - \ifcat #1\relax\else - \ifx !#1\else - \expandafter\expandafter\expandafter - \xint_thirdofthree - \fi\fi - \xint_firstoftwo !% this stops the scan - {\expandafter\XINT_expr_scanintpart_aa\string }#1% + \ifcat \relax #1\xint_dothis{e!#1}\fi % stops the scan + \if e#1\xint_dothis{\XINT_expr_scanexppart_a e}\fi + \if E#1\xint_dothis{\XINT_expr_scanexppart_a e}\fi + \ifcat a#1\xint_dothis{e!*#1}\fi % and also the case of subexpressions (!) + \xint_orthat {\expandafter\XINT_expr_scanfracpart_aa\string #1}% }% -\def\XINT_expr_scanintpart_aa #1% +\def\XINT_expr_scanfracpart_aa #1% {% \ifnum \xint_c_ix<1#1 - \expandafter\XINT_expr_scanintpart_b + \expandafter\XINT_expr_scanfracpart_b \else - \if .#1% - \expandafter\expandafter\expandafter - \XINT_expr_scandec_transition - \else % gather what we got so far, leave catcode 12 #1 in stream - \expandafter\expandafter\expandafter !% ! of catcode 11, space needed - \fi + \xint_afterfi {e!}% \fi #1% }% -\def\XINT_expr_scanintpart_b #1% +\def\XINT_expr_scanfracpart_b #1#2% {% \expandafter #1\romannumeral-`0\expandafter - \XINT_expr_scanintpart_a\romannumeral-`0\romannumeral-`0% + \XINT_expr_scanfracpart_a\romannumeral-`0#2% }% -\def\XINT_expr_scandec_transition .% +\def\XINT_expr_scanexppart_a #1#2% {% - \expandafter.\romannumeral-`0\expandafter - \XINT_expr_scanfracpart_a\romannumeral-`0\romannumeral-`0% + \expandafter #1\romannumeral-`0\expandafter + \XINT_expr_scanexppart_b\romannumeral-`0#2% }% -\def\XINT_expr_scanfracpart_a #1% +\def\XINT_expr_scanexppart_b #1% {% - \ifcat #1\relax\else - \ifx !#1\else - \expandafter\expandafter\expandafter - \xint_thirdofthree - \fi\fi - \xint_firstoftwo !% this stops the scan - {\expandafter\XINT_expr_scanfracpart_aa\string }#1% + \ifcat \relax #1\xint_dothis{0!#1}\fi % stops the scan (incorrect syntax) + \ifcat a#1\xint_dothis{0!*#1}\fi % idem + \if +#1\xint_dothis {\XINT_expr_scanexppart_a +}\fi + \if -#1\xint_dothis {\XINT_expr_scanexppart_a -}\fi + \xint_orthat {\expandafter\XINT_expr_scanexppart_c\string #1}% }% -\def\XINT_expr_scanfracpart_aa #1% +\def\XINT_expr_scanexppart_c #1% {% \ifnum \xint_c_ix<1#1 - \expandafter\XINT_expr_scanfracpart_b + \expandafter\XINT_expr_scanexppart_d \else \expandafter !% \fi #1% }% -\def\XINT_expr_scanfracpart_b #1% +\def\XINT_expr_scanexppart_d #1#2% {% \expandafter #1\romannumeral-`0\expandafter - \XINT_expr_scanfracpart_a\romannumeral-`0\romannumeral-`0% + \XINT_expr_scanexppart_e\romannumeral-`0#2% +}% +\def\XINT_expr_scanexppart_e #1% +{% + \ifcat \relax #1\xint_dothis{!#1}\fi % stops the scan + \ifcat a#1\xint_dothis{!*#1}\fi % idem + \xint_orthat {\expandafter\XINT_expr_scanexppart_f\string #1}% +}% +\def\XINT_expr_scanexppart_f #1% +{% + \ifnum \xint_c_ix<1#1 + \expandafter\XINT_expr_scanexppart_d + \else + \expandafter !% + \fi + #1% }% \def\XINT_expr_scanhex_I #1% {% \expandafter\XINT_expr_getop\romannumeral-`0\expandafter - \XINT_expr_lock\expandafter\XINT_expr_inhex + \XINT_expr_lockscan\expandafter\XINT_expr_inhex \romannumeral-`0\XINT_expr_scanhexI_a }% \def\XINT_expr_inhex #1.#2#3;% expanded inside \csname..\endcsname @@ -346,13 +408,9 @@ }% \def\XINT_expr_scanhexI_a #1% {% - \ifcat #1\relax\else - \ifx !#1\else - \expandafter\expandafter\expandafter - \xint_thirdofthree - \fi\fi - \xint_firstoftwo {.I;!}% - {\expandafter\XINT_expr_scanhexI_aa\string }#1% + \ifcat #1\relax\xint_dothis{.I;!#1}\fi + \ifx !#1\xint_dothis{.I;!*!}\fi % tacit multiplication + \xint_orthat {\expandafter\XINT_expr_scanhexI_aa\string #1}% }% \def\XINT_expr_scanhexI_aa #1% {% @@ -373,25 +431,21 @@ \fi #1% }% -\def\XINT_expr_scanhexI_b #1% +\def\XINT_expr_scanhexI_b #1#2% {% \expandafter #1\romannumeral-`0\expandafter - \XINT_expr_scanhexI_a\romannumeral-`0\romannumeral-`0% + \XINT_expr_scanhexI_a\romannumeral-`0#2% }% -\def\XINT_expr_scanhex_transition .% +\def\XINT_expr_scanhex_transition .#1% {% \expandafter.\expandafter.\romannumeral-`0\expandafter - \XINT_expr_scanhexII_a\romannumeral-`0\romannumeral-`0% + \XINT_expr_scanhexII_a\romannumeral-`0#1% }% \def\XINT_expr_scanhexII_a #1% {% - \ifcat #1\relax\else - \ifx !#1\else - \expandafter\expandafter\expandafter - \xint_thirdofthree - \fi\fi - \xint_firstoftwo {;!}% this stops the scan - {\expandafter\XINT_expr_scanhexII_aa\string }#1% + \ifcat #1\relax\xint_dothis{;!#1}\fi + \ifx !#1\xint_dothis{;!*!}\fi % tacit multiplication + \xint_orthat {\expandafter\XINT_expr_scanhexII_aa\string #1}% }% \def\XINT_expr_scanhexII_aa #1% {% @@ -406,47 +460,104 @@ \fi #1% }% -\def\XINT_expr_scanhexII_b #1% +\def\XINT_expr_scanhexII_b #1#2% {% \expandafter #1\romannumeral-`0\expandafter - \XINT_expr_scanhexII_a\romannumeral-`0\romannumeral-`0% + \XINT_expr_scanhexII_a\romannumeral-`0#2% +}% +\def\XINT_expr_scanfunc +{% + \expandafter\XINT_expr_func\romannumeral-`0\XINT_expr_scanfunc_a +}% +\def\XINT_expr_scanfunc_a #1#2% +{% + \expandafter #1\romannumeral-`0\expandafter\XINT_expr_scanfunc_b\romannumeral-`0#2% +}% +\def\XINT_expr_scanfunc_b #1% +{% + \ifx !#1\xint_dothis{\xint_firstoftwo{(_*!}}\fi + \ifcat \relax#1\xint_dothis{(_}\fi + \if (#1\xint_dothis{\xint_firstoftwo{(`}}\fi + \if _#1\xint_dothis \XINT_expr_scanfunc_a \fi + \if @#1\xint_dothis \XINT_expr_scanfunc_a \fi + \ifnum \xint_c_ix<1\string#1 \xint_dothis \XINT_expr_scanfunc_a \fi + \ifcat a#1\xint_dothis \XINT_expr_scanfunc_a \fi + \xint_orthat {(_}% + #1% }% -\def\XINT_expr_getop #1% this #1 is the current locked computed value -{% full expansion of next token, first swallowing a possible space - \expandafter\XINT_expr_getop_a\expandafter #1% - \romannumeral-`0\romannumeral-`0% +\def\XINT_expr_func #1(#2% +{% #2=` pour une fonction, #2=_ pour une variable + \if #2`\ifcsname XINT_expr_var_#1\endcsname + \expandafter\expandafter\expandafter\xint_thirdofthree + \fi\fi + \xint_firstoftwo {\xint_c_xviii #2{#1}}{\xint_c_xviii _{#1}*(}% }% +\def\XINT_expr_getop #1#2% this #1 is the current locked computed value +{% + \expandafter\XINT_expr_getop_a\expandafter #1\romannumeral-`0#2% +}% +\catcode`* 11 \def\XINT_expr_getop_a #1#2% -{% if a control sequence is found, must be either \relax or register|variable - \ifcat #2\relax\expandafter\xint_firstoftwo - \else \expandafter\xint_secondoftwo - \fi - {\ifx #2\relax\expandafter\xint_firstofthree - \else\expandafter\xint_secondofthree % tacit multiplication - \fi }% - {\ifx !#2\expandafter\xint_secondofthree % tacit multiplication - \else % 1.09k adds tacit multiplication in front of ( - \if (#2\expandafter\expandafter\expandafter\xint_secondofthree - \else - \expandafter\expandafter\expandafter\xint_thirdofthree - \fi - \fi }% +{% + \ifx \relax #2\xint_dothis\xint_firstofthree\fi + \ifcat \relax #2\xint_dothis\xint_secondofthree\fi + \if _#2\xint_dothis \xint_secondofthree\fi + \if @#2\xint_dothis \xint_secondofthree\fi + \if (#2\xint_dothis \xint_secondofthree\fi + \ifx !#2\xint_dothis \xint_secondofthree\fi + \xint_orthat \xint_thirdofthree {\XINT_expr_foundend #1}% - {\XINT_expr_foundop *#1#2}% - {\XINT_expr_foundop #2#1}% + {\XINT_expr_precedence_* *#1#2}% tacit multiplication + {\XINT_expr_getop_b #2#1}% }% +\catcode`* 12 \def\XINT_expr_foundend {\xint_c_ \relax }% \relax is a place holder here. -\def\XINT_expr_foundop #1% then becomes <prec> <op> and is followed by <\.=f> -{% 1.09a: no control sequence \XINT_expr_op_#1, code common to expr/flexpr +\def\XINT_expr_getop_b #1% +{% ? and : a special syntax in \xintexpr as they are + % followed by braced arguments, and thus we must intercept them here. + % I wanted to change this but now I don't have time to think about it. + % 1.1 removes : as logic operator. Replaced by ??. + \if '#1\xint_dothis{\XINT_expr_binopwrd }\fi + \if ?#1\xint_dothis{\XINT_expr_precedence_? ?}\fi + \xint_orthat {\XINT_expr_scanop_a #1}% +}% +\def\XINT_expr_binopwrd #1#2'{\expandafter\XINT_expr_foundop_a + \csname XINT_expr_itself_\xint_zapspaces #2 \xint_bye\xint_bye\endcsname #1}% +\def\XINT_expr_scanop_a #1#2#3% + {\expandafter\XINT_expr_scanop_b\expandafter #1\expandafter #2\romannumeral-`0#3}% +\def\XINT_expr_scanop_b #1#2#3% +{% + \ifcat#3\relax\xint_dothis{\XINT_expr_foundop_a #1#2#3}\fi + \ifcsname XINT_expr_itself_#1#3\endcsname + \xint_dothis + {\expandafter\XINT_expr_scanop_c\csname XINT_expr_itself_#1#3\endcsname #2}\fi + \xint_orthat {\XINT_expr_foundop_a #1#2#3}% +}% +\def\XINT_expr_scanop_c #1#2#3% +{% + \expandafter\XINT_expr_scanop_d\expandafter #1\expandafter #2\romannumeral-`0#3% +}% +\def\XINT_expr_scanop_d #1#2#3% +{% + \ifcat#3\relax \xint_dothis{\XINT_expr_foundop #1#2#3}\fi + \ifcsname XINT_expr_itself_#1#3\endcsname + \xint_dothis + {\expandafter\XINT_expr_scanop_c\csname XINT_expr_itself_#1#3\endcsname #2}\fi + \xint_orthat {\csname XINT_expr_precedence_#1\endcsname #1#2#3}% +}% +\def\XINT_expr_foundop_a #1% +{% \ifcsname XINT_expr_precedence_#1\endcsname - \expandafter\xint_afterfi\expandafter - {\csname XINT_expr_precedence_#1\endcsname #1}% + \csname XINT_expr_precedence_#1\expandafter\endcsname + \expandafter #1% \else - \XINT_expr_unexpectedtoken - \expandafter\XINT_expr_getop + \xint_afterfi{\XINT_expr_unknown_operator {#1}\XINT_expr_getop}% \fi }% -\def\XINT_tmpa #1#2#3#4#5% +\def\XINT_expr_unknown_operator #1{\xintError:removed \xint_gobble_i {#1}}% +\def\XINT_expr_foundop #1{\csname XINT_expr_precedence_#1\endcsname #1}% +\catcode`) 11 +\def\XINT_tmpa #1#2#3#4% (avant #4#5) {% \def#1##1% {% @@ -457,44 +568,46 @@ }% \def#2##1##2% {% - \ifcase ##1\expandafter #4% - \or\xint_afterfi{% - \XINT_expr_extra_closing_paren - \expandafter #1\romannumeral-`0\XINT_expr_getop - }% + \ifcase ##1\xint_afterfi + {\ifx\XINT_expr_itself_^C ##2\xint_dothis + {\expandafter#1\romannumeral-`0\expandafter\XINT_expr_getnext\xint_gobble_i}\fi + \xint_orthat \XINT_expr_done }% + \or\xint_afterfi{\XINT_expr_extra_) + \expandafter #1\romannumeral-`0\XINT_expr_getop }% \else - \xint_afterfi{\expandafter#1\romannumeral-`0\csname XINT_#5_op_##2\endcsname }% + \xint_afterfi{\expandafter#1\romannumeral-`0\csname XINT_#4_op_##2\endcsname }% \fi }% }% +\def\XINT_expr_extra_) {\xintError:removed }% \xintFor #1 in {expr,flexpr,iiexpr} \do {% -\expandafter\XINT_tmpa + \expandafter\XINT_tmpa \csname XINT_#1_until_end_a\expandafter\endcsname \csname XINT_#1_until_end_b\expandafter\endcsname - \csname XINT_#1_op_-vi\expandafter\endcsname - \csname XINT_#1_done\endcsname + \csname XINT_#1_op_-vi\endcsname {#1}% }% -\def\XINT_expr_extra_closing_paren {\xintError:removed }% \def\XINT_tmpa #1#2#3#4#5#6% {% - \def #1{\expandafter #3\romannumeral-`0\XINT_expr_getnext }% - \let #2#1% + \def #1##1{\expandafter #3\romannumeral-`0\XINT_expr_getnext }% + \def #2{\expandafter #3\romannumeral-`0\XINT_expr_getnext }% \def #3##1{\xint_UDsignfork ##1{\expandafter #3\romannumeral-`0#5}% -{#4##1}% \krof }% - \def #4##1##2% - {% - \ifcase ##1\expandafter \XINT_expr_missing_cparen - \or \expandafter \XINT_expr_getop - \else \xint_afterfi - {\expandafter #3\romannumeral-`0\csname XINT_#6_op_##2\endcsname }% - \fi + \def #4##1##2{\ifcase ##1% + \xint_afterfi{\ifx\XINT_expr_itself_^C ##2\xint_dothis{\xint_c_ ##2}\fi + \xint_orthat\XINT_expr_missing_) }% + \or \csname XINT_#6_op_##2\expandafter\endcsname + \else + \xint_afterfi{\expandafter #3\romannumeral-`0\csname XINT_#6_op_##2\endcsname }% + \fi }% }% +\def\XINT_expr_missing_) {\xintError:inserted \xint_c_ \XINT_expr_done }% +\catcode`) 12 \xintFor #1 in {expr,flexpr,iiexpr} \do {% -\expandafter\XINT_tmpa + \expandafter\XINT_tmpa \csname XINT_#1_op_(\expandafter\endcsname \csname XINT_#1_oparen\expandafter\endcsname \csname XINT_#1_until_)_a\expandafter\endcsname @@ -502,100 +615,529 @@ \csname XINT_#1_op_-vi\endcsname {#1}% }% -\def\XINT_expr_missing_cparen {\xintError:inserted \xint_c_ \XINT_expr_done }% -\expandafter\let\csname XINT_expr_precedence_)\endcsname \xint_c_i -\expandafter\let\csname XINT_flexpr_precedence_)\endcsname \xint_c_i -\expandafter\let\csname XINT_iiexpr_precedence_)\endcsname \xint_c_i -\expandafter\let\csname XINT_expr_op_)\endcsname \XINT_expr_getop -\expandafter\let\csname XINT_flexpr_op_)\endcsname\XINT_expr_getop -\expandafter\let\csname XINT_iiexpr_op_)\endcsname\XINT_expr_getop -\def\XINT_tmpb #1#2#3#4#5#6%#7% -{% - \expandafter\XINT_tmpc - \csname XINT_#1_op_#3\expandafter\endcsname - \csname XINT_#1_until_#3_a\expandafter\endcsname - \csname XINT_#1_until_#3_b\expandafter\endcsname - \csname XINT_#1_op_-#5\expandafter\endcsname - \csname xint_c_#4\expandafter\endcsname - \csname #2#6\expandafter\endcsname - \csname XINT_expr_precedence_#3\endcsname {#1}%{#7}% -}% -\def\XINT_tmpc #1#2#3#4#5#6#7#8#9% -{% - \def #1##1% \XINT_expr_op_<op> - {% keep value, get next number and operator, then do until - \expandafter #2\expandafter ##1% - \romannumeral-`0\expandafter\XINT_expr_getnext - }% - \def #2##1##2% \XINT_expr_until_<op>_a - {\xint_UDsignfork - ##2{\expandafter #2\expandafter ##1\romannumeral-`0#4}% - -{#3##1##2}% - \krof }% - \def #3##1##2##3##4% \XINT_expr_until_<op>_b - {% either execute next operation now, or first do next (possibly unary) - \ifnum ##2>#5% - \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0% - \csname XINT_#8_op_##3\endcsname {##4}}% - \else - \xint_afterfi - {\expandafter ##2\expandafter ##3% - \csname .=#6#9{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname }% - \fi - }% - \let #7#5% +\expandafter\let\csname XINT_expr_precedence_)\endcsname\xint_c_i +\expandafter\let\csname XINT_expr_precedence_]\endcsname\xint_c_i +\expandafter\let\csname XINT_expr_precedence_;\endcsname\xint_c_i +\let\XINT_expr_precedence_a \xint_c_xviii +\expandafter\let\csname XINT_expr_precedence_^C\endcsname \xint_c_ +\expandafter\let\csname XINT_expr_precedence_++)\endcsname \xint_c_i +\catcode`. 11 \catcode`= 11 \catcode`+ 11 +\xintFor #1 in {expr,flexpr,iiexpr} \do {% + \expandafter\let\csname XINT_#1_op_)\endcsname \XINT_expr_getop + \expandafter\let\csname XINT_#1_op_;\endcsname \space + \expandafter\def\csname XINT_#1_op_]\endcsname ##1{\XINT_expr_getop ##1a}% + \expandafter\let\csname XINT_#1_op_a\endcsname \XINT_expr_getop + \expandafter\def\csname XINT_#1_op_++)\endcsname ##1##2\relax + {\expandafter\XINT_expr_foundend \expandafter + {\expandafter\.=+\xintiCeil{\XINT_expr_unlock ##1}}}% +}% +\catcode`. 12 \catcode`= 12 \catcode`+ 12 +\xintFor* #1 in {{==}{<=}{>=}{!=}{&&}{||}{**}{//}{/:}{..}{..[}{].}{]..}% + {+[}{-[}{*[}{/[}{**[}{^[}{a+}{a-}{a*}{a/}{a**}{a^}% + {][}{][:}{:]}{^C}{++}{++)}} + \do {\expandafter\def\csname XINT_expr_itself_#1\endcsname {#1}}% +\def\XINT_tmpc #1#2#3#4#5#6#7#8% +{% + \def #1##1% \XINT_expr_op_<op> ou flexpr ou iiexpr + {% keep value, get next number and operator, then do until + \expandafter #2\expandafter ##1% + \romannumeral-`0\expandafter\XINT_expr_getnext }% + \def #2##1##2% \XINT_expr_until_<op>_a ou flexpr ou iiexpr + {\xint_UDsignfork ##2{\expandafter #2\expandafter ##1\romannumeral-`0#4}% + -{#3##1##2}% + \krof }% + \def #3##1##2##3##4% \XINT_expr_until_<op>_b ou flexpr ou iiexpr + {% either execute next operation now, or first do next (possibly unary) + \ifnum ##2>#5% + \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0% + \csname XINT_#8_op_##3\endcsname {##4}}% + \else \xint_afterfi {\expandafter ##2\expandafter ##3% + \csname .=#6{\XINT_expr_unlock ##1}{\XINT_expr_unlock ##4}\endcsname }% + \fi }% + \let #7#5% }% -\def\XINT_tmpa #1{\XINT_tmpb {expr}{xint}#1{}}% +\def\XINT_tmpb #1#2#3#4#5#6% +{% + \expandafter\XINT_tmpc + \csname XINT_#1_op_#3\expandafter\endcsname + \csname XINT_#1_until_#3_a\expandafter\endcsname + \csname XINT_#1_until_#3_b\expandafter\endcsname + \csname XINT_#1_op_-#5\expandafter\endcsname + \csname xint_c_#4\expandafter\endcsname + \csname #2#6\expandafter\endcsname + \csname XINT_expr_precedence_#3\endcsname {#1}% +}% +\xintFor #1 in {expr, flexpr, iiexpr} \do {% + \def\XINT_tmpa ##1{\XINT_tmpb {#1}{xint}##1}% + \xintApplyInline {\XINT_tmpa }{% + {|{iii}{vi}{OR}}% + {&{iv}{vi}{AND}}% + {{xor}{iii}{vi}{XOR}}% + {<{v}{vi}{Lt}}% + {>{v}{vi}{Gt}}% + {={v}{vi}{Eq}}% + {{<=}{v}{vi}{LtorEq}}% + {{>=}{v}{vi}{GtorEq}}% + {{!=}{v}{vi}{Neq}}% + {{..}{iii}{vi}{Seq::csv}}% will get redefined to use \xintiiSeq::csv in xintiiexpr + {{//}{vii}{vii}{DivTrunc}}% will get redefined for xintiiexpr + {{/:}{vii}{vii}{Mod}}% + }% +}% +\def\XINT_tmpa #1{\XINT_tmpb {expr}{xint}#1}% \xintApplyInline {\XINT_tmpa }{% - {|{iii}{vi}{OR}}% - {&{iv}{vi}{AND}}% - {<{v}{vi}{Lt}}% - {>{v}{vi}{Gt}}% - {={v}{vi}{Eq}}% {+{vi}{vi}{Add}}% {-{vi}{vi}{Sub}}% {*{vii}{vii}{Mul}}% {/{vii}{vii}{Div}}% {^{viii}{viii}{Pow}}% - {e{ix}{ix}{fE}}% - {E{ix}{ix}{fE}}% + {{..[}{iii}{vi}{SeqA::csv}}% + {{]..}{iii}{vi}{SeqB::csv}}% }% -\def\XINT_tmpa #1{\XINT_tmpb {flexpr}{xint}#1{}}% -\xintApplyInline {\XINT_tmpa }{% - {|{iii}{vi}{OR}}% - {&{iv}{vi}{AND}}% - {<{v}{vi}{Lt}}% - {>{v}{vi}{Gt}}% - {={v}{vi}{Eq}}% -}% -\def\XINT_tmpa #1{\XINT_tmpb {flexpr}{XINTinFloat}#1{[\XINTdigits]}}% +\def\XINT_tmpa #1{\XINT_tmpb {flexpr}{XINTinFloat}#1}% \xintApplyInline {\XINT_tmpa }{% {+{vi}{vi}{Add}}% {-{vi}{vi}{Sub}}% {*{vii}{vii}{Mul}}% {/{vii}{vii}{Div}}% {^{viii}{viii}{Power}}% - {e{ix}{ix}{fE}}% - {E{ix}{ix}{fE}}% + {{..[}{iii}{vi}{SeqA::csv}}% + {{]..}{iii}{vi}{SeqB::csv}}% }% -\def\XINT_tmpa #1{\XINT_tmpb {iiexpr}{xint}#1{}}% +\def\XINT_tmpa #1{\XINT_tmpb {iiexpr}{xint}#1}% \xintApplyInline {\XINT_tmpa }{% - {|{iii}{vi}{OR}}% - {&{iv}{vi}{AND}}% - {<{v}{vi}{Lt}}% - {>{v}{vi}{Gt}}% - {={v}{vi}{Eq}}% {+{vi}{vi}{iiAdd}}% {-{vi}{vi}{iiSub}}% {*{vii}{vii}{iiMul}}% - {/{vii}{vii}{iiQuo}}% + {/{vii}{vii}{iiDivRound}}% CHANGED IN 1.1! PREVIOUSLY DID EUCLIDEAN QUOTIENT {^{viii}{viii}{iiPow}}% - {e{ix}{ix}{iE}}% - {E{ix}{ix}{iE}}% + {{..[}{iii}{vi}{iiSeqA::csv}}% + {{]..}{iii}{vi}{iiSeqB::csv}}% + {{..}{iii}{vi}{iiSeq::csv}}% + {{//}{vii}{vii}{iiDivTrunc}}% + {{/:}{vii}{vii}{iiMod}}% +}% +\def\XINT_expr_binop_inline_a + {\expandafter\xint_gobble_i\romannumeral-`0\XINT_expr_binop_inline_b }% +\def\XINT_expr_binop_inline_b #1#2,{\XINT_expr_binop_inline_c #2,{#1}}% +\def\XINT_expr_binop_inline_c #1{% + \if ,#1\xint_dothis\XINT_expr_binop_inline_e\fi + \if ^#1\xint_dothis\XINT_expr_binop_inline_end\fi + \xint_orthat\XINT_expr_binop_inline_d #1}% +\def\XINT_expr_binop_inline_d #1,#2{,#2{#1}\XINT_expr_binop_inline_b {#2}}% +\def\XINT_expr_binop_inline_e #1,#2{,\XINT_expr_binop_inline_b {#2}}% +\def\XINT_expr_binop_inline_end #1,#2{}% +\def\XINT_tmpc #1#2#3#4#5#6#7#8% +{% + \def #1##1% \XINT_expr_op_<op> ou flexpr ou iiexpr + {% keep value, get next number and operator, then do until + \expandafter #2\expandafter ##1% + \romannumeral-`0\expandafter\XINT_expr_getnext }% + \def #2##1##2% \XINT_expr_until_<op>_a ou flexpr ou iiexpr + {\xint_UDsignfork ##2{\expandafter #2\expandafter ##1\romannumeral-`0#4}% + -{#3##1##2}% + \krof }% + \def #3##1##2##3##4% \XINT_expr_until_<op>_b ou flexpr ou iiexpr + {% either execute next operation now, or first do next (possibly unary) + \ifnum ##2>#5% + \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0% + \csname XINT_#8_op_##3\endcsname {##4}}% + \else \xint_afterfi {\expandafter ##2\expandafter ##3% + \csname .=\expandafter\XINT_expr_binop_inline_a\expandafter + {\expandafter\expandafter\expandafter#6\expandafter + \xint_exchangetwo_keepbraces\expandafter + {\expandafter\XINT_expr_unlock\expandafter ##4\expandafter}\expandafter}% + \romannumeral-`0\XINT_expr_unlock ##1,^,\endcsname }% + \fi }% + \let #7#5% +}% +\def\XINT_tmpb #1#2#3#4% +{% + \expandafter\XINT_tmpc + \csname XINT_#1_op_#2\expandafter\endcsname + \csname XINT_#1_until_#2_a\expandafter\endcsname + \csname XINT_#1_until_#2_b\expandafter\endcsname + \csname XINT_#1_op_-#3\expandafter\endcsname + \csname xint_c_#3\expandafter\endcsname + \csname #4\expandafter\endcsname + \csname XINT_expr_precedence_#2\endcsname {#1}% +}% +\xintApplyInline {\expandafter\XINT_tmpb \xint_firstofone}{% + {{expr}{a+}{vi}{xintAdd}}% + {{expr}{a-}{vi}{xintSub}}% + {{expr}{a*}{vii}{xintMul}}% + {{expr}{a/}{vii}{xintDiv}}% + {{expr}{a^}{viii}{xintPow}}% + {{iiexpr}{a+}{vi}{xintiiAdd}}% + {{iiexpr}{a-}{vi}{xintiiSub}}% + {{iiexpr}{a*}{vii}{xintiiMul}}% + {{iiexpr}{a/}{vii}{xintiiDivRound}}% + {{iiexpr}{a^}{viii}{xintiiPow}}% + {{flexpr}{a+}{vi}{XINTinFloatAdd}}% + {{flexpr}{a-}{vi}{XINTinFloatSub}}% + {{flexpr}{a*}{vii}{XINTinFloatMul}}% + {{flexpr}{a/}{vii}{XINTinFloatDiv}}% + {{flexpr}{a^}{viii}{XINTinFloatPower}}% +}% +\def\XINT_tmpc #1#2#3#4#5#6#7% +{% + \def #1##1{\expandafter#2\expandafter##1\romannumeral-`0% + \expandafter #3\romannumeral-`0\XINT_expr_getnext }% + \def #2##1##2##3##4% + {% either execute next operation now, or first do next (possibly unary) + \ifnum ##2>#4% + \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0% + \csname XINT_#7_op_##3\endcsname {##4}}% + \else \xint_afterfi {\expandafter ##2\expandafter ##3% + \csname .=\expandafter\XINT_expr_binop_inline_a\expandafter + {\expandafter#5\expandafter + {\expandafter\XINT_expr_unlock\expandafter ##1\expandafter}\expandafter}% + \romannumeral-`0\XINT_expr_unlock ##4,^,\endcsname }% + \fi }% + \let #6#4% +}% +\def\XINT_tmpb #1#2#3#4% +{% + \expandafter\XINT_tmpc + \csname XINT_#1_op_#2\expandafter\endcsname + \csname XINT_#1_until_#2\expandafter\endcsname + \csname XINT_#1_until_)_a\expandafter\endcsname + \csname xint_c_#3\expandafter\endcsname + \csname #4\expandafter\endcsname + \csname XINT_expr_precedence_#2\endcsname {#1}% +}% +\xintApplyInline {\expandafter\XINT_tmpb\xint_firstofone }{% + {{expr}{+[}{vi}{xintAdd}}% + {{expr}{-[}{vi}{xintSub}}% + {{expr}{*[}{vii}{xintMul}}% + {{expr}{/[}{vii}{xintDiv}}% + {{expr}{^[}{viii}{xintPow}}% + {{iiexpr}{+[}{vi}{xintiiAdd}}% + {{iiexpr}{-[}{vi}{xintiiSub}}% + {{iiexpr}{*[}{vii}{xintiiMul}}% + {{iiexpr}{/[}{vii}{xintiiDivRound}}% + {{iiexpr}{^[}{viii}{xintiiPow}}% + {{flexpr}{+[}{vi}{XINTinFloatAdd}}% + {{flexpr}{-[}{vi}{XINTinFloatSub}}% + {{flexpr}{*[}{vii}{XINTinFloatMul}}% + {{flexpr}{/[}{vii}{XINTinFloatDiv}}% + {{flexpr}{^[}{viii}{XINTinFloatPower}}% +}% +\xintFor #1 in {and,or,xor,mod} \do {% + \expandafter\def\csname XINT_expr_itself_#1\endcsname {#1}}% +\expandafter\let\csname XINT_expr_precedence_and\expandafter\endcsname + \csname XINT_expr_precedence_&\endcsname +\expandafter\let\csname XINT_expr_precedence_or\expandafter\endcsname + \csname XINT_expr_precedence_|\endcsname +\expandafter\let\csname XINT_expr_precedence_mod\expandafter\endcsname + \csname XINT_expr_precedence_/:\endcsname +\xintFor #1 in {expr, flexpr, iiexpr} \do {% + \expandafter\let\csname XINT_#1_op_and\expandafter\endcsname + \csname XINT_#1_op_&\endcsname + \expandafter\let\csname XINT_#1_op_or\expandafter\endcsname + \csname XINT_#1_op_|\endcsname + \expandafter\let\csname XINT_#1_op_mod\expandafter\endcsname + \csname XINT_#1_op_/:\endcsname +}% +\expandafter\let\csname XINT_expr_precedence_==\expandafter\endcsname + \csname XINT_expr_precedence_=\endcsname +\expandafter\let\csname XINT_expr_precedence_&&\expandafter\endcsname + \csname XINT_expr_precedence_&\endcsname +\expandafter\let\csname XINT_expr_precedence_||\expandafter\endcsname + \csname XINT_expr_precedence_|\endcsname +\expandafter\let\csname XINT_expr_precedence_**\expandafter\endcsname + \csname XINT_expr_precedence_^\endcsname +\expandafter\let\csname XINT_expr_precedence_a**\expandafter\endcsname + \csname XINT_expr_precedence_a^\endcsname +\expandafter\let\csname XINT_expr_precedence_**[\expandafter\endcsname + \csname XINT_expr_precedence_^[\endcsname +\xintFor #1 in {expr, flexpr, iiexpr} \do {% + \expandafter\let\csname XINT_#1_op_==\expandafter\endcsname + \csname XINT_#1_op_=\endcsname + \expandafter\let\csname XINT_#1_op_&&\expandafter\endcsname + \csname XINT_#1_op_&\endcsname + \expandafter\let\csname XINT_#1_op_||\expandafter\endcsname + \csname XINT_#1_op_|\endcsname + \expandafter\let\csname XINT_#1_op_**\expandafter\endcsname + \csname XINT_#1_op_^\endcsname + \expandafter\let\csname XINT_#1_op_a**\expandafter\endcsname + \csname XINT_#1_op_a^\endcsname + \expandafter\let\csname XINT_#1_op_**[\expandafter\endcsname + \csname XINT_#1_op_^[\endcsname }% \def\XINT_tmpa #1#2#3#4#5#6% {% - \def #1##1% \XINT_expr_op_,_a + \def #1##1% \XINT_expr_op_][ + {% + \expandafter #2\expandafter ##1\romannumeral-`0\XINT_expr_getnext + }% + \def #2##1##2% \XINT_expr_until_][_a + {\xint_UDsignfork + ##2{\expandafter #2\expandafter ##1\romannumeral-`0#4}% + -{#3##1##2}% + \krof }% + \def #3##1##2##3##4% \XINT_expr_until_][_b + {% + \ifnum ##2>\xint_c_ii + \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0% + \csname XINT_#6_op_##3\endcsname {##4}}% + \else + \xint_afterfi + {\expandafter ##2\expandafter ##3\csname + .=\expandafter\xintListSel:csv \romannumeral-`0\XINT_expr_unlock ##4;% + \XINT_expr_unlock ##1;\endcsname % unlock for \xintNewExpr + }% + \fi + }% + \let #5\xint_c_ii +}% +\xintFor #1 in {expr,flexpr,iiexpr} \do {% +\expandafter\XINT_tmpa + \csname XINT_#1_op_][\expandafter\endcsname + \csname XINT_#1_until_][_a\expandafter\endcsname + \csname XINT_#1_until_][_b\expandafter\endcsname + \csname XINT_#1_op_-vi\expandafter\endcsname + \csname XINT_expr_precedence_][\endcsname {#1}% +}% +\def\XINT_tmpa #1#2#3#4#5#6% +{% + \def #1##1% \XINT_expr_op_: + {% + \expandafter #2\expandafter ##1\romannumeral-`0\XINT_expr_getnext + }% + \def #2##1##2% \XINT_expr_until_:_a + {\xint_UDsignfork + ##2{\expandafter #2\expandafter ##1\romannumeral-`0#4}% + -{#3##1##2}% + \krof }% + \def #3##1##2##3##4% \XINT_expr_until_:_b + {% + \ifnum ##2>\xint_c_iii + \xint_afterfi {\expandafter #2\expandafter ##1\romannumeral-`0% + \csname XINT_#6_op_##3\endcsname {##4}}% + \else + \xint_afterfi + {\expandafter ##2\expandafter ##3\csname + .=:\xintiiifSgn{\XINT_expr_unlock ##1}NPP.% : and dots for expansion + \xintiiifSgn{\XINT_expr_unlock ##4}NPP.% in \xintNewExpr context + \xintNum{\XINT_expr_unlock ##1};\xintNum{\XINT_expr_unlock ##4}\endcsname + }% + \fi + }% + \let #5\xint_c_iii +}% +\xintFor #1 in {expr,flexpr,iiexpr} \do {% +\expandafter\XINT_tmpa + \csname XINT_#1_op_:\expandafter\endcsname + \csname XINT_#1_until_:_a\expandafter\endcsname + \csname XINT_#1_until_:_b\expandafter\endcsname + \csname XINT_#1_op_-vi\expandafter\endcsname + \csname XINT_expr_precedence_:\endcsname {#1}% +}% +\catcode`[ 11 \catcode`] 11 +\let\XINT_expr_precedence_:] \xint_c_iii +\def\XINT_expr_op_:] #1{\expandafter\xint_c_i\expandafter )% + \csname .=]\xintiiifSgn{\XINT_expr_unlock #1}npp\XINT_expr_unlock #1\endcsname }% +\let\XINT_flexpr_op_:] \XINT_expr_op_:] +\let\XINT_iiexpr_op_:] \XINT_expr_op_:] +\let\XINT_expr_precedence_][: \xint_c_iii +\edef\XINT_expr_op_][: #1{\xint_c_ii \expandafter\noexpand + \csname XINT_expr_itself_][\endcsname #10\string :}% +\let\XINT_flexpr_op_][: \XINT_expr_op_][: +\let\XINT_iiexpr_op_][: \XINT_expr_op_][: +\catcode`[ 12 \catcode`] 12 +\def\xintListSel:csv #1{% these complications are due to \xintNewExpr matters + \if ]\noexpand#1\xint_dothis{\expandafter\XINT_listsel:_s\romannumeral-`0}\fi + \if :\noexpand#1\xint_dothis{\XINT_listsel:_:}\fi + \xint_orthat {\XINT_listsel:_nth #1}% +}% +\def\XINT_listsel:_s #1{\if p#1\expandafter\XINT_listsel:_trim\else + \expandafter\XINT_listsel:_keep\fi }% +\def\XINT_listsel:_: #1.#2.{\csname XINT_listsel:_#1#2\endcsname }% +\def\XINT_listsel:_trim #1;#2;% + {\xintListWithSep,{\xintTrim {\xintNum{#1}}{\xintCSVtoListNonStripped{#2}}}}% +\def\XINT_listsel:_keep #1;#2;% + {\xintListWithSep,{\xintKeep {\xintNum{#1}}{\xintCSVtoListNonStripped{#2}}}}% +\def\XINT_listsel:_nth#1;#2;% + {\xintNthElt {\xintNum{#1}}{\xintCSVtoListNonStripped{#2}}}% +\def\XINT_listsel:_PP #1;#2;#3;% + {\xintListWithSep,% + {\xintTrim {\xintNum{#1}}% + {\xintKeep {\xintNum{#2}}% + {\xintCSVtoListNonStripped{#3}}% + }% + }% + }% +\def\XINT_listsel:_NN #1;#2;#3;% + {\xintListWithSep,% + {\xintTrim {\xintNum{#2}}% + {\xintKeep {\xintNum{#1}}% + {\xintCSVtoListNonStripped{#3}}% + }% + }% + }% +\def\XINT_listsel:_NP #1;#2;#3;% + {\expandafter\XINT_listsel:_NP_a \the\numexpr #1+% + \xintNthElt{0}{\xintCSVtoListNonStripped{#3}};#2;#3;}% +\def\XINT_listsel:_NP_a #1#2;{\if -#1\expandafter\XINT_listsel:_OP\fi + \XINT_listsel:_PP #1#2;}% +\def\XINT_listsel:_OP\XINT_listsel:_PP #1;{\XINT_listsel:_PP 0;}% +\def\XINT_listsel:_PN #1;#2;#3;% + {\expandafter\XINT_listsel:_PN_a \the\numexpr #2+% + \xintNthElt{0}{\xintCSVtoListNonStripped{#3}};#1;#3;}% +\def\XINT_listsel:_PN_a #1#2;#3;{\if -#1\expandafter\XINT_listsel:_PO\fi + \XINT_listsel:_PP #3;#1#2;}% +\def\XINT_listsel:_PO\XINT_listsel:_PP #1;#2;{\XINT_listsel:_PP #1;0;}% +\def\xintSeq::csv {\romannumeral0\xintseq::csv }% +\def\xintseq::csv #1#2% +{% + \expandafter\XINT_seq::csv\expandafter + {\the\numexpr \xintiCeil{#1}\expandafter}\expandafter + {\the\numexpr \xintiFloor{#2}}% +}% +\def\XINT_seq::csv #1#2% +{% + \ifcase\ifnum #1=#2 0\else\ifnum #2>#1 1\else -1\fi\fi\space + \expandafter\XINT_seq::csv_z + \or + \expandafter\XINT_seq::csv_p + \else + \expandafter\XINT_seq::csv_n + \fi + {#2}{#1}% +}% +\def\XINT_seq::csv_z #1#2{ #1/1[0]}% +\def\XINT_seq::csv_p #1#2% +{% + \ifnum #1>#2 + \expandafter\expandafter\expandafter\XINT_seq::csv_p + \else + \expandafter\XINT_seq::csv_e + \fi + \expandafter{\the\numexpr #1-\xint_c_i}{#2},#1/1[0]% +}% +\def\XINT_seq::csv_n #1#2% +{% + \ifnum #1<#2 + \expandafter\expandafter\expandafter\XINT_seq::csv_n + \else + \expandafter\XINT_seq::csv_e + \fi + \expandafter{\the\numexpr #1+\xint_c_i}{#2},#1/1[0]% +}% +\def\XINT_seq::csv_e #1,{ }% +\def\xintiiSeq::csv {\romannumeral0\xintiiseq::csv }% +\def\xintiiseq::csv #1#2% +{% + \expandafter\XINT_iiseq::csv\expandafter + {\the\numexpr #1\expandafter}\expandafter{\the\numexpr #2}% +}% +\def\XINT_iiseq::csv #1#2% +{% + \ifcase\ifnum #1=#2 0\else\ifnum #2>#1 1\else -1\fi\fi\space + \expandafter\XINT_iiseq::csv_z + \or + \expandafter\XINT_iiseq::csv_p + \else + \expandafter\XINT_iiseq::csv_n + \fi + {#2}{#1}% +}% +\def\XINT_iiseq::csv_z #1#2{ #1}% +\def\XINT_iiseq::csv_p #1#2% +{% + \ifnum #1>#2 + \expandafter\expandafter\expandafter\XINT_iiseq::csv_p + \else + \expandafter\XINT_seq::csv_e + \fi + \expandafter{\the\numexpr #1-\xint_c_i}{#2},#1% +}% +\def\XINT_iiseq::csv_n #1#2% +{% + \ifnum #1<#2 + \expandafter\expandafter\expandafter\XINT_iiseq::csv_n + \else + \expandafter\XINT_seq::csv_e + \fi + \expandafter{\the\numexpr #1+\xint_c_i}{#2},#1% +}% +\def\XINT_seq::csv_e #1,{ }% +\def\xintSeqA::csv #1% + {\expandafter\XINT_seqa::csv\expandafter{\romannumeral0\xintraw {#1}}}% +\def\XINT_seqa::csv #1#2{\expandafter\XINT_seqa::csv_a \romannumeral0\xintraw {#2};#1;}% +\def\xintiiSeqA::csv #1#2{\XINT_iiseqa::csv #1#2}% +\def\XINT_iiseqa::csv #1#2#3#4{\expandafter\XINT_seqa::csv_a + \romannumeral-`0\expandafter \XINT_expr_unlock\expandafter#4% + \expandafter;\romannumeral-`0\XINT_expr_unlock #2;}% +\def\XINTinFloatSeqA::csv #1{\expandafter\XINT_flseqa::csv\expandafter + {\romannumeral0\XINTinfloat [\XINTdigits]{#1}}}% +\def\XINT_flseqa::csv #1#2% + {\expandafter\XINT_seqa::csv_a\romannumeral0\XINTinfloat [\XINTdigits]{#2};#1;}% +\def\XINT_seqa::csv_a #1{\xint_UDzerominusfork + #1-{z}% + 0#1{n}% + 0-{p}% + \krof #1}% +\def\xintSeqB::csv #1#2% + {\expandafter\XINT_seqb::csv \expandafter{\romannumeral0\xintraw{#2}}{#1}}% +\def\XINT_seqb::csv #1#2{\expandafter\XINT_seqb::csv_a\romannumeral-`0#2#1!}% +\def\XINT_seqb::csv_a #1#2;#3;#4!{\expandafter\XINT_expr_seq_empty? + \romannumeral0\csname XINT_seqb::csv_#1\endcsname {#3}{#4}{#2}}% +\def\XINT_seqb::csv_p #1#2#3% +{% + \xintifCmp {#1}{#2}{,#1\expandafter\XINT_seqb::csv_p\expandafter}% + {,#1\xint_gobble_iii}{\xint_gobble_iii}% + {\romannumeral0\xintadd {#3}{#1}}{#2}{#3}% +}% +\def\XINT_seqb::csv_n #1#2#3% +{% + \xintifCmp {#1}{#2}{\xint_gobble_iii}{,#1\xint_gobble_iii}% + {,#1\expandafter\XINT_seqb::csv_n\expandafter}% + {\romannumeral0\xintadd {#3}{#1}}{#2}{#3}% +}% +\def\XINT_seqb::csv_z #1#2#3{,#1}% +\def\xintiiSeqB::csv #1#2{\XINT_iiseqb::csv #1#2}% +\def\XINT_iiseqb::csv #1#2#3#4% + {\expandafter\XINT_iiseqb::csv_a + \romannumeral-`0\expandafter \XINT_expr_unlock\expandafter#2% + \romannumeral-`0\XINT_expr_unlock #4!}% +\def\XINT_iiseqb::csv_a #1#2;#3;#4!{\expandafter\XINT_expr_seq_empty? + \romannumeral-`0\csname XINT_iiseqb::csv_#1\endcsname {#3}{#4}{#2}}% +\def\XINT_iiseqb::csv_p #1#2#3% +{% + \xintSgnFork{\XINT_Cmp {#1}{#2}}{,#1\expandafter\XINT_iiseqb::csv_p\expandafter}% + {,#1\xint_gobble_iii}{\xint_gobble_iii}% + {\romannumeral0\xintiiadd {#3}{#1}}{#2}{#3}% +}% +\def\XINT_iiseqb::csv_n #1#2#3% +{% + \xintSgnFork{\XINT_Cmp {#1}{#2}}{\xint_gobble_iii}{,#1\xint_gobble_iii}% + {,#1\expandafter\XINT_iiseqb::csv_n\expandafter}% + {\romannumeral0\xintiiadd {#3}{#1}}{#2}{#3}% +}% +\def\XINT_iiseqb::csv_z #1#2#3{,#1}% +\def\XINTinFloatSeqB::csv #1#2{\expandafter\XINT_flseqb::csv \expandafter + {\romannumeral0\XINTinfloat [\XINTdigits]{#2}}{#1}}% +\def\XINT_flseqb::csv #1#2{\expandafter\XINT_flseqb::csv_a\romannumeral-`0#2#1!}% +\def\XINT_flseqb::csv_a #1#2;#3;#4!{\expandafter\XINT_expr_seq_empty? + \romannumeral-`0\csname XINT_flseqb::csv_#1\endcsname {#3}{#4}{#2}}% +\def\XINT_flseqb::csv_p #1#2#3% +{% + \xintifCmp {#1}{#2}{,#1\expandafter\XINT_flseqb::csv_p\expandafter}% + {,#1\xint_gobble_iii}{\xint_gobble_iii}% + {\romannumeral0\XINTinfloatadd {#3}{#1}}{#2}{#3}% +}% +\def\XINT_flseqb::csv_n #1#2#3% +{% + \xintifCmp {#1}{#2}{\xint_gobble_iii}{,#1\xint_gobble_iii}% + {,#1\expandafter\XINT_flseqb::csv_n\expandafter}% + {\romannumeral0\XINTinfloatadd {#3}{#1}}{#2}{#3}% +}% +\def\XINT_flseqb::csv_z #1#2#3{,#1}% +\def\XINT_tmpa #1#2#3#4#5#6% +{% + \def #1##1% \XINT_expr_op_, {% \expandafter #2\expandafter ##1\romannumeral-`0\XINT_expr_getnext }% @@ -659,172 +1201,614 @@ \xintApplyInline{\XINT_tmpa {flexpr}\xintOpp}{{vi}{vii}{viii}{ix}}% \xintApplyInline{\XINT_tmpa {iiexpr}\xintiiOpp}{{vi}{vii}{viii}{ix}}% \let\XINT_expr_precedence_? \xint_c_x -\def \XINT_expr_op_? #1#2#3% +\def\XINT_expr_op_? #1#2{\if ?#2\expandafter \XINT_expr_op_??\fi + \XINT_expr_op_?a #1{#2}}% +\def\XINT_expr_op_?a #1#2#3% {% - \xintifZero{\XINT_expr_unlock #1}% - {\XINT_expr_getnext #3}% - {\XINT_expr_getnext #2}% + \xintiiifNotZero{\XINT_expr_unlock #1}{\XINT_expr_getnext #2}{\XINT_expr_getnext #3}% }% \let\XINT_flexpr_op_?\XINT_expr_op_? \let\XINT_iiexpr_op_?\XINT_expr_op_? -\let\XINT_expr_precedence_: \xint_c_x -\def \XINT_expr_op_: #1#2#3#4% +\def\XINT_expr_op_?? #1#2#3#4#5#6% {% - \xintifSgn {\XINT_expr_unlock #1}% - {\XINT_expr_getnext #2}% - {\XINT_expr_getnext #3}% - {\XINT_expr_getnext #4}% + \xintiiifSgn {\XINT_expr_unlock #2}{\XINT_expr_getnext #4}{\XINT_expr_getnext #5}% + {\XINT_expr_getnext #6}% }% -\let\XINT_flexpr_op_:\XINT_expr_op_: -\let\XINT_iiexpr_op_:\XINT_expr_op_: \let\XINT_expr_precedence_! \xint_c_x \def\XINT_expr_op_! #1{\expandafter\XINT_expr_getop - \csname .=\xintFac{\XINT_expr_unlock #1}\endcsname }% + \csname .=\xintFac{\XINT_expr_unlock #1}\endcsname }% \let\XINT_flexpr_op_!\XINT_expr_op_! \def\XINT_iiexpr_op_! #1{\expandafter\XINT_expr_getop - \csname .=\xintiFac{\XINT_expr_unlock #1}\endcsname }% -\def\XINT_tmpa #1#2#3#4{% - \def #1##1% + \csname .=\xintiFac{\XINT_expr_unlock #1}\endcsname }% +\catcode`[ 11 +\catcode`* 11 +\let\XINT_expr_precedence_[ \xint_c_vii +\def\XINT_expr_op_[ #1#2]{\expandafter\XINT_expr_getop + \csname .=\xintE{\XINT_expr_unlock #1}% + {\xint_zapspaces #2 \xint_bye\xint_bye}\endcsname}% +\def\XINT_iiexpr_op_[ #1#2]{\expandafter\XINT_expr_getop + \csname .=\xintiiE{\XINT_expr_unlock #1}% + {\xint_zapspaces #2 \xint_bye\xint_bye}\endcsname}% +\def\XINT_flexpr_op_[ #1#2]{\expandafter\XINT_expr_getop + \csname .=\XINTinFloatE{\XINT_expr_unlock #1}% + {\xint_zapspaces #2 \xint_bye\xint_bye}\endcsname}% +\catcode`[ 12 +\catcode`* 12 +\def\XINT_expr_op__ #1% op__ with two _'s + {% + \ifcsname XINT_expr_var_#1\endcsname + \expandafter\xint_firstoftwo + \else + \expandafter\xint_secondoftwo + \fi + {\expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \XINT_expr_getop\csname XINT_expr_var_#1\endcsname}% + {\XINT_expr_unknown_variable {#1}% + \expandafter\XINT_expr_getop\csname .=0\endcsname}% + }% +\def\XINT_expr_unknown_variable #1{\xintError:removed \xint_gobble_i {#1}}% +\let\XINT_flexpr_op__ \XINT_expr_op__ +\let\XINT_iiexpr_op__ \XINT_expr_op__ +\catcode`: 12 +\def\xintdefvar #1:=#2;{\expandafter\odef + \csname XINT_expr_var_\xint_zapspaces #1 \xint_bye\xint_bye\endcsname + {\expandafter\empty\romannumeral0\xintbareeval #2\relax }}% +\def\xintdefiivar #1:=#2;{\expandafter\odef + \csname XINT_expr_var_\xint_zapspaces #1 \xint_bye\xint_bye\endcsname + {\expandafter\empty\romannumeral0\xintbareiieval #2\relax }% +}% +\def\xintdeffloatvar #1:=#2;{\expandafter\odef + \csname XINT_expr_var_\xint_zapspaces #1 \xint_bye\xint_bye\endcsname + {\expandafter\empty\romannumeral0\xintbarefloateval #2\relax }% +}% +\catcode`: 11 +\def\XINT_tmpa #1% +{% + \expandafter\def\csname XINT_expr_var_#1\endcsname ##1\relax !#1##2% + {\romannumeral0\XINT_expr_lockscan ##2!##1\relax !#1{##2}}% +}% +\xintApplyUnbraced \XINT_tmpa {abcdefghijklmnopqrstuvwxyz}% +\xintApplyUnbraced \XINT_tmpa {ABCDEFGHIJKLMNOPQRSTUVWXYZ}% +\expandafter\def\expandafter\XINT_expr_var_nil\expandafter + {\expandafter\empty\csname .= \endcsname}% +\catcode`. 11 \catcode`= 11 +\def\XINT_expr_var_omit #1\relax !{1^C!{}{}{}\.=!\relax !}% 24 juin +\def\XINT_expr_var_abort #1\relax !{1^C!{}{}{}\.=^\relax !}% 25 juin +\catcode`. 12 \catcode`= 12 +\catcode`? 3 +\def\XINT_expr_var_@ #1~#2{ #2#1~#2}% +\expandafter\let\csname XINT_expr_var_@1\endcsname \XINT_expr_var_@ +\expandafter\def\csname XINT_expr_var_@2\endcsname #1~#2#3{ #3#1~#2#3}% +\expandafter\def\csname XINT_expr_var_@3\endcsname #1~#2#3#4{ #4#1~#2#3#4}% +\expandafter\def\csname XINT_expr_var_@4\endcsname #1~#2#3#4#5{ #5#1~#2#3#4#5}% +\def\XINT_expr_func_@@ #1#2#3#4~#5?% +{% + \expandafter#1\expandafter#2\romannumeral0\xintntheltnoexpand + {\xintNum{\XINT_expr_unlock#3}}{#5}#4~#5?% +}% +\def\XINT_expr_func_@@@ #1#2#3#4~#5~#6?% +{% + \expandafter#1\expandafter#2\romannumeral0\xintntheltnoexpand + {\xintNum{\XINT_expr_unlock#3}}{#6}#4~#5~#6?% +}% +\def\XINT_expr_func_@@@@ #1#2#3#4~#5~#6~#7?% +{% + \expandafter#1\expandafter#2\romannumeral0\xintntheltnoexpand + {\xintNum{\XINT_expr_unlock#3}}{#7}#4~#5~#6~#7?% +}% +\let\XINT_flexpr_func_@@\XINT_expr_func_@@ +\let\XINT_flexpr_func_@@@\XINT_expr_func_@@@ +\let\XINT_flexpr_func_@@@@\XINT_expr_func_@@@@ +\def\XINT_iiexpr_func_@@ #1#2#3#4~#5?% +{% + \expandafter#1\expandafter#2\romannumeral0\xintntheltnoexpand + {\XINT_expr_unlock#3}{#5}#4~#5?% +}% +\def\XINT_iiexpr_func_@@@ #1#2#3#4~#5~#6?% +{% + \expandafter#1\expandafter#2\romannumeral0\xintntheltnoexpand + {\XINT_expr_unlock#3}{#6}#4~#5~#6?% +}% +\def\XINT_iiexpr_func_@@@@ #1#2#3#4~#5~#6~#7?% +{% + \expandafter#1\expandafter#2\romannumeral0\xintntheltnoexpand + {\XINT_expr_unlock#3}{#7}#4~#5~#6~#7?% +}% +\catcode`? 11 +\def\XINT_tmpa #1#2#3{% + \def #1##1% \XINT_expr_op_`, #2=\XINT_expr_oparen {% \ifcsname XINT_expr_onlitteral_##1\endcsname - \expandafter\XINT_expr_funcoflitteral - \else - \expandafter #2% - \fi {##1}% - }% - \def #2##1% - {% - \ifcsname XINT_#4_func_##1\endcsname - \xint_afterfi - {\expandafter\expandafter\csname XINT_#4_func_##1\endcsname}% - \else \csname xintError:unknown `##1\string'\endcsname - \xint_afterfi{\expandafter\XINT_expr_func_unknown}% - \fi - \romannumeral-`0#3% + \xint_dothis{\csname XINT_expr_onlitteral_##1\endcsname}\fi + \ifcsname XINT_#3_func_##1\endcsname + \xint_dothis{\expandafter\expandafter + \csname XINT_#3_func_##1\endcsname\romannumeral-`0#2}\fi + \xint_orthat{\XINT_expr_unknown_function {##1}% + \expandafter\XINT_expr_func_unknown\romannumeral-`0#2}% }% }% +\def\XINT_expr_unknown_function #1{\xintError:removed \xint_gobble_i {#1}}% \xintFor #1 in {expr,flexpr,iiexpr} \do {% \expandafter\XINT_tmpa - \csname XINT_#1_op_@\expandafter\endcsname - \csname XINT_#1_op_@@\expandafter\endcsname - \csname XINT_#1_oparen\endcsname {#1}% -}% -\def\XINT_expr_funcoflitteral #1% -{% - \expandafter\expandafter\csname XINT_expr_onlitteral_#1\endcsname - \romannumeral-`0\XINT_expr_scanfunc -}% -\def\XINT_expr_onlitteral_bool #1#2#3{\expandafter\XINT_expr_getop - \csname .=\xintBool{#3}\endcsname }% -\def\XINT_expr_onlitteral_togl #1#2#3{\expandafter\XINT_expr_getop - \csname .=\xintToggle{#3}\endcsname }% -\def\XINT_expr_func_unknown #1#2#3% 1.09i removes [0], because \xintiiexpr - {\expandafter #1\expandafter #2\csname .=0\endcsname }% -\def\XINT_expr_func_reduce #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintIrr {\XINT_expr_unlock #3}\endcsname -}% -\let\XINT_flexpr_func_reduce\XINT_expr_func_reduce -\def\XINT_expr_func_frac #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintTFrac {\XINT_expr_unlock #3}\endcsname -}% -\def\XINT_flexpr_func_frac #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\XINTinFloatFrac [\XINTdigits]{\XINT_expr_unlock #3}\endcsname -}% -\def\XINT_expr_func_sqr #1#2#3% + \csname XINT_#1_op_`\expandafter\endcsname + \csname XINT_#1_oparen\endcsname + {#1}% +}% +\expandafter\def\csname XINT_expr_onlitteral_`\endcsname #1#2#3({\xint_c_xviii `{#2}}% +\def\XINT_expr_onlitteral_bool #1)% + {\expandafter\XINT_expr_getop\csname .=\xintBool{#1}\endcsname }% +\def\XINT_expr_onlitteral_togl #1)% + {\expandafter\XINT_expr_getop\csname .=\xintToggle{#1}\endcsname }% +\def\XINT_expr_onlitteral_protect #1)% + {\expandafter\XINT_expr_getop\csname .=\detokenize{#1}\endcsname }% +\def\XINT_expr_func_unknown #1#2#3{\expandafter #1\expandafter #2\csname .=0\endcsname }% +\def\XINT_expr_func_break #1#2#3% +{\expandafter #1\expandafter #2\csname.=?\romannumeral-`0\XINT_expr_unlock #3\endcsname }% +\let\XINT_flexpr_func_break \XINT_expr_func_break +\let\XINT_iiexpr_func_break \XINT_expr_func_break +\def\XINT_expr_onlitteral_seq + {\expandafter\XINT_expr_onlitteral_seq_f\romannumeral-`0\XINT_expr_onlitteral_seq_a {}}% +\def\XINT_expr_onlitteral_seq_f #1#2{\xint_c_xviii `{seqx}#2)\relax #1}% +\def\XINT_expr_onlitteral_seq_a #1#2,% +{% checks balancing of parentheses + \ifcase\XINT_isbalanced_a \relax #1#2(\xint_bye)\xint_bye + \expandafter\XINT_expr_onlitteral_seq_c + \or\expandafter\XINT_expr_onlitteral_seq_b + \else\expandafter\xintError:we_are_doomed + \fi {#1#2},% +}% +\def\XINT_expr_onlitteral_seq_b #1,{\XINT_expr_onlitteral_seq_a {#1,}}% +\def\XINT_expr_onlitteral_seq_c #1,#2#3% #3 pour absorber le = +{% + \XINT_expr_onlitteral_seq_d {#2{#1}}{}% +}% +\def\XINT_expr_onlitteral_seq_d #1#2#3)% +{% + \ifcase\XINT_isbalanced_a \relax #2#3(\xint_bye)\xint_bye + \or\expandafter\XINT_expr_onlitteral_seq_e + \else\expandafter\xintError:we_are_doomed + \fi + {#1}{#2#3}% +}% +\def\XINT_expr_onlitteral_seq_e #1#2{\XINT_expr_onlitteral_seq_d {#1}{#2)}}% +\def\XINT_isbalanced_a #1({\XINT_isbalanced_b #1)\xint_bye }% +\def\XINT_isbalanced_b #1)#2% + {\xint_bye #2\XINT_isbalanced_c\xint_bye\XINT_isbalanced_error }% +\def\XINT_isbalanced_error #1)\xint_bye {\m@ne}% +\def\XINT_isbalanced_c\xint_bye\XINT_isbalanced_error #1% + {\xint_bye #1\XINT_isbalanced_yes\xint_bye\XINT_isbalanced_d #1}% +\def\XINT_isbalanced_yes\xint_bye\XINT_isbalanced_d\xint_bye )\xint_bye {\xint_c_ }% +\def\XINT_isbalanced_d #1)#2% + {\xint_bye #2\XINT_isbalanced_no\xint_bye\XINT_isbalanced_a #1#2}% +\def\XINT_isbalanced_no\xint_bye #1\xint_bye\xint_bye {\xint_c_i }% +\def\XINT_expr_func_seqx #1#2{\XINT_allexpr_seqx \xintbareeval }% +\def\XINT_flexpr_func_seqx #1#2{\XINT_allexpr_seqx \xintbarefloateval}% +\def\XINT_iiexpr_func_seqx #1#2{\XINT_allexpr_seqx \xintbareiieval }% +\def\XINT_allexpr_seqx #1#2#3#4% #2 is the index list, fully evaluated and encapsulated +{% #3 is the Latin letter serving as dummy variable, #4 is the expression to evaluate + \expandafter \XINT_expr_getop + \csname .=\expandafter\XINT_expr_seq:_aa + \romannumeral-`0\XINT_expr_unlock #2!{#1#4\relax !#3},^,\endcsname +}% +\def\XINT_expr_seq:_aa #1{\if +#1\expandafter\XINT_expr_seq:_A\else + \expandafter\XINT_expr_seq:_a\fi #1}% +\def\XINT_expr_seq:_a #1!#2{\expandafter\XINT_expr_seq_empty? + \romannumeral0\XINT_expr_seq:_b {#2}#1}% +\def\XINT_expr_seq:_b #1#2,{\XINT_expr_seq:_c #2,{#1}}% +\def\XINT_expr_seq:_c #1{\if ,#1\xint_dothis\XINT_expr_seq:_noop\fi + \if ^#1\xint_dothis\XINT_expr_seq:_end\fi + \xint_orthat\XINT_expr_seq:_d #1}% +\def\XINT_expr_seq:_d #1,#2{\expandafter\XINT_expr_seq:_e + \romannumeral-`0\expandafter\XINT_expr_unlock\romannumeral0#2{#1}{#2}}% +\def\XINT_expr_seq:_e #1{\if #1^\xint_dothis\XINT_expr_seq:_abort\fi + \if #1?\xint_dothis\XINT_expr_seq:_break\fi + \if #1!\xint_dothis\XINT_expr_seq:_omit\fi + \xint_orthat{\XINT_expr_seq:_goon #1}}% +\def\XINT_expr_seq:_goon #1!#2#3#4{,#1\XINT_expr_seq:_b {#4}}% +\def\XINT_expr_seq:_omit #1!#2#3#4{\XINT_expr_seq:_b {#4}}% +\def\XINT_expr_seq:_abort #1!#2#3#4#5^,{}% +\def\XINT_expr_seq:_break #1!#2#3#4#5^,{,#1}% +\def\XINT_expr_seq:_noop ,#1{\XINT_expr_seq:_b {#1}}% +\def\XINT_expr_seq:_end ^,#1{}% if all is omit, _empty? constructs "nil" +\def\XINT_expr_seq_empty? #1{% +\def\XINT_expr_seq_empty? ##1{\if ,##1\expandafter\xint_gobble_i\fi #1\endcsname }}% +\XINT_expr_seq_empty? { }% +\def\XINT_expr_seq:_A +#1!#2,^,% + {\expandafter\XINT_expr_seq_empty?\romannumeral0\XINT_expr_seq:_D {#1}{#2}}% +\def\XINT_expr_seq:_D #1#2{\expandafter\XINT_expr_seq:_E + \romannumeral-`0\expandafter\XINT_expr_unlock\romannumeral0#2{#1}{#2}}% +\def\XINT_expr_seq:_E #1{\if #1^\xint_dothis\XINT_expr_seq:_Abort\fi + \if #1?\xint_dothis\XINT_expr_seq:_Break\fi + \if #1!\xint_dothis\XINT_expr_seq:_Omit\fi + \xint_orthat{\XINT_expr_seq:_Goon #1}}% +\def\XINT_expr_seq:_Goon #1!#2#3#4% + {,#1\expandafter\XINT_expr_seq:_D\expandafter{\the\numexpr #3+\xint_c_i}{#4}}% +\def\XINT_expr_seq:_Omit #1!#2#3#4% + {\expandafter\XINT_expr_seq:_D\expandafter{\the\numexpr #3+\xint_c_i}{#4}}% +\def\XINT_expr_seq:_Abort #1!#2#3#4{}% +\def\XINT_expr_seq:_Break #1!#2#3#4{,#1}% +\def\XINT_expr_onlitteral_add + {\expandafter\XINT_expr_onlitteral_add_f\romannumeral-`0\XINT_expr_onlitteral_seq_a {}}% +\def\XINT_expr_onlitteral_add_f #1#2{\xint_c_xviii `{opx}#2)\relax #1+}% +\def\XINT_expr_onlitteral_mul + {\expandafter\XINT_expr_onlitteral_mul_f\romannumeral-`0\XINT_expr_onlitteral_seq_a {}}% +\def\XINT_expr_onlitteral_mul_f #1#2{\xint_c_xviii `{opx}#2)\relax #1*}% +\expandafter\edef\csname XINT_expr_op:_+\endcsname + {\noexpand\xint_gobble_v {}{}{}\expandafter\noexpand\csname .=0\endcsname}% +\expandafter\edef\csname XINT_expr_op:_*\endcsname + {\noexpand\xint_gobble_v {}{}{}\expandafter\noexpand\csname .=1\endcsname}% +\def\XINT_expr_func_opx #1#2{\XINT_allexpr_opx \xintexpr }% +\def\XINT_flexpr_func_opx #1#2{\XINT_allexpr_opx \xintfloatexpr }% +\def\XINT_iiexpr_func_opx #1#2{\XINT_allexpr_opx \xintiiexpr }% +\def\XINT_allexpr_opx #1#2#3#4#5% +{% au d^^e9part on avait op(#4,#3=#2 (^^e9valu^^e9 ici)) #3=la variable, #4=expression, #5=+ ou*. + \expandafter\XINT_expr_getop\romannumeral0\expandafter\XINT_expr_op:_a + \csname XINT_expr_op:_#5\expandafter\endcsname + \romannumeral-`0\XINT_expr_unlock #2!#5#1#3{#4}% +}% +\def\XINT_expr_op:_a #1#2!#3#4#5#6{\XINT_expr_op:_b {#1#4#3{#6\relax\relax !#5}}#2,^,}% +\def\XINT_expr_op:_b #1#2,{\XINT_expr_op:_c #2,#1}% +\def\XINT_expr_op:_c #1{\if ,#1\xint_dothis\XINT_expr_op:_noop\fi + \if ^#1\xint_dothis\XINT_expr_op:_end\fi + \xint_orthat\XINT_expr_op:_d #1}% +\def\XINT_expr_op:_noop #1,#2#3#4#5{\XINT_expr_op:_b {{#2}#3#4{#5}}}% +\def\XINT_expr_op:_d #1,#2#3#4#5% + {\expandafter\expandafter\expandafter\XINT_expr_op:_e #3#2#4#3#5{#1}{#3#4{#5}}}% +\def\XINT_expr_op:_e !#1!#2#3#4{\XINT_expr_op:_b {{!#1}#4}}% +\def\XINT_expr_op:_end ^,#1#2#3#4{\expandafter\expandafter\expandafter\space + \expandafter\xint_gobble_iv #1}% +\def\XINT_expr_onlitteral_subs + {\expandafter\XINT_expr_onlitteral_subs_f\romannumeral-`0\XINT_expr_onlitteral_seq_a {}}% +\def\XINT_expr_onlitteral_subs_f #1#2{\xint_c_xviii `{subx}#2)\relax #1}% +\def\XINT_expr_func_subx #1#2{\XINT_allexpr_subx \xintbareeval }% +\def\XINT_flexpr_func_subx #1#2{\XINT_allexpr_subx \xintbarefloateval}% +\def\XINT_iiexpr_func_subx #1#2{\XINT_allexpr_subx \xintbareiieval }% +\def\XINT_allexpr_subx #1#2#3#4% #2 is the value to assign to the dummy variable +{% #3 is the dummy variable, #4 is the expression to evaluate + \expandafter \XINT_expr_getop + \csname .=\expandafter\XINT_expr_subx:_a + \romannumeral-`0\XINT_expr_unlock #2!{#1#4\relax !#3}\endcsname +}% +\def\XINT_expr_subx:_a #1!#2% 10/25 that was a quick addition! + {\expandafter\XINT_expr_subx:_end \romannumeral0#2{#1}}% +\def\XINT_expr_subx:_end #1!#2#3{\XINT_expr_unlock #1}% +\def\XINT_expr_func_rseq {\XINT_allexpr_rseq \xintbareeval }% +\def\XINT_flexpr_func_rseq {\XINT_allexpr_rseq \xintbarefloateval }% +\def\XINT_iiexpr_func_rseq {\XINT_allexpr_rseq \xintbareiieval }% +\def\XINT_allexpr_rseq #1#2% +{% + \expandafter\XINT_expr_rseqx\expandafter #1\expandafter + #2\romannumeral-`0\XINT_expr_onlitteral_seq_a {}% +}% +\def\XINT_expr_rseqx #1#2#3#4% +{% + \expandafter\XINT_expr_rseqy\romannumeral0#1(#4)\relax + #2#3#1% +}% +\def\XINT_expr_rseqy #1#2#3#4#5% #1=valeurs pour variable (locked), + % #2=toutes les valeurs initiales (csv,locked), + % #3=variable, #4=expr, + % #5=\xintbareeval ou \xintbarefloateval ou \xintbareiieval +{% + \expandafter \XINT_expr_getop + \csname .=\XINT_expr_unlock #2% + \expandafter\XINT_expr_rseq:_aa + \romannumeral-`0\XINT_expr_unlock #1!{#5#4\relax !#3}#2,^,\endcsname +}% +\def\XINT_expr_rseq:_aa #1{\if +#1\expandafter\XINT_expr_rseq:_A\else + \expandafter\XINT_expr_rseq:_a\fi #1}% +\def\XINT_expr_rseq:_a #1!#2#3{\XINT_expr_rseq:_b #3{#2}#1}% +\def\XINT_expr_rseq:_b #1#2#3,{\XINT_expr_rseq:_c #3,~#1{#2}}% +\def\XINT_expr_rseq:_c #1{\if ,#1\xint_dothis\XINT_expr_rseq:_noop\fi + \if ^#1\xint_dothis\XINT_expr_rseq:_end\fi + \xint_orthat\XINT_expr_rseq:_d #1}% +\def\XINT_expr_rseq:_d #1,~#2#3{\expandafter\XINT_expr_rseq:_e + \romannumeral-`0\expandafter\XINT_expr_unlock\romannumeral0#3{#1}~#2{#3}}% +\def\XINT_expr_rseq:_e #1{% + \if ^#1\xint_dothis\XINT_expr_rseq:_abort\fi + \if ?#1\xint_dothis\XINT_expr_rseq:_break\fi + \if !#1\xint_dothis\XINT_expr_rseq:_omit\fi + \xint_orthat{\XINT_expr_rseq:_goon #1}}% +\def\XINT_expr_rseq:_goon #1!#2#3~#4#5{,#1\expandafter\XINT_expr_rseq:_b + \romannumeral0\XINT_expr_lockit {#1}{#5}}% +\def\XINT_expr_rseq:_omit #1!#2#3~{\XINT_expr_rseq:_b }% +\def\XINT_expr_rseq:_abort #1!#2#3~#4#5#6^,{}% +\def\XINT_expr_rseq:_break #1!#2#3~#4#5#6^,{,#1}% +\def\XINT_expr_rseq:_noop ,~#1#2{\XINT_expr_rseq:_b #1{#2}}% +\def\XINT_expr_rseq:_end ^,~#1#2{}% no nil for rseq +\def\XINT_expr_rseq:_A +#1!#2#3,^,{\XINT_expr_rseq:_D {#1}#3{#2}}% +\def\XINT_expr_rseq:_D #1#2#3{\expandafter\XINT_expr_rseq:_E + \romannumeral-`0\expandafter\XINT_expr_unlock\romannumeral0#3{#1}~#2{#3}}% +\def\XINT_expr_rseq:_E #1{\if #1^\xint_dothis\XINT_expr_rseq:_Abort\fi + \if #1?\xint_dothis\XINT_expr_rseq:_Break\fi + \if #1!\xint_dothis\XINT_expr_rseq:_Omit\fi + \xint_orthat{\XINT_expr_rseq:_Goon #1}}% +\def\XINT_expr_rseq:_Goon #1!#2#3~#4#5% + {,#1\expandafter\XINT_expr_rseq:_D\expandafter{\the\numexpr #3+\xint_c_i\expandafter}% + \romannumeral0\XINT_expr_lockit{#1}{#5}}% +\def\XINT_expr_rseq:_Omit #1!#2#3~%#4#5% + {\expandafter\XINT_expr_rseq:_D\expandafter{\the\numexpr #3+\xint_c_i}}% +\def\XINT_expr_rseq:_Abort #1!#2#3~#4#5{}% +\def\XINT_expr_rseq:_Break #1!#2#3~#4#5{,#1}% +\def\XINT_expr_func_rrseq {\XINT_allexpr_rrseq \xintbareeval }% +\def\XINT_flexpr_func_rrseq {\XINT_allexpr_rrseq \xintbarefloateval }% +\def\XINT_iiexpr_func_rrseq {\XINT_allexpr_rrseq \xintbareiieval }% +\def\XINT_allexpr_rrseq #1#2% +{% + \expandafter\XINT_expr_rrseqx\expandafter #1\expandafter + #2\romannumeral-`0\XINT_expr_onlitteral_seq_a {}% +}% +\def\XINT_expr_rrseqx #1#2#3#4% +{% + \expandafter\XINT_expr_rrseqy\romannumeral0#1(#4)\expandafter\relax + \expandafter{\romannumeral0\xintapply \XINT_expr_lockit + {\xintRevWithBraces{\xintCSVtoListNonStripped{\XINT_expr_unlock #2}}}}% + #2#3#1% +}% +\def\XINT_expr_rrseqy #1#2#3#4#5#6% #1=valeurs pour variable (locked), + % #2=initial values (reversed, one (braced) token each) + % #3=toutes les valeurs initiales (csv,locked), + % #4=variable, #5=expr, + % #6=\xintbareeval ou \xintbarefloateval ou \xintbareiieval +{% + \expandafter \XINT_expr_getop + \csname .=\XINT_expr_unlock #3% + \expandafter\XINT_expr_rrseq:_aa + \romannumeral-`0\XINT_expr_unlock #1!{#6#5\relax !#4}{#2},^,\endcsname +}% +\def\XINT_expr_rrseq:_aa #1{\if +#1\expandafter\XINT_expr_rrseq:_A\else + \expandafter\XINT_expr_rrseq:_a\fi #1}% +\catcode`? 3 +\def\XINT_expr_rrseq:_a #1!#2#3{\XINT_expr_rrseq:_b {#3}{#2}#1}% +\def\XINT_expr_rrseq:_b #1#2#3,{\XINT_expr_rrseq:_c #3,~#1?{#2}}% +\def\XINT_expr_rrseq:_c #1{\if ,#1\xint_dothis\XINT_expr_rrseq:_noop\fi + \if ^#1\xint_dothis\XINT_expr_rrseq:_end\fi + \xint_orthat\XINT_expr_rrseq:_d #1}% +\def\XINT_expr_rrseq:_d #1,~#2?#3{\expandafter\XINT_expr_rrseq:_e + \romannumeral-`0\expandafter\XINT_expr_unlock\romannumeral0#3{#1}~#2?{#3}}% +\def\XINT_expr_rrseq:_goon #1!#2#3~#4?#5{,#1\expandafter\XINT_expr_rrseq:_b\expandafter + {\romannumeral0\xinttrim{-1}{\XINT_expr_lockit{#1}#4}}{#5}}% +\def\XINT_expr_rrseq:_omit #1!#2#3~{\XINT_expr_rrseq:_b }% +\def\XINT_expr_rrseq:_abort #1!#2#3~#4?#5#6^,{}% +\def\XINT_expr_rrseq:_break #1!#2#3~#4?#5#6^,{,#1}% +\def\XINT_expr_rrseq:_noop ,~#1?#2{\XINT_expr_rrseq:_b {#1}{#2}}% +\def\XINT_expr_rrseq:_end ^,~#1?#2{}% No nil for rrseq. +\catcode`? 11 +\def\XINT_expr_rrseq:_e #1{% + \if ^#1\xint_dothis\XINT_expr_rrseq:_abort\fi + \if ?#1\xint_dothis\XINT_expr_rrseq:_break\fi + \if !#1\xint_dothis\XINT_expr_rrseq:_omit\fi + \xint_orthat{\XINT_expr_rrseq:_goon #1}% +}% +\catcode`? 3 +\def\XINT_expr_rrseq:_A +#1!#2#3,^,{\XINT_expr_rrseq:_D {#1}{#3}{#2}}% +\def\XINT_expr_rrseq:_D #1#2#3{\expandafter\XINT_expr_rrseq:_E + \romannumeral-`0\expandafter\XINT_expr_unlock\romannumeral0#3{#1}~#2?{#3}}% +\def\XINT_expr_rrseq:_Goon #1!#2#3~#4?#5% + {,#1\expandafter\XINT_expr_rrseq:_D\expandafter{\the\numexpr #3+\xint_c_i\expandafter}% + \expandafter{\romannumeral0\xinttrim{-1}{\XINT_expr_lockit{#1}#4}}{#5}}% +\def\XINT_expr_rrseq:_Omit #1!#2#3~%#4?#5% + {\expandafter\XINT_expr_rrseq:_D\expandafter{\the\numexpr #3+\xint_c_i}}% +\def\XINT_expr_rrseq:_Abort #1!#2#3~#4?#5{}% +\def\XINT_expr_rrseq:_Break #1!#2#3~#4?#5{,#1}% +\catcode`? 11 +\def\XINT_expr_rrseq:_E #1{\if #1^\xint_dothis\XINT_expr_rrseq:_Abort\fi + \if #1?\xint_dothis\XINT_expr_rrseq:_Break\fi + \if #1!\xint_dothis\XINT_expr_rrseq:_Omit\fi + \xint_orthat{\XINT_expr_rrseq:_Goon #1}}% +\def\XINT_expr_func_iter {\XINT_allexpr_iter \xintbareeval }% +\def\XINT_flexpr_func_iter {\XINT_allexpr_iter \xintbarefloateval }% +\def\XINT_iiexpr_func_iter {\XINT_allexpr_iter \xintbareiieval }% +\def\XINT_allexpr_iter #1#2% +{% + \expandafter\XINT_expr_iterx\expandafter #1\expandafter + #2\romannumeral-`0\XINT_expr_onlitteral_seq_a {}% +}% +\def\XINT_expr_iterx #1#2#3#4% +{% + \expandafter\XINT_expr_itery\romannumeral0#1(#4)\expandafter\relax + \expandafter{\romannumeral0\xintapply \XINT_expr_lockit + {\xintRevWithBraces{\xintCSVtoListNonStripped{\XINT_expr_unlock #2}}}}% + #2#3#1% +}% +\def\XINT_expr_itery #1#2#3#4#5#6% #1=valeurs pour variable (locked), + % #2=initial values (reversed, one (braced) token each) + % #3=toutes les valeurs initiales (csv,locked), + % #4=variable, #5=expr, + % #6=\xintbareeval ou \xintbarefloateval ou \xintbareiieval +{% + \expandafter \XINT_expr_getop + \csname .=% + \expandafter\XINT_expr_iter:_aa + \romannumeral-`0\XINT_expr_unlock #1!{#6#5\relax !#4}{#2},^,\endcsname +}% +\def\XINT_expr_iter:_aa #1{\if +#1\expandafter\XINT_expr_iter:_A\else + \expandafter\XINT_expr_iter:_a\fi #1}% +\catcode`? 3 +\def\XINT_expr_iter:_a #1!#2#3{\XINT_expr_iter:_b {#3}{#2}#1}% +\def\XINT_expr_iter:_b #1#2#3,{\XINT_expr_iter:_c #3,~#1?{#2}}% +\def\XINT_expr_iter:_c #1{\if ,#1\xint_dothis\XINT_expr_iter:_noop\fi + \if ^#1\xint_dothis\XINT_expr_iter:_end\fi + \xint_orthat\XINT_expr_iter:_d #1}% +\def\XINT_expr_iter:_d #1,~#2?#3{\expandafter\XINT_expr_iter:_e + \romannumeral-`0\expandafter\XINT_expr_unlock\romannumeral0#3{#1}~#2?{#3}}% +\def\XINT_expr_iter:_goon #1!#2#3~#4?#5{\expandafter\XINT_expr_iter:_b\expandafter + {\romannumeral0\xinttrim{-1}{\XINT_expr_lockit{#1}#4}}{#5}}% +\def\XINT_expr_iter:_omit #1!#2#3~{\XINT_expr_iter:_b }% +\def\XINT_expr_iter:_abort #1!#2#3~#4?#5#6^,% + {\expandafter\xint_gobble_i\romannumeral0\xintapplyunbraced + {,\XINT_expr:_unlock}{\xintReverseOrder{#4\space}}}% +\def\XINT_expr_iter:_break #1!#2#3~#4?#5#6^,% + {\expandafter\xint_gobble_iv\romannumeral0\xintapplyunbraced + {,\XINT_expr:_unlock}{\xintReverseOrder{#4\space}},#1}% +\def\XINT_expr_iter:_noop ,~#1?#2{\XINT_expr_iter:_b {#1}{#2}}% +\def\XINT_expr_iter:_end ^,~#1?#2% + {\expandafter\xint_gobble_i\romannumeral0\xintapplyunbraced + {,\XINT_expr:_unlock}{\xintReverseOrder{#1\space}}}% +\catcode`? 11 +\def\XINT_expr_iter:_e #1{% + \if ^#1\xint_dothis\XINT_expr_iter:_abort\fi + \if ?#1\xint_dothis\XINT_expr_iter:_break\fi + \if !#1\xint_dothis\XINT_expr_iter:_omit\fi + \xint_orthat{\XINT_expr_iter:_goon #1}% +}% +\def\XINT_expr:_unlock #1{\XINT_expr_unlock #1}% +\catcode`? 3 +\def\XINT_expr_iter:_A +#1!#2#3,^,{\XINT_expr_iter:_D {#1}{#3}{#2}}% +\def\XINT_expr_iter:_D #1#2#3{\expandafter\XINT_expr_iter:_E + \romannumeral-`0\expandafter\XINT_expr_unlock\romannumeral0#3{#1}~#2?{#3}}% +\def\XINT_expr_iter:_Goon #1!#2#3~#4?#5% + {\expandafter\XINT_expr_iter:_D\expandafter{\the\numexpr #3+\xint_c_i\expandafter}% + \expandafter{\romannumeral0\xinttrim{-1}{\XINT_expr_lockit{#1}#4}}{#5}}% +\def\XINT_expr_iter:_Omit #1!#2#3~%#4?#5% + {\expandafter\XINT_expr_iter:_D\expandafter{\the\numexpr #3+\xint_c_i}}% +\def\XINT_expr_iter:_Abort #1!#2#3~#4?#5% + {\expandafter\xint_gobble_i\romannumeral0\xintapplyunbraced + {,\XINT_expr:_unlock}{\xintReverseOrder{#4\space}}}% +\def\XINT_expr_iter:_Break #1!#2#3~#4?#5% + {\expandafter\xint_gobble_iv\romannumeral0\xintapplyunbraced + {,\XINT_expr:_unlock}{\xintReverseOrder{#4\space}},#1}% +\catcode`? 11 +\def\XINT_expr_iter:_E #1{\if #1^\xint_dothis\XINT_expr_iter:_Abort\fi + \if #1?\xint_dothis\XINT_expr_iter:_Break\fi + \if #1!\xint_dothis\XINT_expr_iter:_Omit\fi + \xint_orthat{\XINT_expr_iter:_Goon #1}}% +\def\xintANDof:csv #1{\expandafter\XINT_andof:_a\romannumeral-`0#1,,^}% +\def\XINT_andof:_a #1{\if ,#1\expandafter\XINT_andof:_e + \else\expandafter\XINT_andof:_c\fi #1}% +\def\XINT_andof:_c #1,{\xintiiifNotZero {#1}{\XINT_andof:_a}{\XINT_andof:_no}}% +\def\XINT_andof:_no #1^{0}% +\def\XINT_andof:_e #1^{1}% works with empty list +\def\xintORof:csv #1{\expandafter\XINT_orof:_a\romannumeral-`0#1,,^}% +\def\XINT_orof:_a #1{\if ,#1\expandafter\XINT_orof:_e + \else\expandafter\XINT_orof:_c\fi #1}% +\def\XINT_orof:_c #1,{\xintiiifNotZero{#1}{\XINT_orof:_yes}{\XINT_orof:_a}}% +\def\XINT_orof:_yes #1^{1}% +\def\XINT_orof:_e #1^{0}% works with empty list +\def\xintXORof:csv #1{\expandafter\XINT_xorof:_a\expandafter 0\romannumeral-`0#1,,^}% +\def\XINT_xorof:_a #1#2,{\XINT_xorof:_b #2,#1}% +\def\XINT_xorof:_b #1{\if ,#1\expandafter\XINT_xorof:_e + \else\expandafter\XINT_xorof:_c\fi #1}% +\def\XINT_xorof:_c #1,#2% + {\xintiiifNotZero {#1}{\if #20\xint_afterfi{\XINT_xorof:_a 1}% + \else\xint_afterfi{\XINT_xorof:_a 0}\fi}% + {\XINT_xorof:_a #2}% + }% +\def\XINT_xorof:_e ,#1#2^{#1}% allows empty list (then returns 0) +\def\XINT_oncsv:_empty #1,^,#2{#2}% +\def\XINT_oncsv:_end ^,#1#2#3#4{#1}% +\def\XINT_oncsv:_a #1#2#3% + {\if ,#3\expandafter\XINT_oncsv:_empty\else\expandafter\XINT_oncsv:_b\fi #1#2#3}% +\def\XINT_oncsv:_b #1#2#3,% + {\expandafter\XINT_oncsv:_c \expandafter{\romannumeral-`0#2{#3}}#1#2}% +\def\XINT_oncsv:_c #1#2#3#4,{\expandafter\XINT_oncsv:_d \romannumeral-`0#4,{#1}#2#3}% +\def\XINT_oncsv:_d #1% + {\if ^#1\expandafter\XINT_oncsv:_end\else\expandafter\XINT_oncsv:_e\fi #1}% +\def\XINT_oncsv:_e #1,#2#3#4% + {\expandafter\XINT_oncsv:_c\expandafter {\romannumeral-`0#3{#4{#1}}{#2}}#3#4}% +\def\xintMaxof:csv #1{\expandafter\XINT_oncsv:_a\expandafter\xintmax + \expandafter\xint_firstofone\romannumeral-`0#1,^,{0/1[0]}}% +\def\xintiiMaxof:csv #1{\expandafter\XINT_oncsv:_a\expandafter\xintiimax + \expandafter\xint_firstofone\romannumeral-`0#1,^,0}% +\def\xintMinof:csv #1{\expandafter\XINT_oncsv:_a\expandafter\xintmin + \expandafter\xint_firstofone\romannumeral-`0#1,^,{0/1[0]}}% +\def\xintiiMinof:csv #1{\expandafter\XINT_oncsv:_a\expandafter\xintiimin + \expandafter\xint_firstofone\romannumeral-`0#1,^,0}% +\def\xintSum:csv #1{\expandafter\XINT_oncsv:_a\expandafter\xintadd + \expandafter\xint_firstofone\romannumeral-`0#1,^,{0/1[0]}}% +\def\xintiiSum:csv #1{\expandafter\XINT_oncsv:_a\expandafter\xintiiadd + \expandafter\xint_firstofone\romannumeral-`0#1,^,0}% +\def\xintPrd:csv #1{\expandafter\XINT_oncsv:_a\expandafter\xintmul + \expandafter\xint_firstofone\romannumeral-`0#1,^,{1/1[0]}}% +\def\xintiiPrd:csv #1{\expandafter\XINT_oncsv:_a\expandafter\xintiimul + \expandafter\xint_firstofone\romannumeral-`0#1,^,1}% +\def\xintGCDof:csv #1{\expandafter\XINT_oncsv:_a\expandafter\xintgcd + \expandafter\xint_firstofone\romannumeral-`0#1,^,1}% +\def\xintLCMof:csv #1{\expandafter\XINT_oncsv:_a\expandafter\xintlcm + \expandafter\xint_firstofone\romannumeral-`0#1,^,0}% +\def\XINTinFloatdigits {\XINTinFloat [\XINTdigits]}% +\def\XINTinFloatSqrtdigits {\XINTinFloatSqrt [\XINTdigits]}% +\def\XINTinFloatMaxof:csv #1{\expandafter\XINT_oncsv:_a\expandafter\xintmax + \expandafter\XINTinFloatdigits\romannumeral-`0#1,^,{0[0]}}% +\def\XINTinFloatMinof:csv #1{\expandafter\XINT_oncsv:_a\expandafter\xintmin + \expandafter\XINTinFloatdigits\romannumeral-`0#1,^,{0[0]}}% +\def\XINTinFloatSum:csv #1{\expandafter\XINT_oncsv:_a\expandafter\XINTinfloatadd + \expandafter\XINTinFloatdigits\romannumeral-`0#1,^,{0[0]}}% +\def\XINTinFloatPrd:csv #1{\expandafter\XINT_oncsv:_a\expandafter\XINTinfloatmul + \expandafter\XINTinFloatdigits\romannumeral-`0#1,^,{1[0]}}% +\def\XINT_expr_twoargs #1,#2,{{#1}{#2}}% +\def\XINT_expr_argandopt #1,#2,#3.#4#5% {% - \expandafter #1\expandafter #2\csname - .=\xintSqr {\XINT_expr_unlock #3}\endcsname + \if\relax#3\relax\expandafter\xint_firstoftwo\else + \expandafter\xint_secondoftwo\fi + {#4}{#5[\xintNum {#2}]}{#1}% }% -\def\XINT_flexpr_func_sqr #1#2#3% +\def\XINT_expr_oneortwo #1#2#3,#4,#5.% {% - \expandafter #1\expandafter #2\csname - .=\XINTinFloatMul [\XINTdigits]% - {\XINT_expr_unlock #3}{\XINT_expr_unlock #3}\endcsname + \if\relax#5\relax\expandafter\xint_firstoftwo\else + \expandafter\xint_secondoftwo\fi + {#1{0}}{#2{\xintNum {#4}}}{#3}% }% -\def\XINT_iiexpr_func_sqr #1#2#3% +\def\XINT_iiexpr_oneortwo #1#2,#3,#4.% {% - \expandafter #1\expandafter #2\csname - .=\xintiiSqr {\XINT_expr_unlock #3}\endcsname + \if\relax#4\relax\expandafter\xint_firstoftwo\else + \expandafter\xint_secondoftwo\fi + {#1{0}}{#1{#3}}{#2}% }% +\def\XINT_expr_func_num #1#2#3% + {\expandafter #1\expandafter #2\csname.=\xintNum {\XINT_expr_unlock #3}\endcsname }% +\let\XINT_flexpr_func_num\XINT_expr_func_num +\let\XINT_iiexpr_func_num\XINT_expr_func_num +\def\XINT_expr_func_reduce #1#2#3% + {\expandafter #1\expandafter #2\csname.=\xintIrr {\XINT_expr_unlock #3}[0]\endcsname }% +\let\XINT_flexpr_func_reduce\XINT_expr_func_reduce \def\XINT_expr_func_abs #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintAbs {\XINT_expr_unlock #3}\endcsname -}% + {\expandafter #1\expandafter #2\csname.=\xintAbs {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_abs\XINT_expr_func_abs \def\XINT_iiexpr_func_abs #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintiiAbs {\XINT_expr_unlock #3}\endcsname -}% + {\expandafter #1\expandafter #2\csname.=\xintiiAbs {\XINT_expr_unlock #3}\endcsname }% \def\XINT_expr_func_sgn #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintSgn {\XINT_expr_unlock #3}\endcsname -}% + {\expandafter #1\expandafter #2\csname.=\xintSgn {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_sgn\XINT_expr_func_sgn \def\XINT_iiexpr_func_sgn #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintiiSgn {\XINT_expr_unlock #3}\endcsname -}% + {\expandafter #1\expandafter #2\csname.=\xintiiSgn {\XINT_expr_unlock #3}\endcsname }% +\def\XINT_expr_func_frac #1#2#3% + {\expandafter #1\expandafter #2\csname.=\xintTFrac {\XINT_expr_unlock #3}\endcsname }% +\def\XINT_flexpr_func_frac #1#2#3{\expandafter #1\expandafter #2\csname + .=\XINTinFloatFrac {\XINT_expr_unlock #3}\endcsname }% \def\XINT_expr_func_floor #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintFloor {\XINT_expr_unlock #3}\endcsname -}% + {\expandafter #1\expandafter #2\csname .=\xintFloor {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_floor\XINT_expr_func_floor -\let\XINT_iiexpr_func_floor\XINT_expr_func_floor +\def\XINT_iiexpr_func_floor #1#2#3% +{% mais absurde si on ne peut pas avoir quotient comme input + \expandafter #1\expandafter #2\csname.=\xintiFloor {\XINT_expr_unlock #3}\endcsname }% \def\XINT_expr_func_ceil #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintCeil {\XINT_expr_unlock #3}\endcsname -}% + {\expandafter #1\expandafter #2\csname .=\xintCeil {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_ceil\XINT_expr_func_ceil -\let\XINT_iiexpr_func_ceil\XINT_expr_func_ceil -\def\XINT_expr_twoargs #1,#2,{{#1}{#2}}% -\def\XINT_expr_func_quo #1#2#3% -{% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintQuo - \expandafter\XINT_expr_twoargs - \romannumeral-`0\XINT_expr_unlock #3,\endcsname -}% -\let\XINT_flexpr_func_quo\XINT_expr_func_quo -\def\XINT_iiexpr_func_quo #1#2#3% -{% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiiQuo - \expandafter\XINT_expr_twoargs - \romannumeral-`0\XINT_expr_unlock #3,\endcsname -}% -\def\XINT_expr_func_rem #1#2#3% +\def\XINT_iiexpr_func_ceil #1#2#3% +{% mais absurde si on ne peut pas avoir quotient comme input + \expandafter #1\expandafter #2\csname.=\xintiCeil {\XINT_expr_unlock #3}\endcsname }% +\def\XINT_expr_func_sqr #1#2#3% + {\expandafter #1\expandafter #2\csname.=\xintSqr {\XINT_expr_unlock #3}\endcsname }% +\def\XINT_flexpr_func_sqr #1#2#3% {% - \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintRem - \expandafter\XINT_expr_twoargs - \romannumeral-`0\XINT_expr_unlock #3,\endcsname + \expandafter #1\expandafter #2\csname + .=\XINTinFloatMul % [\XINTdigits]% pour simplifier mes affaires avec \xintNewExpr + {\XINT_expr_unlock #3}{\XINT_expr_unlock #3}\endcsname }% -\let\XINT_flexpr_func_rem\XINT_expr_func_rem -\def\XINT_iiexpr_func_rem #1#2#3% +\def\XINT_iiexpr_func_sqr #1#2#3% + {\expandafter #1\expandafter #2\csname.=\xintiiSqr {\XINT_expr_unlock #3}\endcsname }% +\def\XINT_expr_func_sqrt #1#2#3% {% \expandafter #1\expandafter #2\csname .=% - \expandafter\expandafter\expandafter\xintiiRem - \expandafter\XINT_expr_twoargs - \romannumeral-`0\XINT_expr_unlock #3,\endcsname -}% -\def\XINT_expr_oneortwo #1#2#3,#4,#5.% -{% - \if\relax#5\relax\expandafter\xint_firstoftwo\else - \expandafter\xint_secondoftwo\fi - {#1{0}}{#2{\xintNum {#4}}}{#3}% + \expandafter\XINT_expr_argandopt + \romannumeral-`0\XINT_expr_unlock#3,,.\XINTinFloatSqrtdigits\XINTinFloatSqrt + \endcsname }% +\let\XINT_flexpr_func_sqrt\XINT_expr_func_sqrt +\def\XINT_iiexpr_func_sqrt #1#2#3% + {\expandafter #1\expandafter #2\csname.=\xintiiSqrt {\XINT_expr_unlock #3}\endcsname }% \def\XINT_expr_func_round #1#2#3% {% \expandafter #1\expandafter #2\csname .=% @@ -833,12 +1817,6 @@ \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname }% \let\XINT_flexpr_func_round\XINT_expr_func_round -\def\XINT_iiexpr_oneortwo #1#2,#3,#4.% -{% - \if\relax#4\relax\expandafter\xint_firstoftwo\else - \expandafter\xint_secondoftwo\fi - {#1{0}}{#1{#3}}{#2}% -}% \def\XINT_iiexpr_func_round #1#2#3% {% \expandafter #1\expandafter #2\csname .=% @@ -859,226 +1837,445 @@ \expandafter\XINT_iiexpr_oneortwo\expandafter\xintiTrunc \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname }% -\def\XINT_expr_argandopt #1,#2,#3.% -{% - \if\relax#3\relax\expandafter\xint_firstoftwo\else - \expandafter\xint_secondoftwo\fi - {[\XINTdigits]}{[\xintNum {#2}]}{#1}% -}% \def\XINT_expr_func_float #1#2#3% {% \expandafter #1\expandafter #2\csname .=% - \expandafter\XINTinFloat - \romannumeral-`0\expandafter\XINT_expr_argandopt - \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname + \expandafter\XINT_expr_argandopt + \romannumeral-`0\XINT_expr_unlock #3,,.\XINTinFloatdigits\XINTinFloat + \endcsname }% \let\XINT_flexpr_func_float\XINT_expr_func_float -\def\XINT_expr_func_sqrt #1#2#3% +\def\XINT_expr_func_mod #1#2#3% {% \expandafter #1\expandafter #2\csname .=% - \expandafter\XINTinFloatSqrt - \romannumeral-`0\expandafter\XINT_expr_argandopt - \romannumeral-`0\XINT_expr_unlock #3,,.\endcsname + \expandafter\expandafter\expandafter\xintMod + \expandafter\XINT_expr_twoargs + \romannumeral-`0\XINT_expr_unlock #3,\endcsname }% -\let\XINT_flexpr_func_sqrt\XINT_expr_func_sqrt -\def\XINT_iiexpr_func_sqrt #1#2#3% +\def\XINT_flexpr_func_mod #1#2#3% {% - \expandafter #1\expandafter #2\csname - .=\xintiSqrt {\XINT_expr_unlock #3}\endcsname + \expandafter #1\expandafter #2\csname .=% + \expandafter\XINTinFloatMod + \romannumeral-`0\expandafter\XINT_expr_twoargs + \romannumeral-`0\XINT_expr_unlock #3,\endcsname }% -\def\XINT_expr_func_gcd #1#2#3% +\def\XINT_iiexpr_func_mod #1#2#3% {% - \expandafter #1\expandafter #2\csname - .=\xintGCDof:csv{\XINT_expr_unlock #3}\endcsname + \expandafter #1\expandafter #2\csname .=% + \expandafter\expandafter\expandafter\xintiiMod + \expandafter\XINT_expr_twoargs + \romannumeral-`0\XINT_expr_unlock #3,\endcsname }% -\let\XINT_flexpr_func_gcd\XINT_expr_func_gcd -\let\XINT_iiexpr_func_gcd\XINT_expr_func_gcd -\def\XINT_expr_func_lcm #1#2#3% +\def\XINT_expr_func_quo #1#2#3% {% - \expandafter #1\expandafter #2\csname - .=\xintLCMof:csv{\XINT_expr_unlock #3}\endcsname + \expandafter #1\expandafter #2\csname .=% + \expandafter\expandafter\expandafter\xintiQuo + \expandafter\XINT_expr_twoargs + \romannumeral-`0\XINT_expr_unlock #3,\endcsname }% -\let\XINT_flexpr_func_lcm\XINT_expr_func_lcm -\let\XINT_iiexpr_func_lcm\XINT_expr_func_lcm -\def\XINT_expr_func_max #1#2#3% +\let\XINT_flexpr_func_quo\XINT_expr_func_quo +\def\XINT_iiexpr_func_quo #1#2#3% {% - \expandafter #1\expandafter #2\csname - .=\xintMaxof:csv{\XINT_expr_unlock #3}\endcsname + \expandafter #1\expandafter #2\csname .=% + \expandafter\expandafter\expandafter\xintiiQuo + \expandafter\XINT_expr_twoargs + \romannumeral-`0\XINT_expr_unlock #3,\endcsname }% -\def\XINT_iiexpr_func_max #1#2#3% +\def\XINT_expr_func_rem #1#2#3% {% - \expandafter #1\expandafter #2\csname - .=\xintiMaxof:csv{\XINT_expr_unlock #3}\endcsname + \expandafter #1\expandafter #2\csname .=% + \expandafter\expandafter\expandafter\xintiRem + \expandafter\XINT_expr_twoargs + \romannumeral-`0\XINT_expr_unlock #3,\endcsname }% -\def\XINT_flexpr_func_max #1#2#3% +\let\XINT_flexpr_func_rem\XINT_expr_func_rem +\def\XINT_iiexpr_func_rem #1#2#3% {% - \expandafter #1\expandafter #2\csname - .=\XINTinFloatMaxof:csv{\XINT_expr_unlock #3}\endcsname + \expandafter #1\expandafter #2\csname .=% + \expandafter\expandafter\expandafter\xintiiRem + \expandafter\XINT_expr_twoargs + \romannumeral-`0\XINT_expr_unlock #3,\endcsname }% +\def\XINT_expr_func_gcd #1#2#3% + {\expandafter #1\expandafter #2\csname + .=\xintGCDof:csv{\XINT_expr_unlock #3}\endcsname }% +\let\XINT_flexpr_func_gcd\XINT_expr_func_gcd +\let\XINT_iiexpr_func_gcd\XINT_expr_func_gcd +\def\XINT_expr_func_lcm #1#2#3% + {\expandafter #1\expandafter #2\csname + .=\xintLCMof:csv{\XINT_expr_unlock #3}\endcsname }% +\let\XINT_flexpr_func_lcm\XINT_expr_func_lcm +\let\XINT_iiexpr_func_lcm\XINT_expr_func_lcm +\def\XINT_expr_func_max #1#2#3% + {\expandafter #1\expandafter #2\csname + .=\xintMaxof:csv{\XINT_expr_unlock #3}\endcsname }% +\def\XINT_iiexpr_func_max #1#2#3% + {\expandafter #1\expandafter #2\csname + .=\xintiiMaxof:csv{\XINT_expr_unlock #3}\endcsname }% +\def\XINT_flexpr_func_max #1#2#3% + {\expandafter #1\expandafter #2\csname + .=\XINTinFloatMaxof:csv{\XINT_expr_unlock #3}\endcsname }% \def\XINT_expr_func_min #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintMinof:csv{\XINT_expr_unlock #3}\endcsname -}% + {\expandafter #1\expandafter #2\csname + .=\xintMinof:csv{\XINT_expr_unlock #3}\endcsname }% \def\XINT_iiexpr_func_min #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintiMinof:csv{\XINT_expr_unlock #3}\endcsname -}% + {\expandafter #1\expandafter #2\csname + .=\xintiiMinof:csv{\XINT_expr_unlock #3}\endcsname }% \def\XINT_flexpr_func_min #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\XINTinFloatMinof:csv{\XINT_expr_unlock #3}\endcsname -}% -\def\XINT_expr_func_sum #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintSum:csv{\XINT_expr_unlock #3}\endcsname -}% -\def\XINT_flexpr_func_sum #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\XINTinFloatSum:csv{\XINT_expr_unlock #3}\endcsname -}% -\def\XINT_iiexpr_func_sum #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintiiSum:csv{\XINT_expr_unlock #3}\endcsname -}% -\def\XINT_expr_func_prd #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintPrd:csv{\XINT_expr_unlock #3}\endcsname -}% -\def\XINT_flexpr_func_prd #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\XINTinFloatPrd:csv{\XINT_expr_unlock #3}\endcsname -}% -\def\XINT_iiexpr_func_prd #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintiiPrd:csv{\XINT_expr_unlock #3}\endcsname -}% -\let\XINT_expr_func_add\XINT_expr_func_sum -\let\XINT_expr_func_mul\XINT_expr_func_prd -\let\XINT_flexpr_func_add\XINT_flexpr_func_sum -\let\XINT_flexpr_func_mul\XINT_flexpr_func_prd -\let\XINT_iiexpr_func_add\XINT_iiexpr_func_sum -\let\XINT_iiexpr_func_mul\XINT_iiexpr_func_prd + {\expandafter #1\expandafter #2\csname + .=\XINTinFloatMinof:csv{\XINT_expr_unlock #3}\endcsname }% +\expandafter\def\csname XINT_expr_func_+\endcsname #1#2#3% + {\expandafter #1\expandafter #2\csname + .=\xintSum:csv{\XINT_expr_unlock #3}\endcsname }% +\expandafter\def\csname XINT_flexpr_func_+\endcsname #1#2#3% + {\expandafter #1\expandafter #2\csname + .=\XINTinFloatSum:csv{\XINT_expr_unlock #3}\endcsname }% +\expandafter\def\csname XINT_iiexpr_func_+\endcsname #1#2#3% + {\expandafter #1\expandafter #2\csname + .=\xintiiSum:csv{\XINT_expr_unlock #3}\endcsname }% +\expandafter\def\csname XINT_expr_func_*\endcsname #1#2#3% + {\expandafter #1\expandafter #2\csname + .=\xintPrd:csv{\XINT_expr_unlock #3}\endcsname }% +\expandafter\def\csname XINT_flexpr_func_*\endcsname #1#2#3% + {\expandafter #1\expandafter #2\csname + .=\XINTinFloatPrd:csv{\XINT_expr_unlock #3}\endcsname }% +\expandafter\def\csname XINT_iiexpr_func_*\endcsname #1#2#3% + {\expandafter #1\expandafter #2\csname + .=\xintiiPrd:csv{\XINT_expr_unlock #3}\endcsname }% \def\XINT_expr_func_? #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintIsNotZero {\XINT_expr_unlock #3}\endcsname -}% + {\expandafter #1\expandafter #2\csname + .=\xintiiIsNotZero {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_? \XINT_expr_func_? \let\XINT_iiexpr_func_? \XINT_expr_func_? \def\XINT_expr_func_! #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintIsZero {\XINT_expr_unlock #3}\endcsname -}% + {\expandafter #1\expandafter #2\csname.=\xintiiIsZero {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_! \XINT_expr_func_! \let\XINT_iiexpr_func_! \XINT_expr_func_! \def\XINT_expr_func_not #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintIsZero {\XINT_expr_unlock #3}\endcsname -}% + {\expandafter #1\expandafter #2\csname.=\xintiiIsZero {\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_not \XINT_expr_func_not \let\XINT_iiexpr_func_not \XINT_expr_func_not \def\XINT_expr_func_all #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintANDof:csv{\XINT_expr_unlock #3}\endcsname -}% + {\expandafter #1\expandafter #2\csname + .=\xintANDof:csv{\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_all\XINT_expr_func_all \let\XINT_iiexpr_func_all\XINT_expr_func_all \def\XINT_expr_func_any #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintORof:csv{\XINT_expr_unlock #3}\endcsname -}% + {\expandafter #1\expandafter #2\csname + .=\xintORof:csv{\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_any\XINT_expr_func_any \let\XINT_iiexpr_func_any\XINT_expr_func_any \def\XINT_expr_func_xor #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\xintXORof:csv{\XINT_expr_unlock #3}\endcsname -}% + {\expandafter #1\expandafter #2\csname + .=\xintXORof:csv{\XINT_expr_unlock #3}\endcsname }% \let\XINT_flexpr_func_xor\XINT_expr_func_xor \let\XINT_iiexpr_func_xor\XINT_expr_func_xor -\def\xintifNotZero:: #1,#2,#3,{\xintifNotZero{#1}{#2}{#3}}% +\def\xintifNotZero: #1,#2,#3,{\xintiiifNotZero{#1}{#2}{#3}}% \def\XINT_expr_func_if #1#2#3% -{% - \expandafter #1\expandafter #2\csname - .=\expandafter\xintifNotZero:: - \romannumeral-`0\XINT_expr_unlock #3,\endcsname -}% + {\expandafter #1\expandafter #2\csname + .=\expandafter\xintifNotZero:\romannumeral-`0\XINT_expr_unlock #3,\endcsname }% \let\XINT_flexpr_func_if\XINT_expr_func_if \let\XINT_iiexpr_func_if\XINT_expr_func_if -\def\xintifSgn:: #1,#2,#3,#4,{\xintifSgn{#1}{#2}{#3}{#4}}% +\def\xintifSgn: #1,#2,#3,#4,{\xintiiifSgn{#1}{#2}{#3}{#4}}% \def\XINT_expr_func_ifsgn #1#2#3% {% \expandafter #1\expandafter #2\csname - .=\expandafter\xintifSgn:: - \romannumeral-`0\XINT_expr_unlock #3,\endcsname + .=\expandafter\xintifSgn:\romannumeral-`0\XINT_expr_unlock #3,\endcsname }% \let\XINT_flexpr_func_ifsgn\XINT_expr_func_ifsgn \let\XINT_iiexpr_func_ifsgn\XINT_expr_func_ifsgn -\def\XINT_newexpr_print #1{\ifnum\xintNthElt{0}{#1}>1 - \expandafter\xint_firstoftwo - \else - \expandafter\xint_secondoftwo - \fi - {_xintListWithSep,{#1}}{\xint_firstofone#1}}% -\xintForpair #1#2 in {(fl,Float),(i,iRound0),(bool,IsTrue)}\do {% - \expandafter\def\csname XINT_new#1expr_print\endcsname - ##1{\ifnum\xintNthElt{0}{##1}>1 - \expandafter\xint_firstoftwo - \else - \expandafter\xint_secondoftwo - \fi - {_xintListWithSep,{\xintApply{_xint#2}{##1}}} - {_xint#2##1}}}% +\def\XINT_expr_func_first #1#2#3% + {\expandafter #1\expandafter #2\csname.=\expandafter\XINT_expr_func_firsta + \romannumeral-`0\XINT_expr_unlock #3,^\endcsname }% +\def\XINT_expr_func_firsta #1,#2^{#1}% +\let\XINT_flexpr_func_first\XINT_expr_func_first +\let\XINT_iiexpr_func_first\XINT_expr_func_first +\def\XINT_expr_func_last #1#2#3% will not work in \xintNewExpr if macro param involved + {\expandafter #1\expandafter #2\csname.=\expandafter\XINT_expr_func_lasta + \romannumeral-`0\XINT_expr_unlock #3,^\endcsname }% +\def\XINT_expr_func_lasta #1,#2% + {\if ^#2 #1\expandafter\xint_gobble_ii\fi \XINT_expr_func_lasta #2}% +\let\XINT_flexpr_func_last\XINT_expr_func_last +\let\XINT_iiexpr_func_last\XINT_expr_func_last +\def\XINT_expr_func_odd #1#2#3% + {\expandafter #1\expandafter #2\csname.=\xintOdd{\XINT_expr_unlock #3}\endcsname}% +\let\XINT_flexpr_func_odd\XINT_expr_func_odd +\def\XINT_iiexpr_func_odd #1#2#3% + {\expandafter #1\expandafter #2\csname.=\xintiiOdd{\XINT_expr_unlock #3}\endcsname}% +\def\XINT_expr_func_even #1#2#3% + {\expandafter #1\expandafter #2\csname.=\xintEven{\XINT_expr_unlock #3}\endcsname}% +\let\XINT_flexpr_func_even\XINT_expr_func_even +\def\XINT_iiexpr_func_even #1#2#3% + {\expandafter #1\expandafter #2\csname.=\xintiiEven{\XINT_expr_unlock #3}\endcsname}% +\def\XINT_expr_func_nuple #1#2#3% + {\expandafter #1\expandafter #2\csname .=\XINT_expr_unlock #3\endcsname }% +\let\XINT_flexpr_func_nuple\XINT_expr_func_nuple +\let\XINT_iiexpr_func_nuple\XINT_expr_func_nuple +\def\XINT_expr_func_reversed #1#2#3% + {\expandafter #1\expandafter #2\csname .=\xintReversed::csv + {\XINT_expr_unlock #3}\endcsname }% +\let\XINT_flexpr_func_reversed\XINT_expr_func_reversed +\let\XINT_iiexpr_func_reversed\XINT_expr_func_reversed +\def\xintReversed::csv #1% should be done directly, of course + {\xintListWithSep,{\xintRevWithBraces {\xintCSVtoListNonStripped{#1}}}}% +\def\xintSeqB:f:csv #1#2% + {\expandafter\XINT_seqb:f:csv \expandafter{\romannumeral0\xintraw{#2}}{#1}}% +\def\XINT_seqb:f:csv #1#2{\expandafter\XINT_seqb:f:csv_a\romannumeral-`0#2#1!}% +\def\XINT_seqb:f:csv_a #1#2;#3;#4!{% + \expandafter\xint_gobble_i\romannumeral-`0% + \xintifCmp {#3}{#4}\XINT_seqb:f:csv_bl\XINT_seqb:f:csv_be\XINT_seqb:f:csv_bg + #1{#3}{#4}{}{#2}}% +\def\XINT_seqb:f:csv_be #1#2#3#4#5{,#2}% +\def\XINT_seqb:f:csv_bl #1{\if #1p\expandafter\XINT_seqb:f:csv_pa\else + \xint_afterfi{\expandafter,\xint_gobble_iv}\fi }% +\def\XINT_seqb:f:csv_pa #1#2#3#4{\expandafter\XINT_seqb:f:csv_p\expandafter + {\romannumeral0\xintadd{#4}{#1}}{#2}{#3,#1}{#4}}% +\def\XINT_seqb:f:csv_p #1#2% +{% + \xintifCmp {#1}{#2}\XINT_seqb:f:csv_pa\XINT_seqb:f:csv_pb\XINT_seqb:f:csv_pc + {#1}{#2}% +}% +\def\XINT_seqb:f:csv_pb #1#2#3#4{#3,#1}% +\def\XINT_seqb:f:csv_pc #1#2#3#4{#3}% +\def\XINT_seqb:f:csv_bg #1{\if #1n\expandafter\XINT_seqb:f:csv_na\else + \xint_afterfi{\expandafter,\xint_gobble_iv}\fi }% +\def\XINT_seqb:f:csv_na #1#2#3#4{\expandafter\XINT_seqb:f:csv_n\expandafter + {\romannumeral0\xintadd{#4}{#1}}{#2}{#3,#1}{#4}}% +\def\XINT_seqb:f:csv_n #1#2% +{% + \xintifCmp {#1}{#2}\XINT_seqb:f:csv_nc\XINT_seqb:f:csv_nb\XINT_seqb:f:csv_na + {#1}{#2}% +}% +\def\XINT_seqb:f:csv_nb #1#2#3#4{#3,#1}% +\def\XINT_seqb:f:csv_nc #1#2#3#4{#3}% +\def\xintiiSeqb:f:csv #1#2% + {\expandafter\XINT_iiseqb:f:csv \expandafter{\romannumeral-`0#2}{#1}}% +\def\XINT_iiseqb:f:csv #1#2{\expandafter\XINT_iiseqb:f:csv_a\romannumeral-`0#2#1!}% +\def\XINT_iiseqb:f:csv_a #1#2;#3;#4!{% + \expandafter\xint_gobble_i\romannumeral-`0% + \xintSgnFork{\XINT_Cmp {#3}{#4}}% + \XINT_iiseqb:f:csv_bl\XINT_seqb:f:csv_be\XINT_iiseqb:f:csv_bg + #1{#3}{#4}{}{#2}}% +\def\XINT_iiseqb:f:csv_bl #1{\if #1p\expandafter\XINT_iiseqb:f:csv_pa\else + \xint_afterfi{\expandafter,\xint_gobble_iv}\fi }% +\def\XINT_iiseqb:f:csv_pa #1#2#3#4{\expandafter\XINT_iiseqb:f:csv_p\expandafter + {\romannumeral0\xintiiadd{#4}{#1}}{#2}{#3,#1}{#4}}% +\def\XINT_iiseqb:f:csv_p #1#2% +{% + \xintSgnFork{\XINT_Cmp {#1}{#2}}% + \XINT_iiseqb:f:csv_pa\XINT_iiseqb:f:csv_pb\XINT_iiseqb:f:csv_pc {#1}{#2}% +}% +\def\XINT_iiseqb:f:csv_pb #1#2#3#4{#3,#1}% +\def\XINT_iiseqb:f:csv_pc #1#2#3#4{#3}% +\def\XINT_iiseqb:f:csv_bg #1{\if #1n\expandafter\XINT_iiseqb:f:csv_na\else + \xint_afterfi{\expandafter,\xint_gobble_iv}\fi }% +\def\XINT_iiseqb:f:csv_na #1#2#3#4{\expandafter\XINT_iiseqb:f:csv_n\expandafter + {\romannumeral0\xintiiadd{#4}{#1}}{#2}{#3,#1}{#4}}% +\def\XINT_iiseqb:f:csv_n #1#2% +{% + \xintSgnFork{\XINT_Cmp {#1}{#2}}% + \XINT_seqb:f:csv_nc\XINT_seqb:f:csv_nb\XINT_iiseqb:f:csv_na {#1}{#2}% +}% +\def\XINTinFloatSeqB:f:csv #1#2{\expandafter\XINT_flseqb:f:csv \expandafter + {\romannumeral0\XINTinfloat [\XINTdigits]{#2}}{#1}}% +\def\XINT_flseqb:f:csv #1#2{\expandafter\XINT_flseqb:f:csv_a\romannumeral-`0#2#1!}% +\def\XINT_flseqb:f:csv_a #1#2;#3;#4!{% + \expandafter\xint_gobble_i\romannumeral-`0% + \xintifCmp {#3}{#4}\XINT_flseqb:f:csv_bl\XINT_seqb:f:csv_be\XINT_flseqb:f:csv_bg + #1{#3}{#4}{}{#2}}% +\def\XINT_flseqb:f:csv_bl #1{\if #1p\expandafter\XINT_flseqb:f:csv_pa\else + \xint_afterfi{\expandafter,\xint_gobble_iv}\fi }% +\def\XINT_flseqb:f:csv_pa #1#2#3#4{\expandafter\XINT_flseqb:f:csv_p\expandafter + {\romannumeral0\XINTinfloatadd{#4}{#1}}{#2}{#3,#1}{#4}}% +\def\XINT_flseqb:f:csv_p #1#2% +{% + \xintifCmp {#1}{#2}% + \XINT_flseqb:f:csv_pa\XINT_flseqb:f:csv_pb\XINT_flseqb:f:csv_pc {#1}{#2}% +}% +\def\XINT_flseqb:f:csv_pb #1#2#3#4{#3,#1}% +\def\XINT_flseqb:f:csv_pc #1#2#3#4{#3}% +\def\XINT_flseqb:f:csv_bg #1{\if #1n\expandafter\XINT_flseqb:f:csv_na\else + \xint_afterfi{\expandafter,\xint_gobble_iv}\fi }% +\def\XINT_flseqb:f:csv_na #1#2#3#4{\expandafter\XINT_flseqb:f:csv_n\expandafter + {\romannumeral0\XINTinfloatadd{#4}{#1}}{#2}{#3,#1}{#4}}% +\def\XINT_flseqb:f:csv_n #1#2% +{% + \xintifCmp {#1}{#2}% + \XINT_seqb:f:csv_nc\XINT_seqb:f:csv_nb\XINT_flseqb:f:csv_na {#1}{#2}% +}% +\def\xintApply::csv #1#2% + {\expandafter\XINT_applyon::_a\expandafter {\romannumeral-`0#2}{#1}}% +\def\XINT_applyon::_a #1#2{\XINT_applyon::_b {#2}{}#1,,}% +\def\XINT_applyon::_b #1#2#3,{\expandafter\XINT_applyon::_c \romannumeral-`0#3,{#1}{#2}}% +\def\XINT_applyon::_c #1{\if #1,\expandafter\XINT_applyon::_end + \else\expandafter\XINT_applyon::_d\fi #1}% +\def\XINT_applyon::_d #1,#2{\expandafter\XINT_applyon::_e\romannumeral-`0#2{#1},{#2}}% +\def\XINT_applyon::_e #1,#2#3{\XINT_applyon::_b {#2}{#3, #1}}% +\def\XINT_applyon::_end #1,#2#3{\xint_secondoftwo #3}% +\def\xintApply:::csv #1#2#3% + {\expandafter\XINT_applyon:::_a\expandafter{\romannumeral-`0#2}{#1}{#3}}% +\def\XINT_applyon:::_a #1#2#3{\XINT_applyon:::_b {#2}{#3}{}#1,,}% +\def\XINT_applyon:::_b #1#2#3#4,% + {\expandafter\XINT_applyon:::_c \romannumeral-`0#4,{#1}{#2}{#3}}% +\def\XINT_applyon:::_c #1{\if #1,\expandafter\XINT_applyon:::_end + \else\expandafter\XINT_applyon:::_d\fi #1}% +\def\XINT_applyon:::_d #1,#2#3% + {\expandafter\XINT_applyon:::_e\expandafter + {\romannumeral-`0\xintApply::csv {#2{#1}}{#3}},{#2}{#3}}% +\def\XINT_applyon:::_e #1,#2#3#4{\XINT_applyon:::_b {#2}{#3}{#4, #1}}% +\def\XINT_applyon:::_end #1,#2#3#4{\xint_secondoftwo #4}% +\def\XINT_expr_RApply::csv #1#2#3#4% + {~xintApply::csv{~expandafter#1~xint_exchangetwo_keepbraces{#4}}{#3}}% +\def\XINT_expr_LApply::csv #1#2#3#4{~xintApply::csv{#1{#3}}{#4}}% +\def\XINT_expr_RLApply:::csv #1#2{~xintApply:::csv{#1}}% +\catcode`~ 12 % by the way, catcode is set to 3 in \XINTsetupcatcodes +\catcode`$ 12 % $ +\def\XINT_xptwo_getab_b #1#2!#3% + {\expandafter\XINT_xptwo_getab_c\romannumeral-`0#3!#1{#1#2}}% +\def\XINT_xptwo_getab_c #1#2!#3#4#5#6{#1#3{#5}{#6}{#1#2}{#4}}% +\def\xint_ddfork #1$$#2#3\krof {#2}% +\def\XINT_NEfork #1#2{\xint_ddfork + #1#2\XINT_expr_RLApply:::csv + #1$\XINT_expr_RApply::csv% $ + $#2\XINT_expr_LApply::csv% $ + $${\XINT_NEfork_nn #1#2}% + \krof }% +\def\XINT_NEfork_nn #1#2#3#4{% + \if #1##\xint_dothis{#3}\fi + \if #1~\xint_dothis{#3}\fi + \if #2##\xint_dothis{#3}\fi + \if #2~\xint_dothis{#3}\fi + \xint_orthat {\csname #4NE\endcsname }% + }% +\def\XINT_NEfork_one #1#2!#3#4#5#6{% + \if ###1\xint_dothis {#3}\fi + \if ~#1\xint_dothis {#3}\fi + \if $#1\xint_dothis {~xintApply::csv{#3#5}}\fi %$ + \xint_orthat {\csname #4NE\endcsname #6}{#1#2}% +}% \toks0 {}% -\xintFor #1 in {Bool,Toggle,Floor,Ceil,iRound,Round,iTrunc,Trunc,TFrac,% - Lt,Gt,Eq,AND,OR,IsNotZero,IsZero,ifNotZero,ifSgn,% - Irr,Num,Abs,Sgn,Opp,Quo,Rem,Add,Sub,Mul,Sqr,Div,Pow,Fac,fE,iSqrt,% - iiAdd,iiSub,iiMul,iiSqr,iiPow,iiQuo,iiRem,iiSgn,iiAbs,iiOpp,iE}\do +\xintFor #1 in {DivTrunc,iiDivTrunc,iiDivRound,Mod,iiMod,iRound,Round,iTrunc,Trunc,% + Lt,Gt,Eq,LtorEq,GtorEq,Neq,AND,OR,XOR,iQuo,iRem,Add,Sub,Mul,Div,Pow,E,% + iiAdd,iiSub,iiMul,iiPow,iiQuo,iiRem,iiE,SeqA::csv,iiSeqA::csv}\do {\toks0 - \expandafter{\the\toks0\expandafter\def\csname xint#1\endcsname {_xint#1}}}% -\xintFor #1 in {,Sqrt,Add,Sub,Mul,Div,Power,fE,Frac}\do - {\toks0 - \expandafter{\the\toks0\expandafter\def\csname XINTinFloat#1\endcsname - {_XINTinFloat#1}}}% -\xintFor #1 in {GCDof,LCMof,Maxof,Minof,ANDof,ORof,XORof,Sum,Prd,% - iMaxof,iMinof,iiSum,iiPrd}\do - {\toks0 - \expandafter{\the\toks0\expandafter\def\csname xint#1:csv\endcsname - ####1{_xint#1{\xintCSVtoListNonStripped {####1}}}}}% + \expandafter{\the\toks0 + \expandafter\let\csname xint#1NE\expandafter\endcsname\csname xint#1\endcsname + \expandafter\def\csname xint#1\endcsname ####1####2{% + \expandafter\XINT_NEfork + \romannumeral-`0\expandafter\XINT_xptwo_getab_b + \romannumeral-`0####2!{####1}{~xint#1}{xint#1}}% + }% +}% +\xintFor #1 in {Num,Irr,Abs,iiAbs,Sgn,iiSgn,TFrac,Floor,iFloor,Ceil,iCeil,% + Sqr,iiSqr,iSqrt,iiIsZero,iiIsNotZero,iiifNotZero,iiifSgn,Odd,Even,iiOdd,iiEven,% + Opp,iiOpp,iiifZero,Fac,iFac,Bool,Toggle}\do +{\toks0 + \expandafter{\the\toks0 + \expandafter\let\csname xint#1NE\expandafter\endcsname\csname xint#1\endcsname + \expandafter\def\csname xint#1\endcsname ####1{% + \expandafter\XINT_NEfork_one\romannumeral-`0####1!{~xint#1}{xint#1}{}{}}% + }% +}% +\xintFor #1 in {Add,Sub,Mul,Div,Power,E,Mod,SeqA::csv}\do +{\toks0 + \expandafter{\the\toks0 + \expandafter\let\csname XINTinFloat#1NE\expandafter\endcsname + \csname XINTinFloat#1\endcsname + \expandafter\def\csname XINTinFloat#1\endcsname ####1####2{% + \expandafter\XINT_NEfork + \romannumeral-`0\expandafter\XINT_xptwo_getab_b + \romannumeral-`0####2!{####1}{~XINTinFloat#1}{XINTinFloat#1}}% + }% +}% +\toks0 + \expandafter{\the\toks0 + \let\xintSeqB::csvNE\xintSeqB::csv + \def\xintSeqB::csv ##1##2{% + \expandafter\XINT_NEfork + \romannumeral-`0\expandafter\XINT_xptwo_getab_b + \romannumeral-`0##2!{##1}{$noexpand$xintSeqB:f:csv}{xintSeqB::csv}}% + \let\xintiiSeqB::csvNE\xintiiSeqB::csv + \def\xintiiSeqB::csv ##1##2{% + \expandafter\XINT_NEfork + \romannumeral-`0\expandafter\XINT_xptwo_getab_b + \romannumeral-`0##2!{##1}{$noexpand$xintiiSeqB:f:csv}{xintiiSeqB::csv}}% + \let\XINTinFloatSeqB::csvNE\XINTinFloatSeqB::csv + \def\XINTinFloatSeqB::csv ##1##2{% + \expandafter\XINT_NEfork + \romannumeral-`0\expandafter\XINT_xptwo_getab_b + \romannumeral-`0##2!{##1}{$noexpand$XINTinFloatSeqB:f:csv}{XINTinFloatSeqB::csv}}% + \let\xintSeq::csvNE\xintSeq::csv + \def\xintSeq::csv ##1##2{% + \expandafter\XINT_NEfork + \romannumeral-`0\expandafter\XINT_xptwo_getab_b + \romannumeral-`0##2!{##1}{$noexpand$xintSeq::csv}{xintSeq::csv}}% + \let\xintiiSeq::csvNE\xintiiSeq::csv + \def\xintiiSeq::csv ##1##2{% + \expandafter\XINT_NEfork + \romannumeral-`0\expandafter\XINT_xptwo_getab_b + \romannumeral-`0##2!{##1}{$noexpand$xintiiSeq::csv}{xintiiSeq::csv}}% + \let\XINTinFloatSeq::csvNE\XINTinFloatSeq::csv + \def\XINTinFloatSeq::csv ##1##2{% + \expandafter\XINT_NEfork + \romannumeral-`0\expandafter\XINT_xptwo_getab_b + \romannumeral-`0##2!{##1}{$noexpand$XINTinFloatSeq::csv}{XINTinFloatSeq::csv}}% + \let\XINTinFloatFracNE\XINTinFloatFrac + \def\XINTinFloatFrac ##1{\expandafter\XINT_NEfork_one\romannumeral-`0##1!% + {~XINTinFloatFrac}{XINTinFloatFrac}{}{}}% + \let\XINTinFloatdigitsNE\XINTinFloatdigits + \def\XINTinFloatdigits ##1{\expandafter\XINT_NEfork_one\romannumeral-`0##1!% + {~XINTinFloatdigits}{XINTinFloatdigits}{}{}}% + \let\XINTinFloatSqrtdigitsNE\XINTinFloatSqrtdigits + \def\XINTinFloatSqrtdigits ##1{\expandafter\XINT_NEfork_one\romannumeral-`0##1!% + {~XINTinFloatSqrtdigits}{XINTinFloatSqrtdigits}{}{}}% + \let\XINTinFloatNE\XINTinFloat + \def\XINTinFloat [##1]##2{% not ultimately general, but got tired + \expandafter\XINT_NEfork_one + \romannumeral-`0##2!{~XINTinFloat[##1]}{XINTinFloat}{}{[##1]}}% + \let\XINTinFloatSqrtNE\XINTinFloatSqrt + \def\XINTinFloatSqrt [##1]##2{% + \expandafter\XINT_NEfork_one + \romannumeral-`0##2!{~XINTinFloatSqrt[##1]}{XINTinFloatSqrt}{}{[##1]}}% +}% +\xintFor #1 in {ANDof,ORof,XORof,iiMaxof,iiMinof,iiSum,iiPrd, + GCDof,LCMof,Sum,Prd,Maxof,Minof}\do +{\toks0 + \expandafter{\the\toks0 \expandafter\def\csname xint#1:csv\endcsname {~xint#1:csv}}% +}% \xintFor #1 in {Maxof,Minof,Sum,Prd}\do - {\toks0 - \expandafter{\the\toks0\expandafter\def\csname XINTinFloat#1:csv\endcsname - ####1{_XINTinFloat#1{\xintCSVtoListNonStripped {####1}}}}}% -\expandafter\def\expandafter\XINT_expr_protect\expandafter{\the\toks0 - \def\XINTdigits {_XINTdigits}% - \def\XINT_expr_print ##1{\expandafter\XINT_newexpr_print\expandafter - {\romannumeral0\xintcsvtolistnonstripped{\XINT_expr_unlock ##1}}}% - \def\XINT_flexpr_print ##1{\expandafter\XINT_newflexpr_print\expandafter - {\romannumeral0\xintcsvtolistnonstripped{\XINT_expr_unlock ##1}}}% - \def\XINT_iexpr_print ##1{\expandafter\XINT_newiexpr_print\expandafter - {\romannumeral0\xintcsvtolistnonstripped{\XINT_expr_unlock ##1}}}% - \def\XINT_boolexpr_print ##1{\expandafter\XINT_newboolexpr_print\expandafter - {\romannumeral0\xintcsvtolistnonstripped{\XINT_expr_unlock ##1}}}% +{\toks0 + \expandafter{\the\toks0 + \expandafter\def\csname XINTinFloat#1:csv\endcsname {~XINTinFloat#1:csv}}% +}% +\expandafter\def\expandafter\XINT_expr_redefinemacros\expandafter + {\the\toks0 + \def\XINT_flexpr_noopt {\expandafter\XINT_flexpr_withopt_b\expandafter-% + \romannumeral0\xintbarefloateval }% + \def\XINT_flexpr_withopt_b ##1##2% + {\expandafter\XINT_flexpr_wrap\csname .;##1.=\XINT_expr_unlock ##2\endcsname }% + \def\XINT_expr_unlock_sp ##1.;##2##3.=##4!{\if -##2\expandafter\xint_firstoftwo + \else\expandafter\xint_secondoftwo\fi \XINTdigits{{##2##3}}{##4}}% + \def\XINT_expr_print ##1{\expandafter\xintSPRaw::csv\expandafter + {\romannumeral-`0\XINT_expr_unlock ##1}}% + \def\XINT_iiexpr_print ##1{\expandafter\xintCSV::csv\expandafter + {\romannumeral-`0\XINT_expr_unlock ##1}}% + \def\XINT_boolexpr_print ##1{\expandafter\xintIsTrue::csv\expandafter + {\romannumeral-`0\XINT_expr_unlock ##1}}% + \def\xintCSV::csv {~xintCSV::csv }% spaces to separate from possible catcode 11 + \def\xintSPRaw::csv {~xintSPRaw::csv }% stuff after + \def\xintPFloat::csv {~xintPFloat::csv }% + \def\xintIsTrue::csv {~xintIsTrue::csv }% + \def\xintRound::csv {~xintRound::csv }% + \def\xintReversed::csv {~xintReversed::csv }% + \def\xintListSel:csv {~xintListSel:csv }% }% \toks0 {}% \def\xintNewExpr {\xint_NewExpr\xinttheexpr }% \def\xintNewFloatExpr {\xint_NewExpr\xintthefloatexpr }% \def\xintNewIExpr {\xint_NewExpr\xinttheiexpr }% -\let\xintNewNumExpr\xintNewIExpr \def\xintNewIIExpr {\xint_NewExpr\xinttheiiexpr }% \def\xintNewBoolExpr {\xint_NewExpr\xinttheboolexpr }% +\def\XINT_newexpr_finish #1>{\noexpand\romannumeral-`0}% \def\xint_NewExpr #1#2[#3]% {% \begingroup @@ -1095,38 +2292,32 @@ \or \toks0 {\xdef #2##1##2##3##4##5##6##7##8##9}% \fi \xintexprSafeCatcodes - \escapechar92 \XINT_NewExpr #1% }% -\catcode`* 13 -\def\XINT_NewExpr #1#2% -{% - \def\XINT_tmpa ##1##2##3##4##5##6##7##8##9{#2}% - \XINT_expr_protect - \lccode`*=`_ \lowercase {\def*}{!noexpand!}% - \catcode`_ 13 \catcode`: 11 - \endlinechar -1 % 1.09i, 2013/12/18 not sure why I had that? removed. - % 2014/02/13: you idiot, if not then spurious extra ending space - % token makes impossible nesting of created macros! - \everyeof {\noexpand }% - \edef\XINT_tmpb ##1##2##3##4##5##6##7##8##9% - {\scantokens - \expandafter{\romannumeral-`0#1% - \XINT_tmpa {####1}{####2}{####3}% - {####4}{####5}{####6}% - {####7}{####8}{####9}% - \relax}}% - \lccode`*=`\$ \lowercase {\def*}{####}% - \catcode`\$ 13 \catcode`! 0 \catcode`_ 11 % - \the\toks0 - {\scantokens\expandafter{\expandafter - \XINT_newexpr_setprefix\meaning\XINT_tmpb}}% +\catcode`~ 13 \catcode`@ 14 \catcode`\% 6 \catcode`# 12 \catcode`$ 11 @ $ +\def\XINT_NewExpr %1%2@ +{@ + \def\XINT_tmpa %%1%%2%%3%%4%%5%%6%%7%%8%%9{%2}@ + \XINT_expr_redefinemacros + \def~{$noexpand$}@ vvv v^^e9rifier si vraiment besoin pour ^ et ! + \catcode`: 11 \catcode`_ 11 @ \catcode`^ 11 \catcode`! 11 + \catcode`# 12 \catcode`~ 13 \escapechar 126 + \endlinechar -1 \everyeof {\noexpand }@ + \edef\XINT_tmpb + {\scantokens\expandafter + {\romannumeral-`0\expandafter%1\XINT_tmpa {#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}\relax}@ + }@ + \escapechar 92 \catcode`# 6 \catcode`$ 0 @ $ + \the\toks0 + {\scantokens\expandafter{\expandafter\XINT_newexpr_finish\meaning\XINT_tmpb}}@ \endgroup -}% +}@ +\catcode`% 14 \let\xintexprRestoreCatcodes\empty \def\xintexprSafeCatcodes -{% for end user. +{% \edef\xintexprRestoreCatcodes {% + \catcode59=\the\catcode59 % ; \catcode34=\the\catcode34 % " \catcode63=\the\catcode63 % ? \catcode124=\the\catcode124 % | @@ -1149,7 +2340,8 @@ \catcode44=\the\catcode44 % , \catcode61=\the\catcode61 % = \catcode32=\the\catcode32\relax % space - }% it's hard to know where to stop... + }% + \catcode59=12 % ; \catcode34=12 % " \catcode63=12 % ? \catcode124=12 % | diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty index 09d75a2a9b3..1a92682ecc7 100644 --- a/Master/texmf-dist/tex/generic/xint/xintfrac.sty +++ b/Master/texmf-dist/tex/generic/xint/xintfrac.sty @@ -20,11 +20,11 @@ %% original source files, as listed above, are part of the %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) -%%---------------------------------------------------------------- -%% The xint bundle (version 1.09n of April 1st, 2014) -%% xintfrac: Expandable operations on fractions +%% --------------------------------------------------------------- +%% The xint bundle v1.1 (2014/10/28) %% Copyright (C) 2013-2014 by Jean-Francois Burnol -%%---------------------------------------------------------------- +%% xintfrac: Expandable operations on fractions +%% --------------------------------------------------------------- \begingroup\catcode61\catcode48\catcode32=10\relax% \catcode13=5 % ^^M \endlinechar=13 % @@ -36,7 +36,6 @@ \catcode45=12 % - \catcode46=12 % . \catcode58=12 % : - \def\space { }% \let\z\endgroup \expandafter\let\expandafter\x\csname ver@xintfrac.sty\endcsname \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname @@ -53,7 +52,6 @@ \else \ifx\x\relax % plain-TeX, first loading of xintfrac.sty \ifx\w\relax % but xint.sty not yet loaded. - \y{xintfrac}{now issuing \string\input\space xint.sty}% \def\z{\endgroup\input xint.sty\relax}% \fi \else @@ -61,48 +59,26 @@ \ifx\x\empty % LaTeX, first loading, % variable is initialized, but \ProvidesPackage not yet seen \ifx\w\relax % xint.sty not yet loaded. - \y{xintfrac}{now issuing \string\RequirePackage{xint}}% \def\z{\endgroup\RequirePackage{xint}}% \fi \else - \y{xintfrac}{I was already loaded, aborting input}% - \aftergroup\endinput + \aftergroup\endinput % xintfrac already loaded. \fi \fi \fi \z% -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode123=1 % { - \catcode125=2 % } - \catcode64=11 % @ - \catcode35=6 % # - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode58=12 % : - \ifdefined\PackageInfo - \def\y#1#2{\PackageInfo{#1}{#2}}% - \else - \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% - \fi - \def\empty {}% - \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname - \ifx\w\relax % Plain TeX, user gave a file name at the prompt - \y{xintfrac}{Loading of package xint failed, aborting input}% - \aftergroup\endinput - \fi - \ifx\w\empty % LaTeX, user gave a file name at the prompt - \y{xintfrac}{Loading of package xint failed, aborting input}% - \aftergroup\endinput - \fi -\endgroup% -\XINTsetupcatcodes% +\XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintfrac}% - [2014/04/01 v1.09n Expandable operations on fractions (jfB)]% + [2014/10/28 v1.1 Expandable operations on fractions (jfB)]% \chardef\xint_c_xviii 18 +\def\XINT_cntSgnFork #1% +{% + \ifcase #1\expandafter\xint_secondofthree + \or\expandafter\xint_thirdofthree + \else\expandafter\xint_firstofthree + \fi +}% \def\xintLen {\romannumeral0\xintlen }% \def\xintlen #1% {% @@ -435,11 +411,16 @@ \expandafter{\romannumeral0\xint_dsh {#3}{#1}}{#2}}% \def\XINT_rawz_Bb #1#2{ #2/#1}% \def\xintFloor {\romannumeral0\xintfloor }% -\def\xintfloor #1{\expandafter\XINT_floor - \romannumeral0\xintrawwithzeros {#1}.}% -\def\XINT_floor #1/#2.{\xintiiquo {#1}{#2}}% +\def\xintfloor #1% devrais-je faire \xintREZ? + {\expandafter\XINT_ifloor \romannumeral0\xintrawwithzeros {#1}./1[0]}% +\def\xintiFloor {\romannumeral0\xintifloor }% +\def\xintifloor #1% + {\expandafter\XINT_ifloor \romannumeral0\xintrawwithzeros {#1}.}% +\def\XINT_ifloor #1/#2.{\xintiiquo {#1}{#2}}% \def\xintCeil {\romannumeral0\xintceil }% \def\xintceil #1{\xintiiopp {\xintFloor {\xintOpp{#1}}}}% +\def\xintiCeil {\romannumeral0\xinticeil }% +\def\xinticeil #1{\xintiiopp {\xintiFloor {\xintOpp{#1}}}}% \def\xintNumerator {\romannumeral0\xintnumerator }% \def\xintnumerator {% @@ -617,15 +598,6 @@ \expandafter\XINT_e_end\expandafter{\the\numexpr #1+#4}{#2}{#3}% }% \def\XINT_e_end #1#2#3{ #2/#3[#1]}% -\def\xintfE {\romannumeral0\xintfe }% -\def\xintfe #1% -{% - \expandafter\XINT_fe \romannumeral0\XINT_infrac {#1}% -}% -\def\XINT_fe #1#2#3#4% -{% - \expandafter\XINT_e_end\expandafter{\the\numexpr #1+\xintNum{#4}}{#2}{#3}% -}% \def\xintFloatE {\romannumeral0\xintfloate }% \def\xintfloate #1{\XINT_floate_chkopt #1\xint_relax }% \def\XINT_floate_chkopt #1% @@ -650,27 +622,11 @@ \expandafter\xint_exchangetwo_keepbraces\expandafter {\the\numexpr #2+#5}{#1}{#3}{#4}\XINT_float_Q }% -\def\XINTinFloatfE {\romannumeral0\XINTinfloatfe }% -\def\XINTinfloatfe [#1]#2% -{% - \expandafter\XINT_infloatfe_a\expandafter - {\the\numexpr #1\expandafter}\romannumeral0\XINT_infrac {#2}% -}% -\def\XINT_infloatfe_a #1#2#3#4#5% -{% - \expandafter\expandafter\expandafter\XINT_infloat_a - \expandafter\xint_exchangetwo_keepbraces\expandafter - {\the\numexpr #2+\xintNum{#5}}{#1}{#3}{#4}\XINT_infloat_Q -}% -\def\xintiE {\romannumeral0\xintie }% for \xintiiexpr only -\def\xintie #1% -{% - \expandafter\XINT_ie \romannumeral0\XINT_infrac {#1}% allows 3.123e3 -}% -\def\XINT_ie #1#2#3#4% assumes #3=1 and uses \xint_dsh with its \numexpr -{% - \xint_dsh {#2}{0-(#1+#4)}% could have \xintNum{#4} for a bit more general -}% +\def\XINTinFloatE {\romannumeral0\XINTinfloate }% +\def\XINTinfloate {\expandafter\XINT_infloate\romannumeral0\XINTinfloat [\XINTdigits]}% +\def\XINT_infloate #1[#2]#3% + {\expandafter\XINT_infloate_end\expandafter {\the\numexpr #3+#2}{#1}}% +\def\XINT_infloate_end #1#2{ #2[#1]}% \def\xintIrr {\romannumeral0\xintirr }% \def\xintirr #1% {% @@ -729,18 +685,11 @@ \expandafter\XINT_irr_finish\expandafter {#2}{#1}% }% \def\XINT_irr_finish #1#2#3{#3#1/#2}% changed in 1.08 -\def\xintNum {\romannumeral0\xintnum }% -\def\xintnum #1{\expandafter\XINT_intcheck\romannumeral0\xintirr {#1}\Z }% -\edef\XINT_intcheck #1/#2\Z +\def\xintifInt {\romannumeral0\xintifint }% +\def\xintifint #1{\expandafter\XINT_ifint\romannumeral0\xintrawwithzeros {#1}.}% +\def\XINT_ifint #1/#2.% {% - \noexpand\if 0\noexpand\XINT_isOne {#2}\noexpand\xintError:NotAnInteger - \noexpand\fi\space #1% -}% -\def\xintifInt {\romannumeral0\xintifint }% -\def\xintifint #1{\expandafter\XINT_ifint\romannumeral0\xintirr {#1}\Z }% -\def\XINT_ifint #1/#2\Z -{% - \if\XINT_isOne {#2}1% + \if 0\xintiiRem {#1}{#2}% \expandafter\xint_firstoftwo_thenstop \else \expandafter\xint_secondoftwo_thenstop @@ -808,27 +757,22 @@ \XINT_irr_finish {#3}{#4}% }% \def\xintTFrac {\romannumeral0\xinttfrac }% -\def\xinttfrac #1% - {\expandafter\XINT_tfrac_fork\romannumeral0\xintrawwithzeros {#1}\Z }% +\def\xinttfrac #1{\expandafter\XINT_tfrac_fork\romannumeral0\xintrawwithzeros {#1}\Z }% \def\XINT_tfrac_fork #1% {% \xint_UDzerominusfork #1-\XINT_tfrac_zero - 0#1\XINT_tfrac_N - 0-{\XINT_tfrac_P #1}% + 0#1{\xintiiopp\XINT_tfrac_P }% + 0-{\XINT_tfrac_P #1}% \krof }% \def\XINT_tfrac_zero #1\Z { 0/1[0]}% -\def\XINT_tfrac_N {\expandafter\XINT_opp\romannumeral0\XINT_tfrac_P }% -\def\XINT_tfrac_P #1/#2\Z -{% - \expandafter\XINT_rez_AB\romannumeral0\xintiirem{#1}{#2}\Z {0}{#2}% -}% -\def\XINTinFloatFrac {\romannumeral0\XINTinfloatfrac }% +\def\XINT_tfrac_P #1/#2\Z {\expandafter\XINT_rez_AB + \romannumeral0\xintiirem{#1}{#2}\Z {0}{#2}}% +\def\XINTinFloatFrac {\romannumeral0\XINTinfloatfrac [\XINTdigits]}% \def\XINTinfloatfrac [#1]#2% {% - \expandafter\XINT_infloatfrac_a\expandafter - {\romannumeral0\xinttfrac{#2}}{#1}% + \expandafter\XINT_infloatfrac_a\expandafter {\romannumeral0\xinttfrac{#2}}{#1}% }% \def\XINT_infloatfrac_a #1#2{\XINTinFloat [#2]{#1}}% \def\xintTrunc {\romannumeral0\xinttrunc }% @@ -926,8 +870,18 @@ \def\XINT_trunc_Hb #1#2#3% {% \expandafter #3\expandafter0\expandafter.% - \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {}#2% #1=-0 autoris^^e9 ! + \romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {}#2% #1=-0 autoris\'e ! }% +\def\xintTTrunc {\romannumeral0\xintttrunc }% +\def\xintttrunc #1% +{% + \expandafter\XINT_itrunc_G + \romannumeral0\expandafter\XINT_ttrunc_A + \romannumeral0\XINT_infrac {#1}0% this last 0 to let \XINT_itrunc_G be happy +}% +\def\XINT_ttrunc_A #1#2#3{\XINT_trunc_checkifzero {#1}#2\Z {#3}}% +\let\xintNum \xintTTrunc +\let\xintnum \xintttrunc \def\xintRound {\romannumeral0\xintround }% \def\xintiRound {\romannumeral0\xintiround }% \def\xintround #1% @@ -1409,6 +1363,57 @@ {\the\numexpr #3+#4+\xint_c_i-#2}{#1}% }% \def\XINT_float_Y #1#2{ #2e#1}% +\def\xintPFloat {\romannumeral0\xintpfloat }% +\def\xintpfloat #1{\XINT_pfloat_chkopt #1\xint_relax }% +\def\XINT_pfloat_chkopt #1% +{% + \ifx [#1\expandafter\XINT_pfloat_opt + \else\expandafter\XINT_pfloat_noopt + \fi #1% +}% +\def\XINT_pfloat_noopt #1\xint_relax +{% + \expandafter\XINT_pfloat_a\expandafter\XINTdigits + \romannumeral0\XINTinfloat [\XINTdigits]{#1}% +}% +\def\XINT_pfloat_opt [\xint_relax #1]%#2% +{% + \expandafter\XINT_pfloat_a\expandafter {\the\numexpr #1\expandafter}% + \romannumeral0\XINTinfloat [\numexpr #1\relax]%{#2}% +}% +\def\XINT_pfloat_a #1#2% +{% + \xint_UDzerominusfork + #2-\XINT_pfloat_zero + 0#2\XINT_pfloat_neg + 0-{\XINT_pfloat_pos #2}% + \krof {#1}% +}% +\def\XINT_pfloat_zero #1[#2]{ 0}% +\def\XINT_pfloat_neg + {\expandafter\xint_minus_thenstop\romannumeral0\XINT_pfloat_pos {}}% +\def\XINT_pfloat_pos #1#2#3[#4]% +{% + \ifnum#4>0 \xint_dothis\XINT_pfloat_no\fi + \ifnum#4>\numexpr-#2\relax \xint_dothis\XINT_pfloat_b\fi + \ifnum#4>\numexpr-#2-\xint_c_v\relax \xint_dothis\XINT_pfloat_B\fi + \xint_orthat\XINT_pfloat_no {#2}{#4}{#1#3}% +}% +\def\XINT_pfloat_no #1#2% +{% + \expandafter\XINT_pfloat_no_b\expandafter{\the\numexpr #2+#1-\xint_c_i\relax}% +}% +\def\XINT_pfloat_no_b #1#2{\XINT_pfloat_no_c #2e#1}% +\def\XINT_pfloat_no_c #1{ #1.}% +\def\XINT_pfloat_b #1#2#3% + {\expandafter\XINT_pfloat_c + \romannumeral0\expandafter\XINT_split_fromleft_loop + \expandafter {\the\numexpr #1+#2-\xint_c_i}#3\W\W\W\W\W\W\W\W\Z }% +\def\XINT_pfloat_c #1#2{ #1.#2}% #2 peut ^^eatre vide +\def\XINT_pfloat_B #1#2#3% + {\expandafter\XINT_pfloat_C + \romannumeral0\XINT_dsx_zeroloop {\numexpr -#1-#2}{}\Z {}#3}% +\def\XINT_pfloat_C { 0.}% \def\XINTinFloat {\romannumeral0\XINTinfloat }% \def\XINTinfloat [#1]#2% {% @@ -1499,66 +1504,108 @@ }% \def\XINT_infloat_X #1#2{ #2[#1]}% \def\xintAdd {\romannumeral0\xintadd }% -\def\xintadd #1% +\def\xintadd #1{\expandafter\xint_fadd\romannumeral0\xintraw {#1}}% +\def\xint_fadd #1{\xint_gob_til_zero #1\XINT_fadd_Azero 0\XINT_fadd_a #1}% +\def\XINT_fadd_Azero #1]{\xintraw }% +\def\XINT_fadd_a #1/#2[#3]#4% + {\expandafter\XINT_fadd_b\romannumeral0\xintraw {#4}{#3}{#1}{#2}}% +\def\XINT_fadd_b #1{\xint_gob_til_zero #1\XINT_fadd_Bzero 0\XINT_fadd_c #1}% +\def\XINT_fadd_Bzero #1]#2#3#4{ #3/#4[#2]}% +\def\XINT_fadd_c #1/#2[#3]#4% {% - \expandafter\xint_fadd\expandafter {\romannumeral0\XINT_infrac {#1}}% + \expandafter\XINT_fadd_Aa\expandafter{\the\numexpr #4-#3}{#3}{#4}{#1}{#2}% }% -\def\xint_fadd #1#2{\expandafter\XINT_fadd_A\romannumeral0\XINT_infrac{#2}#1}% -\def\XINT_fadd_A #1#2#3#4% +\def\XINT_fadd_Aa #1% {% - \ifnum #4 > #1 - \xint_afterfi {\XINT_fadd_B {#1}}% + \ifcase\XINT_cntSgn #1\Z + \expandafter\XINT_fadd_B + \or + \expandafter \XINT_fadd_Ba \else - \xint_afterfi {\XINT_fadd_B {#4}}% - \fi - {#1}{#4}{#2}{#3}% + \expandafter \XINT_fadd_Bb + \fi {#1}% }% -\def\XINT_fadd_B #1#2#3#4#5#6#7% +\def\XINT_fadd_B #1#2#3#4#5#6#7{\XINT_fadd_C {#4}{#5}{#7}{#6}[#3]}% +\def\XINT_fadd_Ba #1#2#3#4#5#6#7% {% \expandafter\XINT_fadd_C\expandafter - {\romannumeral0\xintiimul {#7}{#5}}% - {\romannumeral0\xintiiadd - {\romannumeral0\xintiimul {\xintDSH {\the\numexpr -#3+#1\relax}{#6}}{#5}}% - {\romannumeral0\xintiimul {#7}{\xintDSH {\the\numexpr -#2+#1\relax}{#4}}}% - }% - {#1}% + {\romannumeral0\XINT_dsx_zeroloop {#1}{}\Z {#6}}% + {#7}{#5}{#4}[#2]% +}% +\def\XINT_fadd_Bb #1#2#3#4#5#6#7% +{% + \expandafter\XINT_fadd_C\expandafter + {\romannumeral0\XINT_dsx_zeroloop {-#1}{}\Z {#4}}% + {#5}{#7}{#6}[#3]% }% \def\XINT_fadd_C #1#2#3% {% - \expandafter\XINT_fadd_D\expandafter {#2}{#3}{#1}% + \ifcase\romannumeral0\XINT_cmp_pre {#2}{#3} %<- intentional space here. + \expandafter\XINT_fadd_eq + \or\expandafter\XINT_fadd_D + \else\expandafter\XINT_fadd_Da + \fi {#2}{#3}{#1}% }% -\def\XINT_fadd_D #1#2{\XINT_outfrac {#2}{#1}}% -\def\xintSub {\romannumeral0\xintsub }% -\def\xintsub #1% +\def\XINT_fadd_eq #1#2#3#4%#5% {% - \expandafter\xint_fsub\expandafter {\romannumeral0\XINT_infrac {#1}}% + \expandafter\XINT_fadd_G + \romannumeral0\xintiiadd {#3}{#4}/#1%[#5]% }% -\def\xint_fsub #1#2% - {\expandafter\XINT_fsub_A\romannumeral0\XINT_infrac {#2}#1}% -\def\XINT_fsub_A #1#2#3#4% +\def\XINT_fadd_D #1#2% {% - \ifnum #4 > #1 - \xint_afterfi {\XINT_fsub_B {#1}}% - \else - \xint_afterfi {\XINT_fsub_B {#4}}% - \fi - {#1}{#4}{#2}{#3}% + \expandafter\XINT_fadd_E\romannumeral0\XINT_div_prepare {#2}{#1}{#1}{#2}% }% -\def\XINT_fsub_B #1#2#3#4#5#6#7% +\def\XINT_fadd_E #1#2% {% - \expandafter\XINT_fsub_C\expandafter - {\romannumeral0\xintiimul {#7}{#5}}% - {\romannumeral0\xintiisub - {\romannumeral0\xintiimul {\xintDSH {\the\numexpr -#3+#1\relax}{#6}}{#5}}% - {\romannumeral0\xintiimul {#7}{\xintDSH {\the\numexpr -#2+#1\relax}{#4}}}% - }% - {#1}% + \if0\XINT_Sgn #2\Z + \expandafter\XINT_fadd_F + \else\expandafter\XINT_fadd_K + \fi {#1}% +}% +\def\XINT_fadd_F #1#2#3#4#5%#6% +{% + \expandafter\XINT_fadd_G + \romannumeral0\xintiiadd {\xintiiMul {#5}{#1}}{#4}/#2%[#6]% +}% +\def\XINT_fadd_Da #1#2% +{% + \expandafter\XINT_fadd_Ea\romannumeral0\XINT_div_prepare {#1}{#2}{#1}{#2}% +}% +\def\XINT_fadd_Ea #1#2% +{% + \if0\XINT_Sgn #2\Z + \expandafter\XINT_fadd_Fa + \else\expandafter\XINT_fadd_K + \fi {#1}% +}% +\def\XINT_fadd_Fa #1#2#3#4#5%#6% +{% + \expandafter\XINT_fadd_G + \romannumeral0\xintiiadd {\xintiiMul {#4}{#1}}{#5}/#3%[#6]% }% -\def\XINT_fsub_C #1#2#3% +\def\XINT_fadd_G #1{\if0#1\XINT_fadd_iszero\fi\space #1}% +\def\XINT_fadd_K #1#2#3#4#5% {% - \expandafter\XINT_fsub_D\expandafter {#2}{#3}{#1}% + \expandafter\XINT_fadd_L + \romannumeral0\xintiiadd {\xintiiMul {#2}{#5}}{\xintiiMul {#3}{#4}}.% + {{#2}{#3}}% }% -\def\XINT_fsub_D #1#2{\XINT_outfrac {#2}{#1}}% +\def\XINT_fadd_L #1{\if0#1\XINT_fadd_iszero\fi \XINT_fadd_M #1}% +\def\XINT_fadd_M #1.#2{\expandafter\XINT_fadd_N \expandafter + {\romannumeral0\xintiimul #2}{#1}}% +\def\XINT_fadd_N #1#2{ #2/#1}% +\edef\XINT_fadd_iszero\fi #1[#2]{\noexpand\fi\space 0/1[0]}% ou [#2] originel? +\def\xintSub {\romannumeral0\xintsub }% +\def\xintsub #1{\expandafter\xint_fsub\romannumeral0\xintraw {#1}}% +\def\xint_fsub #1{\xint_gob_til_zero #1\XINT_fsub_Azero 0\XINT_fsub_a #1}% +\def\XINT_fsub_Azero #1]{\xintopp }% +\def\XINT_fsub_a #1/#2[#3]#4% + {\expandafter\XINT_fsub_b\romannumeral0\xintraw {#4}{#3}{#1}{#2}}% +\def\XINT_fsub_b #1{\xint_UDzerominusfork + #1-\XINT_fadd_Bzero + 0#1\XINT_fadd_c + 0-{\XINT_fadd_c -#1}% + \krof }% \def\xintSum {\romannumeral0\xintsum }% \def\xintsum #1{\xintsumexpr #1\relax }% \def\xintSumExpr {\romannumeral0\xintsumexpr }% @@ -1579,30 +1626,36 @@ }% \def\XINT_fsum_finished #1\Z #2{ #2}% \def\xintMul {\romannumeral0\xintmul }% -\def\xintmul #1% +\def\xintmul #1{\expandafter\xint_fmul\romannumeral0\xintraw {#1}.}% +\def\xint_fmul #1{\xint_gob_til_zero #1\XINT_fmul_zero 0\XINT_fmul_a #1}% +\def\XINT_fmul_a #1[#2].#3% + {\expandafter\XINT_fmul_b\romannumeral0\xintraw {#3}#1[#2.]}% +\def\XINT_fmul_b #1{\xint_gob_til_zero #1\XINT_fmul_zero 0\XINT_fmul_c #1}% +\def\XINT_fmul_c #1/#2[#3]#4/#5[#6.]% {% - \expandafter\xint_fmul\expandafter {\romannumeral0\XINT_infrac {#1}}% + \expandafter\XINT_fmul_d + \expandafter{\the\numexpr #3+#6\expandafter}% + \expandafter{\romannumeral0\xintiimul {#5}{#2}}% + {\romannumeral0\xintiimul {#4}{#1}}% }% -\def\xint_fmul #1#2% - {\expandafter\XINT_fmul_A\romannumeral0\XINT_infrac {#2}#1}% -\def\XINT_fmul_A #1#2#3#4#5#6% +\def\XINT_fmul_d #1#2#3% {% - \expandafter\XINT_fmul_B - \expandafter{\the\numexpr #1+#4\expandafter}% - \expandafter{\romannumeral0\xintiimul {#6}{#3}}% - {\romannumeral0\xintiimul {#5}{#2}}% + \expandafter \XINT_fmul_e \expandafter{#3}{#1}{#2}% }% -\def\XINT_fmul_B #1#2#3% -{% - \expandafter \XINT_fmul_C \expandafter{#3}{#1}{#2}% -}% -\def\XINT_fmul_C #1#2{\XINT_outfrac {#2}{#1}}% +\def\XINT_fmul_e #1#2{\XINT_outfrac {#2}{#1}}% +\def\XINT_fmul_zero #1.#2{ 0/1[0]}% \def\xintSqr {\romannumeral0\xintsqr }% -\def\xintsqr #1% +\def\xintsqr #1{\expandafter\xint_fsqr\romannumeral0\xintraw {#1}}% +\def\xint_fsqr #1{\xint_gob_til_zero #1\XINT_fsqr_zero 0\XINT_fsqr_a #1}% +\def\xint_fsqr_a #1/#2[#3]% {% - \expandafter\xint_fsqr\expandafter{\romannumeral0\XINT_infrac {#1}}% + \expandafter\XINT_fsqr_b + \expandafter{\the\numexpr #3+#3\expandafter}% + \expandafter{\romannumeral0\xintiisqr {#2}}% + {\romannumeral0\xintiisqr {#1}}% }% -\def\xint_fsqr #1{\XINT_fmul_A #1#1}% +\def\XINT_fsqr_b #1#2#3{\expandafter \XINT_fmul_e \expandafter{#3}{#1}{#2}}% +\def\XINT_fsqr_zero #1]{ 0/1[0]}% \def\xintPow {\romannumeral0\xintpow }% \def\xintpow #1% {% @@ -1685,7 +1738,55 @@ \expandafter{#3}{#1}{#2}% }% \def\XINT_fdiv_C #1#2{\XINT_outfrac {#2}{#1}}% -\def\xintIsOne {\romannumeral0\xintisone }% +\def\xintDivFloor {\romannumeral0\xintdivfloor }% +\def\xintdivfloor #1#2{\xintfloor{\xintDiv {#1}{#2}}}% +\def\xintDivTrunc {\romannumeral0\xintdivtrunc }% +\def\xintdivtrunc #1#2{\xintitrunc 0{\xintDiv {#1}{#2}}}% +\def\xintDivRound {\romannumeral0\xintdivround }% +\def\xintdivround #1#2{\xintiround 0{\xintDiv {#1}{#2}}}% +\def\xintMod {\romannumeral0\xintmod }% +\def\xintmod #1{\expandafter\XINT_mod_a\romannumeral0\xintraw{#1}.}% +\def\XINT_mod_a #1#2.#3% + {\expandafter\XINT_mod_b\expandafter #1\romannumeral0\xintraw{#3}#2.}% +\def\XINT_mod_b #1#2% #1 de A, #2 de B. +{% + \if0#2\xint_dothis\XINT_mod_divbyzero\fi + \if0#1\xint_dothis\XINT_mod_aiszero\fi + \if-#2\xint_dothis{\XINT_mod_bneg #1}\fi + \xint_orthat{\XINT_mod_bpos #1#2}% +}% +\def\XINT_mod_bpos #1% +{% + \xint_UDsignfork + #1{\xintiiopp\XINT_mod_pos {}}% + -{\XINT_mod_pos #1}% + \krof +}% +\def\XINT_mod_bneg #1% +{% + \xint_UDsignfork + #1{\xintiiopp\XINT_mod_pos {}}% + -{\XINT_mod_pos #1}% + \krof +}% +\def\XINT_mod_divbyzero #1.{\xintError:DivisionByZero\space 0/1[0]}% +\def\XINT_mod_aiszero #1.{ 0/1[0]}% +\def\XINT_mod_pos #1#2/#3[#4]#5/#6[#7].% +{% + \expandafter\XINT_mod_pos_a + \the\numexpr\ifnum#7>#4 #4\else #7\fi\expandafter.\expandafter + {\romannumeral0\xintiimul {#6}{#3}}% n fois u + {\xintiiE{\xintiiMul {#1#5}{#3}}{#7-#4}}% m fois u + {\xintiiE{\xintiiMul {#2}{#6}}{#4-#7}}% t fois n +}% +\def\XINT_mod_pos_a #1.#2#3#4{\xintiirem {#3}{#4}/#2[#1]}% +\def\XINTinFloatMod {\romannumeral0\XINTinfloatmod [\XINTdigits]}% +\def\XINTinfloatmod [#1]#2#3{\expandafter\XINT_infloatmod\expandafter + {\romannumeral0\XINTinfloat[#1]{#2}}% + {\romannumeral0\XINTinfloat[#1]{#3}}{#1}}% +\def\XINT_infloatmod #1#2{\expandafter\XINT_infloatmod_a\expandafter {#2}{#1}}% +\def\XINT_infloatmod_a #1#2#3{\XINTinfloat [#3]{\xintMod {#2}{#1}}}% +\def\xintIsOne {\romannumeral0\xintisone }% \def\xintisone #1{\expandafter\XINT_fracisone \romannumeral0\xintrawwithzeros{#1}\Z }% \def\XINT_fracisone #1/#2\Z @@ -1831,7 +1932,6 @@ \def\XINT_minof_d #1\Z {\expandafter\XINT_minof_b\romannumeral0\xintmin {#1}}% \def\XINT_minof_e #1\Z #2\Z { #2}% -\def\xintCmp {\romannumeral0\xintcmp }% \def\xintcmp #1% {% \expandafter\xint_fcmp\expandafter {\romannumeral0\xintraw {#1}}% @@ -2514,84 +2614,6 @@ {\expandafter\XINT_flminof_b\romannumeral0\xintmin {\XINTinFloat [\XINTdigits]{#1}}}% \def\XINT_flminof_e #1\Z #2\Z { #2}% -\def\xintRound:csv #1{\expandafter\XINT_round:_a\romannumeral-`0#1,,^}% -\def\XINT_round:_a {\XINT_round:_b {}}% -\def\XINT_round:_b #1#2,% - {\expandafter\XINT_round:_c\romannumeral-`0#2,{#1}}% -\def\XINT_round:_c #1{\if #1,\expandafter\XINT_:_f - \else\expandafter\XINT_round:_d\fi #1}% -\def\XINT_round:_d #1,% - {\expandafter\XINT_round:_e\romannumeral0\xintiround 0{#1},}% -\def\XINT_round:_e #1,#2{\XINT_round:_b {#2,#1}}% -\def\xintFloat:csv #1{\expandafter\XINT_float:_a\romannumeral-`0#1,,^}% -\def\XINT_float:_a {\XINT_float:_b {}}% -\def\XINT_float:_b #1#2,% - {\expandafter\XINT_float:_c\romannumeral-`0#2,{#1}}% -\def\XINT_float:_c #1{\if #1,\expandafter\XINT_:_f - \else\expandafter\XINT_float:_d\fi #1}% -\def\XINT_float:_d #1,% - {\expandafter\XINT_float:_e\romannumeral0\xintfloat {#1},}% -\def\XINT_float:_e #1,#2{\XINT_float:_b {#2,#1}}% -\def\xintSum:csv #1{\expandafter\XINT_sum:_a\romannumeral-`0#1,,^}% -\def\XINT_sum:_a {\XINT_sum:_b {0/1[0]}}% -\def\XINT_sum:_b #1#2,{\expandafter\XINT_sum:_c\romannumeral-`0#2,{#1}}% -\def\XINT_sum:_c #1{\if #1,\expandafter\XINT_:_e - \else\expandafter\XINT_sum:_d\fi #1}% -\def\XINT_sum:_d #1,#2{\expandafter\XINT_sum:_b\expandafter - {\romannumeral0\xintadd {#2}{#1}}}% -\def\xintPrd:csv #1{\expandafter\XINT_prd:_a\romannumeral-`0#1,,^}% -\def\XINT_prd:_a {\XINT_prd:_b {1/1[0]}}% -\def\XINT_prd:_b #1#2,{\expandafter\XINT_prd:_c\romannumeral-`0#2,{#1}}% -\def\XINT_prd:_c #1{\if #1,\expandafter\XINT_:_e - \else\expandafter\XINT_prd:_d\fi #1}% -\def\XINT_prd:_d #1,#2{\expandafter\XINT_prd:_b\expandafter - {\romannumeral0\xintmul {#2}{#1}}}% -\def\xintMaxof:csv #1{\expandafter\XINT_maxof:_b\romannumeral-`0#1,,}% -\def\XINT_maxof:_b #1,#2,{\expandafter\XINT_maxof:_c\romannumeral-`0#2,{#1},}% -\def\XINT_maxof:_c #1{\if #1,\expandafter\XINT_of:_e - \else\expandafter\XINT_maxof:_d\fi #1}% -\def\XINT_maxof:_d #1,{\expandafter\XINT_maxof:_b\romannumeral0\xintmax {#1}}% -\def\xintMinof:csv #1{\expandafter\XINT_minof:_b\romannumeral-`0#1,,}% -\def\XINT_minof:_b #1,#2,{\expandafter\XINT_minof:_c\romannumeral-`0#2,{#1},}% -\def\XINT_minof:_c #1{\if #1,\expandafter\XINT_of:_e - \else\expandafter\XINT_minof:_d\fi #1}% -\def\XINT_minof:_d #1,{\expandafter\XINT_minof:_b\romannumeral0\xintmin {#1}}% -\def\XINTinFloatMinof:csv #1{\expandafter\XINT_flminof:_a\romannumeral-`0#1,,}% -\def\XINT_flminof:_a #1,{\expandafter\XINT_flminof:_b - \romannumeral0\XINTinfloat [\XINTdigits]{#1},}% -\def\XINT_flminof:_b #1,#2,% - {\expandafter\XINT_flminof:_c\romannumeral-`0#2,{#1},}% -\def\XINT_flminof:_c #1{\if #1,\expandafter\XINT_of:_e - \else\expandafter\XINT_flminof:_d\fi #1}% -\def\XINT_flminof:_d #1,% - {\expandafter\XINT_flminof:_b\romannumeral0\xintmin - {\XINTinFloat [\XINTdigits]{#1}}}% -\def\XINTinFloatMaxof:csv #1{\expandafter\XINT_flmaxof:_a\romannumeral-`0#1,,}% -\def\XINT_flmaxof:_a #1,{\expandafter\XINT_flmaxof:_b - \romannumeral0\XINTinfloat [\XINTdigits]{#1},}% -\def\XINT_flmaxof:_b #1,#2,% - {\expandafter\XINT_flmaxof:_c\romannumeral-`0#2,{#1},}% -\def\XINT_flmaxof:_c #1{\if #1,\expandafter\XINT_of:_e - \else\expandafter\XINT_flmaxof:_d\fi #1}% -\def\XINT_flmaxof:_d #1,% - {\expandafter\XINT_flmaxof:_b\romannumeral0\xintmax - {\XINTinFloat [\XINTdigits]{#1}}}% -\def\XINTinFloatSum:csv #1{\expandafter\XINT_floatsum:_a\romannumeral-`0#1,,^}% -\def\XINT_floatsum:_a {\XINT_floatsum:_b {0[0]}}% -\def\XINT_floatsum:_b #1#2,% - {\expandafter\XINT_floatsum:_c\romannumeral-`0#2,{#1}}% -\def\XINT_floatsum:_c #1{\if #1,\expandafter\XINT_:_e - \else\expandafter\XINT_floatsum:_d\fi #1}% -\def\XINT_floatsum:_d #1,#2{\expandafter\XINT_floatsum:_b\expandafter - {\romannumeral0\XINTinfloatadd {#2}{#1}}}% -\def\XINTinFloatPred:csv #1{\expandafter\XINT_floatprd:_a\romannumeral-`0#1,,^}% -\def\XINT_floatprd:_a {\XINT_floatprd:_b {1[0]}}% -\def\XINT_floatprd:_b #1#2,% - {\expandafter\XINT_floatprd:_c\romannumeral-`0#2,{#1}}% -\def\XINT_floatprd:_c #1{\if #1,\expandafter\XINT_:_e - \else\expandafter\XINT_floatprd:_d\fi #1}% -\def\XINT_floatprd:_d #1,#2{\expandafter\XINT_floatprd:_b\expandafter - {\romannumeral0\XINTinfloatmul {#2}{#1}}}% \XINT_restorecatcodes_endinput% \endinput %% diff --git a/Master/texmf-dist/tex/generic/xint/xintgcd.sty b/Master/texmf-dist/tex/generic/xint/xintgcd.sty index 15f5e156046..ec42410dc1c 100644 --- a/Master/texmf-dist/tex/generic/xint/xintgcd.sty +++ b/Master/texmf-dist/tex/generic/xint/xintgcd.sty @@ -20,11 +20,11 @@ %% original source files, as listed above, are part of the %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) -%%---------------------------------------------------------------- -%% The xint bundle (version 1.09n of April 1st, 2014) -%% xintgcd: Euclidean algorithm with xint package +%% --------------------------------------------------------------- +%% The xint bundle v1.1 (2014/10/28) %% Copyright (C) 2013-2014 by Jean-Francois Burnol -%%---------------------------------------------------------------- +%% xintgcd: Euclidean algorithm with xint package +%% --------------------------------------------------------------- \begingroup\catcode61\catcode48\catcode32=10\relax% \catcode13=5 % ^^M \endlinechar=13 % @@ -36,10 +36,9 @@ \catcode45=12 % - \catcode46=12 % . \catcode58=12 % : - \def\space { }% \let\z\endgroup \expandafter\let\expandafter\x\csname ver@xintgcd.sty\endcsname - \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname + \expandafter\let\expandafter\w\csname ver@xintcore.sty\endcsname \expandafter \ifx\csname PackageInfo\endcsname\relax \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% @@ -52,56 +51,26 @@ \aftergroup\endinput \else \ifx\x\relax % plain-TeX, first loading of xintgcd.sty - \ifx\w\relax % but xint.sty not yet loaded. - \y{xintgcd}{now issuing \string\input\space xint.sty}% - \def\z{\endgroup\input xint.sty\relax}% + \ifx\w\relax % but xintcore.sty not yet loaded. + \def\z{\endgroup\input xintcore.sty\relax}% \fi \else \def\empty {}% \ifx\x\empty % LaTeX, first loading, % variable is initialized, but \ProvidesPackage not yet seen - \ifx\w\relax % xint.sty not yet loaded. - \y{xintgcd}{now issuing \string\RequirePackage{xint}}% - \def\z{\endgroup\RequirePackage{xint}}% + \ifx\w\relax % xintcore.sty not yet loaded. + \def\z{\endgroup\RequirePackage{xintcore}}% \fi \else - \y{xintgcd}{I was already loaded, aborting input}% - \aftergroup\endinput + \aftergroup\endinput % xintgcd already loaded. \fi \fi \fi \z% -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode123=1 % { - \catcode125=2 % } - \catcode64=11 % @ - \catcode35=6 % # - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode58=12 % : - \ifdefined\PackageInfo - \def\y#1#2{\PackageInfo{#1}{#2}}% - \else - \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% - \fi - \def\empty {}% - \expandafter\let\expandafter\w\csname ver@xint.sty\endcsname - \ifx\w\relax % Plain TeX, user gave a file name at the prompt - \y{xintgcd}{Loading of package xint failed, aborting input}% - \aftergroup\endinput - \fi - \ifx\w\empty % LaTeX, user gave a file name at the prompt - \y{xintgcd}{Loading of package xint failed, aborting input}% - \aftergroup\endinput - \fi -\endgroup% -\XINTsetupcatcodes% +\XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintgcd}% - [2014/04/01 v1.09n Euclide algorithm with xint package (jfB)]% + [2014/10/28 v1.1 Euclide algorithm with xint package (jfB)]% \def\xintGCD {\romannumeral0\xintgcd }% \def\xintgcd #1% {% @@ -135,13 +104,6 @@ \romannumeral0\XINT_div_prepare {#1}{#2}\Z {#1}% }% -\def\xintGCDof {\romannumeral0\xintgcdof }% -\def\xintgcdof #1{\expandafter\XINT_gcdof_a\romannumeral-`0#1\relax }% -\def\XINT_gcdof_a #1{\expandafter\XINT_gcdof_b\romannumeral-`0#1\Z }% -\def\XINT_gcdof_b #1\Z #2{\expandafter\XINT_gcdof_c\romannumeral-`0#2\Z {#1}\Z}% -\def\XINT_gcdof_c #1{\xint_gob_til_relax #1\XINT_gcdof_e\relax\XINT_gcdof_d #1}% -\def\XINT_gcdof_d #1\Z {\expandafter\XINT_gcdof_b\romannumeral0\xintgcd {#1}}% -\def\XINT_gcdof_e #1\Z #2\Z { #2}% \def\xintLCM {\romannumeral0\xintlcm}% \def\xintlcm #1% {% @@ -164,13 +126,6 @@ \def\XINT_lcm_AisZero #1#2#3#4#5{ 0}% \def\XINT_lcm_BisZero #1#2#3#4#5{ 0}% \def\XINT_lcm_notzero #1#2#3{\xintiimul {#2}{\xintiiQuo{#3}{#1}}}% -\def\xintLCMof {\romannumeral0\xintlcmof }% -\def\xintlcmof #1{\expandafter\XINT_lcmof_a\romannumeral-`0#1\relax }% -\def\XINT_lcmof_a #1{\expandafter\XINT_lcmof_b\romannumeral-`0#1\Z }% -\def\XINT_lcmof_b #1\Z #2{\expandafter\XINT_lcmof_c\romannumeral-`0#2\Z {#1}\Z}% -\def\XINT_lcmof_c #1{\xint_gob_til_relax #1\XINT_lcmof_e\relax\XINT_lcmof_d #1}% -\def\XINT_lcmof_d #1\Z {\expandafter\XINT_lcmof_b\romannumeral0\xintlcm {#1}}% -\def\XINT_lcmof_e #1\Z #2\Z { #2}% \def\xintBezout {\romannumeral0\xintbezout }% \def\xintbezout #1% {% @@ -421,7 +376,29 @@ {% \space {#1}{#3}{0}{1}{#2}{#4}{1}{0}% }% -\def\xintTypesetEuclideAlgorithm #1#2% +\def\xintGCDof {\romannumeral0\xintgcdof }% +\def\xintgcdof #1{\expandafter\XINT_gcdof_a\romannumeral-`0#1\relax }% +\def\XINT_gcdof_a #1{\expandafter\XINT_gcdof_b\romannumeral-`0#1\Z }% +\def\XINT_gcdof_b #1\Z #2{\expandafter\XINT_gcdof_c\romannumeral-`0#2\Z {#1}\Z}% +\def\XINT_gcdof_c #1{\xint_gob_til_relax #1\XINT_gcdof_e\relax\XINT_gcdof_d #1}% +\def\XINT_gcdof_d #1\Z {\expandafter\XINT_gcdof_b\romannumeral0\xintgcd {#1}}% +\def\XINT_gcdof_e #1\Z #2\Z { #2}% +\def\xintLCMof {\romannumeral0\xintlcmof }% +\def\xintlcmof #1{\expandafter\XINT_lcmof_a\romannumeral-`0#1\relax }% +\def\XINT_lcmof_a #1{\expandafter\XINT_lcmof_b\romannumeral-`0#1\Z }% +\def\XINT_lcmof_b #1\Z #2{\expandafter\XINT_lcmof_c\romannumeral-`0#2\Z {#1}\Z}% +\def\XINT_lcmof_c #1{\xint_gob_til_relax #1\XINT_lcmof_e\relax\XINT_lcmof_d #1}% +\def\XINT_lcmof_d #1\Z {\expandafter\XINT_lcmof_b\romannumeral0\xintlcm {#1}}% +\def\XINT_lcmof_e #1\Z #2\Z { #2}% +\def\xintTypesetEuclideAlgorithm {% + \unless\ifdefined\xintAssignArray + \errmessage + {xintgcd: package xinttools is required for \string\xintTypesetEuclideAlgorithm}% + \expandafter\xint_gobble_iii + \fi + \XINT_TypesetEuclideAlgorithm +}% +\def\XINT_TypesetEuclideAlgorithm #1#2% {% l'algo remplace #1 et #2 par |#1| et |#2| \par \begingroup @@ -440,7 +417,15 @@ \repeat \endgroup }% -\def\xintTypesetBezoutAlgorithm #1#2% +\def\xintTypesetBezoutAlgorithm {% + \unless\ifdefined\xintAssignArray + \errmessage + {xintgcd: package xinttools is required for \string\xintTypesetBezoutAlgorithm}% + \expandafter\xint_gobble_iii + \fi + \XINT_TypesetBezoutAlgorithm +}% +\def\XINT_TypesetBezoutAlgorithm #1#2% {% \par \begingroup @@ -476,16 +461,6 @@ \par \endgroup }% -\def\xintGCDof:csv #1{\expandafter\XINT_gcdof:_b\romannumeral-`0#1,,}% -\def\XINT_gcdof:_b #1,#2,{\expandafter\XINT_gcdof:_c\romannumeral-`0#2,{#1},}% -\def\XINT_gcdof:_c #1{\if #1,\expandafter\XINT_of:_e - \else\expandafter\XINT_gcdof:_d\fi #1}% -\def\XINT_gcdof:_d #1,{\expandafter\XINT_gcdof:_b\romannumeral0\xintgcd {#1}}% -\def\xintLCMof:csv #1{\expandafter\XINT_lcmof:_a\romannumeral-`0#1,,}% -\def\XINT_lcmof:_a #1,#2,{\expandafter\XINT_lcmof:_c\romannumeral-`0#2,{#1},}% -\def\XINT_lcmof:_c #1{\if#1,\expandafter\XINT_of:_e - \else\expandafter\XINT_lcmof:_d\fi #1}% -\def\XINT_lcmof:_d #1,{\expandafter\XINT_lcmof:_a\romannumeral0\xintlcm {#1}}% \XINT_restorecatcodes_endinput% \endinput %% diff --git a/Master/texmf-dist/tex/generic/xint/xintkernel.sty b/Master/texmf-dist/tex/generic/xint/xintkernel.sty new file mode 100644 index 00000000000..16300608b64 --- /dev/null +++ b/Master/texmf-dist/tex/generic/xint/xintkernel.sty @@ -0,0 +1,254 @@ +%% +%% This is file `xintkernel.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xint.dtx (with options: `xintkernel') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from xintkernel.sty. +%% +%% For distribution of the original source see the terms +%% for copying and modification in the file xint.dtx. +%% +%% This generated file may be distributed as long as the +%% original source files, as listed above, are part of the +%% same distribution. (The sources need not necessarily be +%% in the same archive or directory.) +%% --------------------------------------------------------------- +%% The xint bundle v1.1 (2014/10/28) +%% Copyright (C) 2013-2014 by Jean-Francois Burnol +%% xintkernel: Paraphernalia for the xint packages +%% --------------------------------------------------------------- +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode123=1 % { + \catcode125=2 % } + \catcode35=6 % # + \catcode44=12 % , + \catcode45=12 % - + \catcode46=12 % . + \catcode58=12 % : + \catcode95=11 % _ + \expandafter + \ifx\csname PackageInfo\endcsname\relax + \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% + \else + \def\y#1#2{\PackageInfo{#1}{#2}}% + \fi + \expandafter + \ifx\csname numexpr\endcsname\relax + \y{xintkernel}{\numexpr not available, aborting input}% + \aftergroup\endinput + \else + \expandafter + \ifx\csname XINTsetupcatcodes\endcsname\relax + \else + \y{xintkernel}{I was already loaded, aborting input}% + \aftergroup\endinput + \fi + \fi + \def\SetCatcodesIfInputNotAborted + {% + \endgroup + \def\XINT_restorecatcodes + {% takes care of all, to allow more economical code in modules + \catcode59=\the\catcode59 % ; xintexpr + \catcode126=\the\catcode126 % ~ xintexpr + \catcode39=\the\catcode39 % ' xintexpr + \catcode34=\the\catcode34 % " xintbinhex, and xintexpr + \catcode63=\the\catcode63 % ? xintexpr + \catcode124=\the\catcode124 % | xintexpr + \catcode38=\the\catcode38 % & xintexpr + \catcode64=\the\catcode64 % @ xintexpr + \catcode33=\the\catcode33 % ! xintexpr + \catcode93=\the\catcode93 % ] -, xintfrac, xintseries, xintcfrac + \catcode91=\the\catcode91 % [ -, xintfrac, xintseries, xintcfrac + \catcode36=\the\catcode36 % $ xintgcd only + \catcode94=\the\catcode94 % ^ + \catcode96=\the\catcode96 % ` + \catcode47=\the\catcode47 % / + \catcode41=\the\catcode41 % ) + \catcode40=\the\catcode40 % ( + \catcode42=\the\catcode42 % * + \catcode43=\the\catcode43 % + + \catcode62=\the\catcode62 % > + \catcode60=\the\catcode60 % < + \catcode58=\the\catcode58 % : + \catcode46=\the\catcode46 % . + \catcode45=\the\catcode45 % - + \catcode44=\the\catcode44 % , + \catcode35=\the\catcode35 % # + \catcode95=\the\catcode95 % _ + \catcode125=\the\catcode125 % } + \catcode123=\the\catcode123 % { + \endlinechar=\the\endlinechar + \catcode13=\the\catcode13 % ^^M + \catcode32=\the\catcode32 % + \catcode61=\the\catcode61\relax % = + }% + \edef\XINT_restorecatcodes_endinput + {% + \XINT_restorecatcodes\noexpand\endinput % + }% + \def\XINT_setcatcodes + {% + \catcode61=12 % = + \catcode32=10 % space + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode123=1 % { + \catcode125=2 % } + \catcode95=11 % _ LETTER + \catcode35=6 % # + \catcode44=12 % , + \catcode45=12 % - + \catcode46=12 % . + \catcode58=11 % : LETTER + \catcode60=12 % < + \catcode62=12 % > + \catcode43=12 % + + \catcode42=12 % * + \catcode40=12 % ( + \catcode41=12 % ) + \catcode47=12 % / + \catcode96=12 % ` + \catcode94=11 % ^ LETTER + \catcode36=3 % $ + \catcode91=12 % [ + \catcode93=12 % ] + \catcode33=11 % ! LETTER + \catcode64=11 % @ LETTER + \catcode38=12 % & + \catcode124=12 % | + \catcode63=11 % ? LETTER + \catcode34=12 % " + \catcode39=12 % ' + \catcode126=3 % ~ + \catcode59=12 % ; + }% + \XINT_setcatcodes + }% +\SetCatcodesIfInputNotAborted +\def\XINTsetupcatcodes {% for use by other modules + \edef\XINT_restorecatcodes_endinput + {% + \XINT_restorecatcodes\noexpand\endinput % + }% + \XINT_setcatcodes +}% +\ifdefined\ProvidesPackage + \let\XINT_providespackage\relax +\else + \def\XINT_providespackage #1#2[#3]% + {\immediate\write-1{Package: #2 #3}% + \expandafter\xdef\csname ver@#2.sty\endcsname{#3}}% +\fi +\XINT_providespackage +\ProvidesPackage {xintkernel}% + [2014/10/28 v1.1 Paraphernalia for the xint packages (jfB)]% +\long\def\xint_gobble_ {}% +\long\def\xint_gobble_i #1{}% +\long\def\xint_gobble_ii #1#2{}% +\long\def\xint_gobble_iii #1#2#3{}% +\long\def\xint_gobble_iv #1#2#3#4{}% +\long\def\xint_gobble_v #1#2#3#4#5{}% +\long\def\xint_gobble_vi #1#2#3#4#5#6{}% +\long\def\xint_gobble_vii #1#2#3#4#5#6#7{}% +\long\def\xint_gobble_viii #1#2#3#4#5#6#7#8{}% +\long\def\xint_firstofone #1{#1}% +\long\def\xint_firstoftwo #1#2{#1}% +\long\def\xint_secondoftwo #1#2{#2}% +\long\def\xint_firstofone_thenstop #1{ #1}% +\long\def\xint_firstoftwo_thenstop #1#2{ #1}% +\long\def\xint_secondoftwo_thenstop #1#2{ #2}% +\def\xint_gob_til_zero #10{}% +\def\xint_UDzerominusfork #10-#2#3\krof {#2}% +\long\def\xint_gob_til_R #1\R {}% +\long\def\xint_gob_til_W #1\W {}% +\long\def\xint_gob_til_Z #1\Z {}% +\let\xint_relax\relax +\def\xint_brelax {\xint_relax }% +\long\def\xint_gob_til_xint_relax #1\xint_relax {}% +\long\def\xint_afterfi #1#2\fi {\fi #1}% +\long\def\xint_bye #1\xint_bye {}% +\long\def\xint_dothis #1#2\xint_orthat #3{\fi #1}% v1.1 +\let\xint_orthat \xint_firstofone +\def\xint_zapspaces #1 #2{#1#2\xint_zapspaces }% v1.1 +\chardef\xint_c_ 0 +\chardef\xint_c_i 1 +\chardef\xint_c_ii 2 +\chardef\xint_c_iii 3 +\chardef\xint_c_iv 4 +\chardef\xint_c_v 5 +\chardef\xint_c_vi 6 +\chardef\xint_c_vii 7 +\chardef\xint_c_viii 8 +\def\xintodef #1{\expandafter\def\expandafter#1\expandafter }% +\def\xintoodef #1{\expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter#1% + \expandafter\expandafter\expandafter }% +\def\xintfdef #1#2{\expandafter\def\expandafter#1\expandafter + {\romannumeral-`0#2}}% +\ifdefined\odef\else\let\odef\xintodef\fi +\ifdefined\oodef\else\let\oodef\xintoodef\fi +\ifdefined\fdef\else\let\fdef\xintfdef\fi +\def\xintReverseOrder {\romannumeral0\xintreverseorder }% +\long\def\xintreverseorder #1% +{% + \XINT_rord_main {}#1% + \xint_relax + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_bye\xint_bye\xint_bye\xint_bye + \xint_relax +}% +\long\def\XINT_rord_main #1#2#3#4#5#6#7#8#9% +{% + \xint_bye #9\XINT_rord_cleanup\xint_bye + \XINT_rord_main {#9#8#7#6#5#4#3#2#1}% +}% +\long\edef\XINT_rord_cleanup\xint_bye\XINT_rord_main #1#2\xint_relax +{% + \noexpand\expandafter\space\noexpand\xint_gob_til_xint_relax #1% +}% +\def\xintLength {\romannumeral0\xintlength }% +\long\def\xintlength #1% +{% + \XINT_length_loop + 0.#1\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye +}% +\long\def\XINT_length_loop #1.#2#3#4#5#6#7#8#9% +{% + \xint_gob_til_xint_relax #9\XINT_length_finish_a\xint_relax + \expandafter\XINT_length_loop\the\numexpr #1+\xint_c_viii.% +}% +\def\XINT_length_finish_a\xint_relax\expandafter\XINT_length_loop + \the\numexpr #1+\xint_c_viii.#2\xint_bye +{% + \XINT_length_finish_b #2\W\W\W\W\W\W\W\Z {#1}% +}% +\def\XINT_length_finish_b #1#2#3#4#5#6#7#8\Z +{% + \xint_gob_til_W + #1\XINT_length_finish_c \xint_c_ + #2\XINT_length_finish_c \xint_c_i + #3\XINT_length_finish_c \xint_c_ii + #4\XINT_length_finish_c \xint_c_iii + #5\XINT_length_finish_c \xint_c_iv + #6\XINT_length_finish_c \xint_c_v + #7\XINT_length_finish_c \xint_c_vi + \W\XINT_length_finish_c \xint_c_vii\Z +}% +\edef\XINT_length_finish_c #1#2\Z #3% + {\noexpand\expandafter\space\noexpand\the\numexpr #3+#1\relax}% +\XINT_restorecatcodes_endinput% +\endinput +%% +%% End of file `xintkernel.sty'. diff --git a/Master/texmf-dist/tex/generic/xint/xintseries.sty b/Master/texmf-dist/tex/generic/xint/xintseries.sty index a17ffd47f83..0f0ceeac680 100644 --- a/Master/texmf-dist/tex/generic/xint/xintseries.sty +++ b/Master/texmf-dist/tex/generic/xint/xintseries.sty @@ -20,11 +20,11 @@ %% original source files, as listed above, are part of the %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) -%%---------------------------------------------------------------- -%% The xint bundle (version 1.09n of April 1st, 2014) -%% xintseries: Expandable partial sums with xint package +%% --------------------------------------------------------------- +%% The xint bundle v1.1 (2014/10/28) %% Copyright (C) 2013-2014 by Jean-Francois Burnol -%%---------------------------------------------------------------- +%% xintseries: Expandable partial sums with xint package +%% --------------------------------------------------------------- \begingroup\catcode61\catcode48\catcode32=10\relax% \catcode13=5 % ^^M \endlinechar=13 % @@ -36,7 +36,6 @@ \catcode45=12 % - \catcode46=12 % . \catcode58=12 % : - \def\space { }% \let\z\endgroup \expandafter\let\expandafter\x\csname ver@xintseries.sty\endcsname \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname @@ -53,7 +52,6 @@ \else \ifx\x\relax % plain-TeX, first loading of xintseries.sty \ifx\w\relax % but xintfrac.sty not yet loaded. - \y{xintseries}{now issuing \string\input\space xintfrac.sty}% \def\z{\endgroup\input xintfrac.sty\relax}% \fi \else @@ -61,47 +59,18 @@ \ifx\x\empty % LaTeX, first loading, % variable is initialized, but \ProvidesPackage not yet seen \ifx\w\relax % xintfrac.sty not yet loaded. - \y{xintseries}{now issuing \string\RequirePackage{xintfrac}}% \def\z{\endgroup\RequirePackage{xintfrac}}% \fi \else - \y{xintseries}{I was already loaded, aborting input}% - \aftergroup\endinput + \aftergroup\endinput % xintseries already loaded. \fi \fi \fi \z% -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode123=1 % { - \catcode125=2 % } - \catcode64=11 % @ - \catcode35=6 % # - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode58=12 % : - \ifdefined\PackageInfo - \def\y#1#2{\PackageInfo{#1}{#2}}% - \else - \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% - \fi - \def\empty {}% - \expandafter\let\expandafter\w\csname ver@xintfrac.sty\endcsname - \ifx\w\relax % Plain TeX, user gave a file name at the prompt - \y{xintseries}{Loading of package xintfrac failed, aborting input}% - \aftergroup\endinput - \fi - \ifx\w\empty % LaTeX, user gave a file name at the prompt - \y{xintseries}{Loading of package xintfrac failed, aborting input}% - \aftergroup\endinput - \fi -\endgroup% -\XINTsetupcatcodes% +\XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintseries}% - [2014/04/01 v1.09n Expandable partial sums with xint package (jfB)]% + [2014/10/28 v1.1 Expandable partial sums with xint package (jfB)]% \def\xintSeries {\romannumeral0\xintseries }% \def\xintseries #1#2% {% diff --git a/Master/texmf-dist/tex/generic/xint/xinttools.sty b/Master/texmf-dist/tex/generic/xint/xinttools.sty index b95a530dc77..9639b665c8b 100644 --- a/Master/texmf-dist/tex/generic/xint/xinttools.sty +++ b/Master/texmf-dist/tex/generic/xint/xinttools.sty @@ -20,24 +20,25 @@ %% original source files, as listed above, are part of the %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) -%%---------------------------------------------------------------- -%% The xint bundle (version 1.09n of April 1st, 2014) -%% xinttools: Expandable and non-expandable utilities +%% --------------------------------------------------------------- +%% The xint bundle v1.1 (2014/10/28) %% Copyright (C) 2013-2014 by Jean-Francois Burnol -%%---------------------------------------------------------------- +%% xinttools: Expandable and non-expandable utilities +%% --------------------------------------------------------------- \begingroup\catcode61\catcode48\catcode32=10\relax% \catcode13=5 % ^^M \endlinechar=13 % \catcode123=1 % { \catcode125=2 % } \catcode64=11 % @ - \catcode95=11 % _ \catcode35=6 % # \catcode44=12 % , \catcode45=12 % - \catcode46=12 % . \catcode58=12 % : - \expandafter\let\expandafter\x\csname ver@xint.sty\endcsname + \let\z\endgroup + \expandafter\let\expandafter\x\csname ver@xinttools.sty\endcsname + \expandafter\let\expandafter\w\csname ver@xintkernel.sty\endcsname \expandafter \ifx\csname PackageInfo\endcsname\relax \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% @@ -49,177 +50,32 @@ \y{xinttools}{\numexpr not available, aborting input}% \aftergroup\endinput \else - \ifx\x\relax % plain-TeX, first loading + \ifx\x\relax % plain-TeX, first loading of xinttools.sty + \ifx\w\relax % but xintkernel.sty not yet loaded. + \def\z{\endgroup\input xintkernel.sty\relax}% + \fi \else \def\empty {}% \ifx\x\empty % LaTeX, first loading, % variable is initialized, but \ProvidesPackage not yet seen + \ifx\w\relax % xintkernel.sty not yet loaded. + \def\z{\endgroup\RequirePackage{xintkernel}}% + \fi \else - \y{xinttools}{I was already loaded, aborting input}% - \aftergroup\endinput + \aftergroup\endinput % xinttools already loaded. \fi \fi \fi - \def\ChangeCatcodesIfInputNotAborted - {% - \endgroup - \def\XINT_storecatcodes - {% takes care of all, to allow more economical code in modules - \catcode34=\the\catcode34 % " xintbinhex, and 1.09k xintexpr - \catcode63=\the\catcode63 % ? xintexpr - \catcode124=\the\catcode124 % | xintexpr - \catcode38=\the\catcode38 % & xintexpr - \catcode64=\the\catcode64 % @ xintexpr - \catcode33=\the\catcode33 % ! xintexpr - \catcode93=\the\catcode93 % ] -, xintfrac, xintseries, xintcfrac - \catcode91=\the\catcode91 % [ -, xintfrac, xintseries, xintcfrac - \catcode36=\the\catcode36 % $ xintgcd only - \catcode94=\the\catcode94 % ^ - \catcode96=\the\catcode96 % ` - \catcode47=\the\catcode47 % / - \catcode41=\the\catcode41 % ) - \catcode40=\the\catcode40 % ( - \catcode42=\the\catcode42 % * - \catcode43=\the\catcode43 % + - \catcode62=\the\catcode62 % > - \catcode60=\the\catcode60 % < - \catcode58=\the\catcode58 % : - \catcode46=\the\catcode46 % . - \catcode45=\the\catcode45 % - - \catcode44=\the\catcode44 % , - \catcode35=\the\catcode35 % # - \catcode95=\the\catcode95 % _ - \catcode125=\the\catcode125 % } - \catcode123=\the\catcode123 % { - \endlinechar=\the\endlinechar - \catcode13=\the\catcode13 % ^^M - \catcode32=\the\catcode32 % - \catcode61=\the\catcode61\relax % = - }% - \edef\XINT_restorecatcodes_endinput - {% - \XINT_storecatcodes\noexpand\endinput % - }% - \def\XINT_setcatcodes - {% - \catcode61=12 % = - \catcode32=10 % space - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode123=1 % { - \catcode125=2 % } - \catcode95=11 % _ (replaces @ everywhere, starting with 1.06b) - \catcode35=6 % # - \catcode44=12 % , - \catcode45=12 % - - \catcode46=12 % . - \catcode58=11 % : (made letter for error cs) - \catcode60=12 % < - \catcode62=12 % > - \catcode43=12 % + - \catcode42=12 % * - \catcode40=12 % ( - \catcode41=12 % ) - \catcode47=12 % / - \catcode96=12 % ` (for ubiquitous \romannumeral-`0 and some \catcode ) - \catcode94=11 % ^ - \catcode36=3 % $ - \catcode91=12 % [ - \catcode93=12 % ] - \catcode33=11 % ! - \catcode64=11 % @ - \catcode38=12 % & - \catcode124=12 % | - \catcode63=11 % ? - \catcode34=12 % " missing from v < 1.09k although needed in xintbinhex - }% - \XINT_setcatcodes - }% -\ChangeCatcodesIfInputNotAborted -\def\XINTsetupcatcodes {% for use by other modules - \edef\XINT_restorecatcodes_endinput - {% - \XINT_storecatcodes\noexpand\endinput % - }% - \XINT_setcatcodes -}% -\ifdefined\ProvidesPackage - \let\XINT_providespackage\relax -\else - \def\XINT_providespackage #1#2[#3]% - {\immediate\write-1{Package: #2 #3}% - \expandafter\xdef\csname ver@#2.sty\endcsname{#3}}% -\fi +\z% +\XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage -\ProvidesPackage {xinttools}% - [2014/04/01 v1.09n Expandable and non-expandable utilities (jfB)]% -\long\def\xint_gobble_ {}% -\long\def\xint_gobble_i #1{}% -\long\def\xint_gobble_ii #1#2{}% -\long\def\xint_gobble_iii #1#2#3{}% -\long\def\xint_gobble_iv #1#2#3#4{}% -\long\def\xint_gobble_v #1#2#3#4#5{}% -\long\def\xint_gobble_vi #1#2#3#4#5#6{}% -\long\def\xint_gobble_vii #1#2#3#4#5#6#7{}% -\long\def\xint_gobble_viii #1#2#3#4#5#6#7#8{}% -\long\def\xint_firstofone #1{#1}% -\long\def\xint_firstoftwo #1#2{#1}% -\long\def\xint_secondoftwo #1#2{#2}% -\long\def\xint_firstofone_thenstop #1{ #1}% -\long\def\xint_firstoftwo_thenstop #1#2{ #1}% -\long\def\xint_secondoftwo_thenstop #1#2{ #2}% -\def\xint_minus_thenstop { -}% -\def\xint_gob_til_zero #10{}% no need to make it long, so far -\def\xint_UDzerominusfork #10-#2#3\krof {#2}% id. -\long\def\xint_gob_til_R #1\R {}% -\long\def\xint_gob_til_W #1\W {}% -\long\def\xint_gob_til_Z #1\Z {}% -\long\def\xint_bye #1\xint_bye {}% -\let\xint_relax\relax -\def\xint_brelax {\xint_relax }% -\long\def\xint_gob_til_xint_relax #1\xint_relax {}% -\long\def\xint_afterfi #1#2\fi {\fi #1}% -\chardef\xint_c_ 0 -\chardef\xint_c_i 1 -\chardef\xint_c_ii 2 -\chardef\xint_c_iii 3 -\chardef\xint_c_iv 4 -\chardef\xint_c_v 5 -\chardef\xint_c_vi 6 -\chardef\xint_c_vii 7 -\chardef\xint_c_viii 8 +\ProvidesPackage{xinttools}% + [2014/10/28 v1.1 Expandable and non-expandable utilities (jfB)]% \newtoks\XINT_toks \xint_firstofone{\let\XINT_sptoken= } %<- space here! -\def\xintodef #1{\expandafter\def\expandafter#1\expandafter }% -\ifdefined\odef\else\let\odef\xintodef\fi -\def\xintgodef {\global\xintodef }% -\def\xintoodef #1{\expandafter\expandafter\expandafter\def - \expandafter\expandafter\expandafter#1% - \expandafter\expandafter\expandafter }% -\ifdefined\oodef\else\let\oodef\xintoodef\fi +\def\xintgodef {\global\xintodef }% \def\xintgoodef {\global\xintoodef }% -\def\xintfdef #1#2{\expandafter\def\expandafter#1\expandafter - {\romannumeral-`0#2}}% -\ifdefined\fdef\else\let\fdef\xintfdef\fi -\def\xintgfdef {\global\xintfdef }% should be \global\fdef if \fdef pre-exists? -\def\xintReverseOrder {\romannumeral0\xintreverseorder }% -\long\def\xintreverseorder #1% -{% - \XINT_rord_main {}#1% - \xint_relax - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_relax -}% -\long\def\XINT_rord_main #1#2#3#4#5#6#7#8#9% -{% - \xint_bye #9\XINT_rord_cleanup\xint_bye - \XINT_rord_main {#9#8#7#6#5#4#3#2#1}% -}% -\long\edef\XINT_rord_cleanup\xint_bye\XINT_rord_main #1#2\xint_relax -{% - \noexpand\expandafter\space\noexpand\xint_gob_til_xint_relax #1% -}% +\def\xintgfdef {\global\xintfdef }% \def\xintRevWithBraces {\romannumeral0\xintrevwithbraces }% \def\xintRevWithBracesNoExpand {\romannumeral0\xintrevwithbracesnoexpand }% \long\def\xintrevwithbraces #1% @@ -261,72 +117,36 @@ \space \csname xint_gobble_\romannumeral #1\endcsname }% -\def\xintLength {\romannumeral0\xintlength }% -\long\def\xintlength #1% -{% - \XINT_length_loop - 0.#1\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye -}% -\long\def\XINT_length_loop #1.#2#3#4#5#6#7#8#9% -{% - \xint_gob_til_xint_relax #9\XINT_length_finish_a\xint_relax - \expandafter\XINT_length_loop\the\numexpr #1+\xint_c_viii.% -}% -\def\XINT_length_finish_a\xint_relax\expandafter\XINT_length_loop - \the\numexpr #1+\xint_c_viii.#2\xint_bye -{% - \XINT_length_finish_b #2\W\W\W\W\W\W\W\Z {#1}% -}% -\def\XINT_length_finish_b #1#2#3#4#5#6#7#8\Z -{% - \xint_gob_til_W - #1\XINT_length_finish_c \xint_c_ - #2\XINT_length_finish_c \xint_c_i - #3\XINT_length_finish_c \xint_c_ii - #4\XINT_length_finish_c \xint_c_iii - #5\XINT_length_finish_c \xint_c_iv - #6\XINT_length_finish_c \xint_c_v - #7\XINT_length_finish_c \xint_c_vi - \W\XINT_length_finish_c \xint_c_vii\Z -}% -\edef\XINT_length_finish_c #1#2\Z #3% - {\noexpand\expandafter\space\noexpand\the\numexpr #3+#1\relax}% \def\xintZapFirstSpaces {\romannumeral0\xintzapfirstspaces }% \long\edef\xintzapfirstspaces #1% - {\noexpand\XINT_zapbsp_a \space #1\space\space\noexpand\xint_bye\xint_relax }% -\xint_firstofone {\long\def\XINT_zapbsp_a #1 } %<- space token here + {\noexpand\XINT_zapbsp_a \space #1\xint_relax \space\space\xint_relax }% +\xint_firstofone {\long\edef\XINT_zapbsp_a #1 } %<- space token here {% - \XINT_zapbsp_again? #1\xint_bye\XINT_zapbsp_b {#1}% + \noexpand\XINT_zapbsp_again? #1\noexpand\xint_bye\noexpand\XINT_zapbsp_b #1\space\space }% \long\def\XINT_zapbsp_again? #1{\xint_bye #1\XINT_zapbsp_again }% -\edef\XINT_zapbsp_again\XINT_zapbsp_b #1{\noexpand\XINT_zapbsp_a\space }% -\long\def\XINT_zapbsp_b #1#2\xint_relax - {\XINT_zapbsp_end? #2\XINT_zapbsp_e\empty #2{#1}}% -\long\def\XINT_zapbsp_end? #1{\xint_bye #1\XINT_zapbsp_end }% -\long\def\XINT_zapbsp_end\XINT_zapbsp_e\empty #1\xint_bye #2{#2#1}% -\xint_firstofone{\long\def\XINT_zapbsp_e #1 } \xint_bye - {\expandafter\XINT_zapbsp_f \expandafter{#1}}% -\long\edef\XINT_zapbsp_f #1#2{#2\space\space #1}% +\xint_firstofone{\def\XINT_zapbsp_again\XINT_zapbsp_b} {\XINT_zapbsp_a }% +\long\def\XINT_zapbsp_b #1\xint_relax #2\xint_relax {#1}% \def\xintZapLastSpaces {\romannumeral0\xintzaplastspaces }% -\long\edef\xintzaplastspaces #1{\noexpand\XINT_zapesp_a {\space}\noexpand\empty - #1\space\space\noexpand\xint_bye \xint_relax}% +\long\edef\xintzaplastspaces #1{\noexpand\XINT_zapesp_a {}\noexpand\empty#1% + \space\space\noexpand\xint_bye\xint_relax}% \xint_firstofone {\long\def\XINT_zapesp_a #1#2 } %<- second space here {\expandafter\XINT_zapesp_b\expandafter{#2}{#1}}% \long\def\XINT_zapesp_b #1#2#3\xint_relax {\XINT_zapesp_end? #3\XINT_zapesp_e {#2#1}\empty #3\xint_relax }% \long\def\XINT_zapesp_end? #1{\xint_bye #1\XINT_zapesp_end }% -\long\def\XINT_zapesp_end\XINT_zapesp_e #1#2\xint_relax {#1}% +\long\def\XINT_zapesp_end\XINT_zapesp_e #1#2\xint_relax { #1}% \long\edef\XINT_zapesp_e #1{\noexpand \XINT_zapesp_a {#1\space\space}}% \def\xintZapSpaces {\romannumeral0\xintzapspaces }% -\long\edef\xintzapspaces #1% - {\noexpand\XINT_zapsp_a \space #1\space\space\noexpand\xint_bye\xint_relax}% -\xint_firstofone {\long\def\XINT_zapsp_a #1 } %<- space token here -{% - \XINT_zapsp_again? #1\xint_bye\XINT_zapesp_b {#1}{}% -}% +\long\edef\xintzapspaces #1% like \xintZapFirstSpaces. + {\noexpand\XINT_zapsp_a \space #1\xint_relax \space\space\xint_relax }% +\xint_firstofone {\long\edef\XINT_zapsp_a #1 } % + {\noexpand\XINT_zapsp_again? #1\noexpand\xint_bye\noexpand\XINT_zapsp_b #1\space\space}% \long\def\XINT_zapsp_again? #1{\xint_bye #1\XINT_zapsp_again }% -\long\edef\XINT_zapsp_again\XINT_zapesp_b #1#2{\noexpand\XINT_zapsp_a\space }% +\xint_firstofone{\def\XINT_zapsp_again\XINT_zapsp_b} {\XINT_zapsp_a }% +\xint_firstofone{\def\XINT_zapsp_b} {\XINT_zapsp_c }% +\long\edef\XINT_zapsp_c #1\xint_relax #2\xint_relax {\noexpand\XINT_zapesp_a + {}\noexpand \empty #1\space\space\noexpand\xint_bye\xint_relax }% \def\xintZapSpacesB {\romannumeral0\xintzapspacesb }% \long\def\xintzapspacesb #1{\XINT_zapspb_one? #1\xint_relax\xint_relax \xint_bye\xintzapspaces {#1}}% |