diff options
author | Karl Berry <karl@freefriends.org> | 2014-01-09 23:59:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-01-09 23:59:41 +0000 |
commit | af91cefd8b0ad8fe98e9ef318d337636b3f54a19 (patch) | |
tree | 6b68c531657de5b211fa117d8b08836300bc5583 /Master/texmf-dist/tex/generic/xint/xint.sty | |
parent | 3e2f1017cfd105d03e88036cae3a040a59d1c3b5 (diff) |
xint (9jan14)
git-svn-id: svn://tug.org/texlive/trunk@32618 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint/xint.sty')
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xint.sty | 1023 |
1 files changed, 490 insertions, 533 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty index d51548b4f59..5064a290659 100644 --- a/Master/texmf-dist/tex/generic/xint/xint.sty +++ b/Master/texmf-dist/tex/generic/xint/xint.sty @@ -21,9 +21,9 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %%---------------------------------------------------------------- -%% The xint bundle (version 1.09i of December 18, 2013) +%% The xint bundle (version 1.09j of January 9, 2014) %% xint: Expandable operations on long numbers -%% Copyright (C) 2013 by Jean-Francois Burnol +%% Copyright (C) 2013-2014 by Jean-Francois Burnol %%---------------------------------------------------------------- \begingroup\catcode61\catcode48\catcode32=10\relax% \catcode13=5 % ^^M @@ -53,8 +53,7 @@ \else \ifx\x\relax % plain-TeX, first loading of xint.sty \ifx\w\relax % but xinttools.sty not yet loaded. - \y{xint}{Package xinttools is required}% - \y{xint}{Will try \string\input\space xinttools.sty}% + \y{xint}{now issuing \string\input\space xinttools.sty}% \def\z{\endgroup\input xinttools.sty\relax}% \fi \else @@ -62,8 +61,7 @@ \ifx\x\empty % LaTeX, first loading, % variable is initialized, but \ProvidesPackage not yet seen \ifx\w\relax % xinttools.sty not yet loaded. - \y{xint}{Package xinttools is required}% - \y{xint}{Will try \string\RequirePackage{xinttools}}% + \y{xint}{now issuing \string\RequirePackage{xinttools}}% \def\z{\endgroup\RequirePackage{xinttools}}% \fi \else @@ -103,13 +101,13 @@ \XINTsetupcatcodes% \XINT_providespackage \ProvidesPackage{xint}% - [2013/12/18 v1.09i Expandable operations on long numbers (jfB)]% + [2014/01/09 v1.09j Expandable operations on long numbers (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_afterstop #1#2#3{ #1}% 1.09i -\long\def\xint_secondofthree_afterstop #1#2#3{ #2}% -\long\def\xint_thirdofthree_afterstop #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_zero #10{}% \def\xint_gob_til_zeros_iii #1000{}% \def\xint_gob_til_zeros_iv #10000{}% @@ -118,7 +116,7 @@ \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_afterstop #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}% @@ -131,8 +129,12 @@ \chardef\xint_c_iii 3 \chardef\xint_c_iv 4 \chardef\xint_c_v 5 -\chardef\xint_c_ix 9 -\chardef\xint_c_x 10 +\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% @@ -146,7 +148,7 @@ \def\XINT_rev_fork #1% {% \xint_UDsignfork - #1{\expandafter\xint_minus_afterstop\romannumeral0\XINT_rord_main {}}% + #1{\expandafter\xint_minus_thenstop\romannumeral0\XINT_rord_main {}}% -{\XINT_rord_main {}#1}% \krof }% @@ -260,7 +262,7 @@ {% \noexpand\expandafter\space\noexpand\the\numexpr #1#2#3#4\relax }% -\def\xint_cleanupzeros_nospace #1#2#3#4% +\def\xint_cleanupzeros_nostop #1#2#3#4% {% \the\numexpr #1#2#3#4\relax }% @@ -381,7 +383,7 @@ 0-{1}% \krof }% -\def\XINT__Sgn #1#2\Z +\def\XINT_cntSgn #1#2\Z {% \xint_UDzerominusfork #1-\z@ @@ -395,12 +397,12 @@ \def\xintSgnFork {\romannumeral0\xintsgnfork }% \def\xintsgnfork #1% {% - \ifcase #1 \expandafter\xint_secondofthree_afterstop - \or\expandafter\xint_thirdofthree_afterstop - \else\expandafter\xint_firstofthree_afterstop + \ifcase #1 \expandafter\xint_secondofthree_thenstop + \or\expandafter\xint_thirdofthree_thenstop + \else\expandafter\xint_firstofthree_thenstop \fi }% -\def\XINT__SgnFork #1% +\def\XINT_cntSgnFork #1% {% \ifcase #1\expandafter\xint_secondofthree \or\expandafter\xint_thirdofthree @@ -411,36 +413,36 @@ \def\xintifsgn #1% {% \ifcase \romannumeral0\xintsgn{#1} - \expandafter\xint_secondofthree_afterstop - \or\expandafter\xint_thirdofthree_afterstop - \else\expandafter\xint_firstofthree_afterstop + \expandafter\xint_secondofthree_thenstop + \or\expandafter\xint_thirdofthree_thenstop + \else\expandafter\xint_firstofthree_thenstop \fi }% \def\xintifZero {\romannumeral0\xintifzero }% \def\xintifzero #1% {% \if0\xintSgn{#1}% - \expandafter\xint_firstoftwo_afterstop + \expandafter\xint_firstoftwo_thenstop \else - \expandafter\xint_secondoftwo_afterstop + \expandafter\xint_secondoftwo_thenstop \fi }% \def\xintifNotZero {\romannumeral0\xintifnotzero }% \def\xintifnotzero #1% {% \if0\xintSgn{#1}% - \expandafter\xint_secondoftwo_afterstop + \expandafter\xint_secondoftwo_thenstop \else - \expandafter\xint_firstoftwo_afterstop + \expandafter\xint_firstoftwo_thenstop \fi }% \def\xintifOne {\romannumeral0\xintifone }% \def\xintifone #1% {% \if1\xintIsOne{#1}% - \expandafter\xint_firstoftwo_afterstop + \expandafter\xint_firstoftwo_thenstop \else - \expandafter\xint_secondoftwo_afterstop + \expandafter\xint_secondoftwo_thenstop \fi }% \let\xintifTrueAelseB\xintifNotZero @@ -451,42 +453,42 @@ \def\xintifcmp #1#2% {% \ifcase\xintCmp {#1}{#2} - \expandafter\xint_secondofthree_afterstop - \or\expandafter\xint_thirdofthree_afterstop - \else\expandafter\xint_firstofthree_afterstop + \expandafter\xint_secondofthree_thenstop + \or\expandafter\xint_thirdofthree_thenstop + \else\expandafter\xint_firstofthree_thenstop \fi }% \def\xintifEq {\romannumeral0\xintifeq }% \def\xintifeq #1#2% {% \if0\xintCmp{#1}{#2}% - \expandafter\xint_firstoftwo_afterstop - \else\expandafter\xint_secondoftwo_afterstop + \expandafter\xint_firstoftwo_thenstop + \else\expandafter\xint_secondoftwo_thenstop \fi }% \def\xintifGt {\romannumeral0\xintifgt }% \def\xintifgt #1#2% {% \if1\xintCmp{#1}{#2}% - \expandafter\xint_firstoftwo_afterstop - \else\expandafter\xint_secondoftwo_afterstop + \expandafter\xint_firstoftwo_thenstop + \else\expandafter\xint_secondoftwo_thenstop \fi }% \def\xintifLt {\romannumeral0\xintiflt }% \def\xintiflt #1#2% {% \ifnum\xintCmp{#1}{#2}<\xint_c_ - \expandafter\xint_firstoftwo_afterstop - \else \expandafter\xint_secondoftwo_afterstop + \expandafter\xint_firstoftwo_thenstop + \else \expandafter\xint_secondoftwo_thenstop \fi }% \def\xintifOdd {\romannumeral0\xintifodd }% \def\xintifodd #1% {% \if\xintOdd{#1}1% - \expandafter\xint_firstoftwo_afterstop + \expandafter\xint_firstoftwo_thenstop \else - \expandafter\xint_secondoftwo_afterstop + \expandafter\xint_secondoftwo_thenstop \fi }% \def\xintiiOpp {\romannumeral0\xintiiopp }% @@ -890,7 +892,7 @@ \def\XINT_add_firstiszero #1#2#3#4{ #3#1}% \def\XINT_add_minusminus #1#2#3#4% {% - \expandafter\xint_minus_afterstop% + \expandafter\xint_minus_thenstop% \romannumeral0\XINT_add_pre {#2}{#1}% }% \def\XINT_add_minusplus #1#2#3#4% @@ -969,7 +971,7 @@ \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_afterstop% + \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}% @@ -1100,7 +1102,7 @@ \krof {#3}% }% -\def\XINT_sub_DD {\expandafter\xint_minus_afterstop\romannumeral0\XINT_sub_D }% +\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 @@ -1116,7 +1118,7 @@ }% \def\xint_sub_Fdec_finish\W\XINT_sub_Fdec_onestep #1#2% {% - \expandafter\xint_minus_afterstop\romannumeral0\XINT_cuz + \expandafter\xint_minus_thenstop\romannumeral0\XINT_cuz }% \def\XINT_sub_Finc #1#2#3#4#5#6% {% @@ -1134,7 +1136,8 @@ \def\xint_sub_Finc_finish\W\XINT_sub_Finc_onestep #1#2#3% {% \xint_UDzerofork - #1{\expandafter\xint_minus_afterstop\xint_cleanupzeros_nospace}% + #1{\expandafter\expandafter\expandafter + \xint_minus_thenstop\xint_cleanupzeros_nostop}% 0{ -1}% \krof #3% @@ -1173,7 +1176,7 @@ }% \def\xint_sub_KK_finish\W\XINT_sub_KK_onestep #1#2#3% {% - \expandafter\xint_minus_afterstop + \expandafter\xint_minus_thenstop \romannumeral0\XINT_cuz_loop #3\W\W\W\W\W\W\W\Z }% \def\xintCmp {\romannumeral0\xintcmp }% @@ -1296,16 +1299,6 @@ \let\xintIsTrue\xintIsNotZero \let\xintNot\xintIsZero \let\xintIsFalse\xintIsZero -\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\xintAND {\romannumeral0\xintand }% \def\xintand #1#2{\if0\xintSgn{#1}\expandafter\xint_firstoftwo \else\expandafter\xint_secondoftwo\fi @@ -1326,13 +1319,6 @@ {\xintifTrueAelseB {#1}{\XINT_andof_a}{\XINT_andof_no}}% \def\XINT_andof_no #1\relax { 0}% \def\XINT_andof_e #1\Z { 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}% \def\xintORof {\romannumeral0\xintorof }% \def\xintorof #1{\expandafter\XINT_orof_a\romannumeral-`0#1\relax }% \def\XINT_orof_a #1{\expandafter\XINT_orof_b\romannumeral-`0#1\Z }% @@ -1342,13 +1328,6 @@ {\xintifTrueAelseB {#1}{\XINT_orof_yes}{\XINT_orof_a}}% \def\XINT_orof_yes #1\relax { 1}% \def\XINT_orof_e #1\Z { 0}% -\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}% \def\xintXORof {\romannumeral0\xintxorof }% \def\xintxorof #1{\expandafter\XINT_xorof_a\expandafter 0\romannumeral-`0#1\relax }% @@ -1361,17 +1340,6 @@ {\XINT_xorof_a #2}% }% \def\XINT_xorof_e #1\Z #2{ #2}% -\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\xintGeq {\romannumeral0\xintgeq }% \def\xintgeq #1% {% @@ -1473,25 +1441,25 @@ \krof {#2}{#4}#1#3% }% -\def\XINT_max_zerozero #1#2#3#4{\xint_firstoftwo_afterstop }% -\def\XINT_max_zeroplus #1#2#3#4{\xint_firstoftwo_afterstop }% -\def\XINT_max_pluszero #1#2#3#4{\xint_secondoftwo_afterstop }% -\def\XINT_max_minusplus #1#2#3#4{\xint_firstoftwo_afterstop }% -\def\XINT_max_plusminus #1#2#3#4{\xint_secondoftwo_afterstop }% +\def\XINT_max_zerozero #1#2#3#4{\xint_firstoftwo_thenstop }% +\def\XINT_max_zeroplus #1#2#3#4{\xint_firstoftwo_thenstop }% +\def\XINT_max_pluszero #1#2#3#4{\xint_secondoftwo_thenstop }% +\def\XINT_max_minusplus #1#2#3#4{\xint_firstoftwo_thenstop }% +\def\XINT_max_plusminus #1#2#3#4{\xint_secondoftwo_thenstop }% \def\XINT_max_plusplus #1#2#3#4% {% \ifodd\XINT_Geq {#4#2}{#3#1} - \expandafter\xint_firstoftwo_afterstop + \expandafter\xint_firstoftwo_thenstop \else - \expandafter\xint_secondoftwo_afterstop + \expandafter\xint_secondoftwo_thenstop \fi }% \def\XINT_max_minusminus #1#2#3#4% {% \ifodd\XINT_Geq {#1}{#2} - \expandafter\xint_firstoftwo_afterstop + \expandafter\xint_firstoftwo_thenstop \else - \expandafter\xint_secondoftwo_afterstop + \expandafter\xint_secondoftwo_thenstop \fi }% \def\xintiMaxof {\romannumeral0\xintimaxof }% @@ -1505,12 +1473,6 @@ {\expandafter\XINT_imaxof_b\romannumeral0\xintimax {#1}}% \def\XINT_imaxof_e #1\Z #2\Z { #2}% \let\xintMaxof\xintiMaxof \let\xintmaxof\xintimaxof -\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}% \def\xintiMin {\romannumeral0\xintimin }% \def\xintimin #1% {% @@ -1538,25 +1500,25 @@ \krof {#2}{#4}#1#3% }% -\def\XINT_min_zerozero #1#2#3#4{\xint_firstoftwo_afterstop }% -\def\XINT_min_zeroplus #1#2#3#4{\xint_secondoftwo_afterstop }% -\def\XINT_min_pluszero #1#2#3#4{\xint_firstoftwo_afterstop }% -\def\XINT_min_minusplus #1#2#3#4{\xint_secondoftwo_afterstop }% -\def\XINT_min_plusminus #1#2#3#4{\xint_firstoftwo_afterstop }% +\def\XINT_min_zerozero #1#2#3#4{\xint_firstoftwo_thenstop }% +\def\XINT_min_zeroplus #1#2#3#4{\xint_secondoftwo_thenstop }% +\def\XINT_min_pluszero #1#2#3#4{\xint_firstoftwo_thenstop }% +\def\XINT_min_minusplus #1#2#3#4{\xint_secondoftwo_thenstop }% +\def\XINT_min_plusminus #1#2#3#4{\xint_firstoftwo_thenstop }% \def\XINT_min_plusplus #1#2#3#4% {% \ifodd\XINT_Geq {#4#2}{#3#1} - \expandafter\xint_secondoftwo_afterstop + \expandafter\xint_secondoftwo_thenstop \else - \expandafter\xint_firstoftwo_afterstop + \expandafter\xint_firstoftwo_thenstop \fi }% \def\XINT_min_minusminus #1#2#3#4% {% \ifodd\XINT_Geq {#1}{#2} - \expandafter\xint_secondoftwo_afterstop + \expandafter\xint_secondoftwo_thenstop \else - \expandafter\xint_firstoftwo_afterstop + \expandafter\xint_firstoftwo_thenstop \fi }% \def\xintiMinof {\romannumeral0\xintiminof }% @@ -1570,11 +1532,6 @@ {\expandafter\XINT_iminof_b\romannumeral0\xintimin {#1}}% \def\XINT_iminof_e #1\Z #2\Z { #2}% \let\xintMinof\xintiMinof \let\xintminof\xintiminof -\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}}% \def\xintiiSum {\romannumeral0\xintiisum }% \def\xintiisum #1{\xintiisumexpr #1\relax }% \def\xintiiSumExpr {\romannumeral0\xintiisumexpr }% @@ -1617,13 +1574,6 @@ \W\X\Y\Z #3\W\X\Y\Z }{#2}% }% \def\XINT_sum_NN #1#2{\XINT_sum_loop {#2}{#1}}% -\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}}}% \def\xintiiMul {\romannumeral0\xintiimul }% \def\xintiimul #1% {% @@ -1667,14 +1617,14 @@ }% \def\XINT_mul_minusplus #1#2#3% {% - \expandafter\xint_minus_afterstop\romannumeral0\expandafter + \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_afterstop\romannumeral0\expandafter + \expandafter\xint_minus_thenstop\romannumeral0\expandafter \XINT_mul_choice_a \expandafter{\romannumeral0\xintlength {#3}}% {\romannumeral0\xintlength {#1#2}}{#1#2}{#3}% @@ -2029,26 +1979,12 @@ \let\xintprdexpr\xintiiprdexpr \def\XINT_prdexpr {\XINT_prod_loop_a 1\Z }% \def\XINT_prod_loop_a #1\Z #2% -{% - \expandafter\XINT_prod_loop_b \romannumeral-`0#2\Z #1\Z \Z -}% + {\expandafter\XINT_prod_loop_b \romannumeral-`0#2\Z #1\Z \Z}% \def\XINT_prod_loop_b #1% -{% - \xint_gob_til_relax #1\XINT_prod_finished\relax - \XINT_prod_loop_c #1% -}% + {\xint_gob_til_relax #1\XINT_prod_finished\relax\XINT_prod_loop_c #1}% \def\XINT_prod_loop_c -{% - \expandafter\XINT_prod_loop_a\romannumeral0\XINT_mul_fork -}% + {\expandafter\XINT_prod_loop_a\romannumeral0\XINT_mul_fork }% \def\XINT_prod_finished #1\Z #2\Z \Z { #2}% -\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}}}% \def\xintiFac {\romannumeral0\xintifac }% \def\xintifac #1% {% @@ -2057,7 +1993,7 @@ \let\xintFac\xintiFac \let\xintfac\xintifac \def\XINT_fac_fork #1% {% - \ifcase\XINT__Sgn #1\Z + \ifcase\XINT_cntSgn #1\Z \xint_afterfi{\expandafter\space\expandafter 1\xint_gobble_i }% \or \expandafter\XINT_fac_checklength @@ -2069,11 +2005,11 @@ }% \def\XINT_fac_checklength #1% {% - \ifnum #1>999999 + \ifnum #1>100000 \xint_afterfi{\expandafter\xintError:FactorialOfTooBigNumber \expandafter\space\expandafter 1\xint_gobble_i }% \else - \xint_afterfi{\ifnum #1>9999 + \xint_afterfi{\ifnum #1>\xint_c_ixixixix \expandafter\XINT_fac_big_loop \else \expandafter\XINT_fac_loop @@ -2184,7 +2120,7 @@ \def\XINT_pow_AisOne #1#2{ 1}% \def\XINT_pow_AisZero #1#2% {% - \ifcase\XINT__Sgn #1\Z + \ifcase\XINT_cntSgn #1\Z \xint_afterfi { 1}% \or \xint_afterfi { 0}% @@ -2194,7 +2130,7 @@ }% \def\XINT_pow_AatleastTwo #1% {% - \ifcase\XINT__Sgn #1\Z + \ifcase\XINT_cntSgn #1\Z \expandafter\XINT_pow_BisZero \or \expandafter\XINT_pow_checkBsize @@ -2203,94 +2139,91 @@ \fi {#1}% }% -\edef\XINT_pow_BisNegative #1#2{\noexpand\xintError:FractionRoundedToZero\space 0}% +\edef\XINT_pow_BisNegative #1#2% + {\noexpand\xintError:FractionRoundedToZero\space 0}% \def\XINT_pow_BisZero #1#2{ 1}% -\def\XINT_pow_checkBsize #1#2% +\def\XINT_pow_checkBsize #1% {% - \ifnum #1>999999999 + \ifnum #1>100000 \expandafter\XINT_pow_BtooBig \else - \expandafter\XINT_pow_loop + \expandafter\XINT_pow_loopI \fi - {#1}{#2}\XINT_pow_posprod - \xint_relax - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_bye\xint_bye\xint_bye\xint_bye - \xint_relax -}% -\edef\XINT_pow_BtooBig #1\xint_relax #2\xint_relax - {\noexpand\xintError:ExponentTooBig\space 0}% -\def\XINT_pow_loop #1#2% -{% - \ifnum #1 = 1 - \expandafter\XINT_pow_loop_end - \else - \xint_afterfi{\expandafter\XINT_pow_loop_a - \expandafter{\the\numexpr 2*(#1/2)-#1\expandafter }% b mod 2 - \expandafter{\the\numexpr #1-#1/2\expandafter }% [b/2] - \expandafter{\romannumeral0\xintiisqr{#2}}}% - \fi - {{#2}}% + {#1}% }% -\def\XINT_pow_loop_end {\romannumeral0\XINT_rord_main {}\relax }% -\def\XINT_pow_loop_a #1% +\edef\XINT_pow_BtooBig #1#2{\noexpand\xintError:ExponentTooBig\space 0}% +\def\XINT_pow_loopI #1% {% - \ifnum #1 = 1 - \expandafter\XINT_pow_loop + \ifnum #1=\xint_c_i\XINT_pow_Iend\fi + \ifodd #1 + \expandafter\XINT_pow_loopI_odd \else - \expandafter\XINT_pow_loop_throwaway + \expandafter\XINT_pow_loopI_even \fi + {#1}% }% -\def\XINT_pow_loop_throwaway #1#2#3% +\edef\XINT_pow_Iend\fi #1\fi #2#3{\noexpand\fi\space #3}% +\def\XINT_pow_loopI_even #1#2% {% - \XINT_pow_loop {#1}{#2}% + \expandafter\XINT_pow_loopI\expandafter + {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter + {\romannumeral0\xintiisqr {#2}}% }% -\def\XINT_pow_posprod #1% +\def\XINT_pow_loopI_odd #1#2% {% - \XINT_pow_pprod_checkifempty #1\Z + \expandafter\XINT_pow_loopI_odda\expandafter + {\romannumeral0\XINT_RQ {}#2\R\R\R\R\R\R\R\R\Z }{#1}{#2}% }% -\def\XINT_pow_pprod_checkifempty #1% +\def\XINT_pow_loopI_odda #1#2#3% {% - \xint_gob_til_relax #1\XINT_pow_pprod_emptyproduct\relax - \XINT_pow_pprod_RQfirst #1% + \expandafter\XINT_pow_loopII\expandafter + {\the\numexpr #2/\xint_c_ii-\xint_c_i\expandafter}\expandafter + {\romannumeral0\xintiisqr {#3}}{#1}% }% -\def\XINT_pow_pprod_emptyproduct #1\Z { 1}% -\def\XINT_pow_pprod_RQfirst #1\Z +\def\XINT_pow_loopII #1% {% - \expandafter\XINT_pow_pprod_getnext\expandafter - {\romannumeral0\XINT_RQ {}#1\R\R\R\R\R\R\R\R\Z}% + \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_pprod_getnext #1#2% +\def\XINT_pow_loopII_even #1#2% {% - \XINT_pow_pprod_checkiffinished #2\Z {#1}% + \expandafter\XINT_pow_loopII\expandafter + {\the\numexpr #1/\xint_c_ii\expandafter}\expandafter + {\romannumeral0\xintiisqr {#2}}% }% -\def\XINT_pow_pprod_checkiffinished #1% +\def\XINT_pow_loopII_odd #1#2#3% {% - \xint_gob_til_relax #1\XINT_pow_pprod_end\relax - \XINT_pow_pprod_compute #1% + \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_pprod_compute #1\Z #2% +\def\XINT_pow_loopII_odda #1#2#3% {% - \expandafter\XINT_pow_pprod_getnext\expandafter - {\romannumeral0\XINT_mulr_enter #2\Z\Z\Z\Z #1\W\W\W\W }% + \expandafter\XINT_pow_loopII\expandafter + {\the\numexpr #2/\xint_c_ii-\xint_c_i\expandafter}\expandafter + {\romannumeral0\xintiisqr {#3}}{#1}% }% -\def\XINT_pow_pprod_end\relax\XINT_pow_pprod_compute #1\Z #2% +\def\XINT_pow_IIend\fi #1\fi #2#3#4% {% - \expandafter\xint_cleanupzeros_andstop - \romannumeral0\xintreverseorder {#2}% + \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_afterstop - \romannumeral0\xintiidivision }% -\def\xintiirem {\expandafter\xint_secondoftwo_afterstop - \romannumeral0\xintiidivision }% +\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_afterstop - \romannumeral0\xintdivision }% -\def\xintrem {\expandafter\xint_secondoftwo_afterstop - \romannumeral0\xintdivision }% +\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}% @@ -2308,7 +2241,6 @@ {% \expandafter\XINT_div_fork \romannumeral0\xintnum{#2}\Z #1\Z }% -\def\XINT_Division #1#2{\romannumeral0\XINT_div_fork #2\Z #1\Z }% \def\XINT_div_fork #1#2\Z #3#4\Z {% \xint_UDzerofork @@ -2324,48 +2256,45 @@ }% \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_plusplus #1#2#3#4{\XINT_div_prepare {#3#1}{#4#2}}% \def\XINT_div_BisNegative #1#2#3#4% {% - \expandafter\XINT_div_BisNegative_post + \expandafter\XINT_div_BisNegative_b \romannumeral0\XINT_div_fork #1\Z #4#2\Z }% -\edef\XINT_div_BisNegative_post #1% +\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_post + \expandafter\XINT_div_AisNegative_b \romannumeral0\XINT_div_prepare {#3#1}{#2}{#3#1}% }% -\def\XINT_div_AisNegative_post #1#2% +\def\XINT_div_AisNegative_b #1#2% {% \if0\XINT_Sgn #2\Z - \expandafter \XINT_div_AisNegative_zerorem + \expandafter \XINT_div_AisNegative_Rzero \else - \expandafter \XINT_div_AisNegative_posrem + \expandafter \XINT_div_AisNegative_Rpositive \fi {#1}{#2}% }% -\edef\XINT_div_AisNegative_zerorem #1#2#3% +\edef\XINT_div_AisNegative_Rzero #1#2#3% {% \noexpand\expandafter\space\noexpand\expandafter {\noexpand\romannumeral0\noexpand\XINT_opp #1}{0}% }% -\def\XINT_div_AisNegative_posrem #1% +\def\XINT_div_AisNegative_Rpositive #1% {% - \expandafter \XINT_div_AisNegative_posrem_b \expandafter + \expandafter \XINT_div_AisNegative_Rpositive_b \expandafter {\romannumeral0\xintiiopp{\xintInc {#1}}}% }% -\def\XINT_div_AisNegative_posrem_b #1#2#3% +\def\XINT_div_AisNegative_Rpositive_b #1#2#3% {% - \expandafter \xint_exchangetwo_keepbraces_afterstop \expandafter - {\romannumeral0\XINT_sub {#3}{#2}}{#1}% + \expandafter \xint_exchangetwo_keepbraces_thenstop \expandafter + {\romannumeral0\XINT_sub {#3}{#2}}{#1}% }% \def\XINT_div_prepare #1% {% @@ -2374,341 +2303,352 @@ }% \def\XINT_div_prepareB_aa #1% {% - \ifnum #1=1 - \expandafter\XINT_div_prepareB_ab + \ifnum #1=\xint_c_i + \expandafter\XINT_div_prepareB_onedigit \else \expandafter\XINT_div_prepareB_a \fi {#1}% }% -\def\XINT_div_prepareB_ab #1#2% -{% - \ifnum #2=1 - \expandafter\XINT_div_prepareB_BisOne - \else - \expandafter\XINT_div_prepareB_e - \fi {000}{3}{4}{#2}% -}% -\def\XINT_div_prepareB_BisOne #1#2#3#4#5{ {#5}{0}}% \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% {% - \ifcase \numexpr #1-#2\relax - \expandafter\XINT_div_prepareB_d - \or - \expandafter\XINT_div_prepareB_di - \or - \expandafter\XINT_div_prepareB_dii - \or - \expandafter\XINT_div_prepareB_diii - \fi {#1}% + \csname XINT_div_prepareB_d\romannumeral\numexpr#1-#2\endcsname + {#1}% }% -\def\XINT_div_prepareB_d {\XINT_div_prepareB_e {}{0}}% -\def\XINT_div_prepareB_di {\XINT_div_prepareB_e {0}{1}}% -\def\XINT_div_prepareB_dii {\XINT_div_prepareB_e {00}{2}}% -\def\XINT_div_prepareB_diii {\XINT_div_prepareB_e {000}{3}}% +\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% {% - \XINT_div_prepareB_f #4#1\Z {#3}{#2}{#1}% + \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\Z -{% - \expandafter \XINT_div_prepareB_g \expandafter - {\romannumeral0\xintreverseorder {#1#2#3#4#5}}{#1#2#3#4}% +\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% +\def\XINT_div_prepareB_g #1.#2.#3.#4#5#6#7#8% {% - \XINT_div_prepareA_a {#6#5}{#2}{#3}{#1}{#4}% + \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}% A >0 ici + \expandafter\XINT_div_prepareA_b\expandafter + {\romannumeral0\xintlength {#1}}{#1}% }% \def\XINT_div_prepareA_b #1% {% - \expandafter\XINT_div_prepareA_c\expandafter{\the\numexpr 4*((#1+1)/4)}{#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% {% - \ifcase \numexpr #1-#2\relax - \expandafter\XINT_div_prepareA_d - \or - \expandafter\XINT_div_prepareA_di - \or - \expandafter\XINT_div_prepareA_dii - \or - \expandafter\XINT_div_prepareA_diii - \fi {#1}% + \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% +\def\XINT_div_prepareA_e #1#2#3#4#5% {% - \XINT_div_startswitch {#1#3}{#2}% + \XINT_div_start_a {#2}{#4}{#1#3}#5% }% -\def\XINT_div_startswitch #1#2#3#4% +\def\XINT_div_start_a #1#2% {% - \ifnum #2 > #4 - \expandafter\XINT_div_body_a + \ifnum #2=\xint_c_iv \expandafter\XINT_div_little_b \else - \ifnum #2 = #4 - \expandafter\expandafter\expandafter\XINT_div_final_a - \else - \expandafter\expandafter\expandafter\XINT_div_finished_a - \fi\fi {#1}{#4}{#3}{0000}{#2}% + \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_finished_a #1#2#3% +\def\XINT_div_III_aa #1#2#3#4#5#6#7% {% - \expandafter\XINT_div_finished_b\expandafter {\romannumeral0\XINT_cuz {#1}}% + \expandafter\expandafter\expandafter + \XINT_div_III_b\xint_cleanupzeros_nostop #3.{0000}% }% -\def\XINT_div_finished_b #1#2#3#4#5% +\def\XINT_div_III_b #1% {% - \if0\XINT_Sgn #1\Z - \xint_afterfi {\XINT_div_finished_c {0}}% + \if0#1% + \expandafter\XINT_div_III_bRzero \else - \xint_afterfi {\expandafter\XINT_div_finished_c\expandafter - {\romannumeral0\XINT_dsh_checksignx #5\Z {#1}}% - }% + \expandafter\XINT_div_III_bRpos \fi - {#2}% + #1% }% -\edef\XINT_div_finished_c #1#2% +\def\XINT_div_III_bRzero 0.#1#2% {% - \noexpand\expandafter\space\noexpand\expandafter - {\noexpand\romannumeral0\noexpand\XINT_rev_andcuz {#2}}{#1}% + \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_final_a #1% +\def\XINT_div_I_a #1#2% {% - \XINT_div_final_b #1\Z + \expandafter\XINT_div_I_b\the\numexpr #1/#2.{#1}{#2}% }% -\def\XINT_div_final_b #1#2#3#4#5\Z +\def\XINT_div_I_b #1% {% - \xint_gob_til_zeros_iv #1#2#3#4\xint_div_final_c0000% - \XINT_div_final_c {#1#2#3#4}{#1#2#3#4#5}% + \xint_gob_til_zero #1\XINT_div_I_czero 0\XINT_div_I_c #1% }% -\def\xint_div_final_c0000\XINT_div_final_c #1{\XINT_div_finished_a }% -\def\XINT_div_final_c #1#2#3#4% +\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_final_da \expandafter - {\the\numexpr #1-(#1/#4)*#4\expandafter }\expandafter - {\the\numexpr #1/#4\expandafter }\expandafter - {\romannumeral0\xint_cleanupzeros_andstop #2}% + \expandafter\XINT_div_I_da\the\numexpr #2-#1*#3.#1.% }% -\def\XINT_div_final_da #1% +\def\XINT_div_I_da #1.% {% \ifnum #1>\xint_c_ix - \expandafter\XINT_div_final_dP + \expandafter\XINT_div_I_dP \else - \xint_afterfi - {\ifnum #1<\xint_c_ - \expandafter\XINT_div_final_dN - \else - \expandafter\XINT_div_final_db - \fi }% + \ifnum #1<\xint_c_ + \expandafter\expandafter\expandafter\XINT_div_I_dN + \else + \expandafter\expandafter\expandafter\XINT_div_I_db + \fi \fi }% -\def\XINT_div_final_dN #1% +\def\XINT_div_I_dN #1.% {% - \expandafter\XINT_div_final_dP\the\numexpr #1-\xint_c_i\relax + \expandafter\XINT_div_I_dP\the\numexpr #1-\xint_c_i.% }% -\def\XINT_div_final_dP #1#2#3#4#5% q,A,Q,L,B (puis c) +\def\XINT_div_I_db #1.#2#3% #1=q=un chiffre, #2=alpha, #3=B {% - \expandafter \XINT_div_final_f \expandafter - {\romannumeral0\xintiisub {#2}% - {\romannumeral0\XINT_mul_M {#1}#5\Z\Z\Z\Z }}% - {\romannumeral0\XINT_add_A 0{}#1000\W\X\Y\Z #3\W\X\Y\Z }% + \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_final_db #1#2#3#4#5% q,A,Q,L,B (puis c) +\def\XINT_div_I_dc #1#2% {% - \expandafter\XINT_div_final_dc\expandafter - {\romannumeral0\xintiisub {#2}% - {\romannumeral0\XINT_mul_M {#1}#5\Z\Z\Z\Z }}% - {#1}{#2}{#3}{#4}{#5}% + \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_final_dc #1#2% 1.09i re-styles the conditional here +\def\XINT_div_I_e #1#2#3#4#5% {% - \ifnum\XINT__Sgn #1\Z<\xint_c_ - \expandafter\xint_firstoftwo - \else\expandafter\xint_secondoftwo - \fi - {\expandafter\XINT_div_final_dP\the\numexpr #2-\xint_c_i\relax}% - {\XINT_div_final_e {#1}#2}% + \expandafter\XINT_div_I_f \the\numexpr \xint_c_x^iv+#2+#5{#1}% }% -\def\XINT_div_final_e #1#2#3#4#5#6% A final, q, trash, Q, L, B +\def\XINT_div_I_dP #1.#2#3#4% {% - \XINT_div_final_f {#1}% - {\romannumeral0\XINT_add_A 0{}#2000\W\X\Y\Z #4\W\X\Y\Z }% + \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_final_f #1#2#3% R,Q \`a d\'evelopper,c. re-styled in 1.09i +\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% {% - \if0\XINT_Sgn #1\Z - \expandafter\xint_firstoftwo - \else\expandafter\xint_secondoftwo - \fi - {\XINT_div_final_end {0}}% - {\expandafter\XINT_div_final_end\expandafter - {\romannumeral0\XINT_dsh_checksignx #3\Z {#1}}% - }% - {#2}% + \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}% }% -\edef\XINT_div_final_end #1#2% +\def\XINT_div_III_ab #1#2.#3.#4#5% {% - \noexpand\expandafter\space\noexpand\expandafter {#2}{#1}% + \expandafter\XINT_div_III_b + \romannumeral0\XINT_cuz_loop #2#3\W\W\W\W\W\W\W\Z.% }% -\def\XINT_div_body_a #1% +\def\XINT_div_I_h #1.#2#3#4#5#6.#7#8% {% - \XINT_div_body_b #1\Z {#1}% + \XINT_div_II_b #1#2#3#4#5.{#8}{#7}{#6}{#8}% }% -\def\XINT_div_body_b #1#2#3#4#5#6#7#8#9\Z +\def\XINT_div_II_b #1#2#3#4#5#6#7#8#9% {% - \XINT_div_body_c {#1#2#3#4#5#6#7#8}% + \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_body_c #1#2#3% +\def\XINT_div_II_skipc 0000\XINT_div_II_c #1#2#3#4#5.#6#7% {% - \XINT_div_body_d {#3}{}#2\Z {#1}{#3}% + \XINT_div_II_k #7{#4#5}{#6}{0000}% }% -\def\XINT_div_body_d #1#2#3#4#5#6% +\def\XINT_div_II_c #1#2#3#4% {% - \ifnum #1 >\xint_c_ - \expandafter\XINT_div_body_d - \expandafter{\the\numexpr #1-\xint_c_iv\expandafter }% - \else - \expandafter\XINT_div_body_e - \fi - {#6#5#4#3#2}% + \expandafter\XINT_div_II_d\the\numexpr (#3#4+#2)/#1+\xint_c_ixixixix\relax + {#1}{#2}#3#4% }% -\def\XINT_div_body_e #1#2\Z #3% +\def\XINT_div_II_d 1#1#2#3#4#5#6#7.#8% {% - \XINT_div_body_f {#3}{#1}{#2}% + \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_body_f #1#2#3#4#5#6#7#8% +\def\XINT_div_II_e #1#2#3#4% {% - \expandafter\XINT_div_body_gg - \the\numexpr (#1+(#5+\xint_c_i)/\xint_c_ii)/(#5+\xint_c_i)+99999\relax - {#8}{#2}{#8}{#4}{#5}{#3}{#6}{#7}{#8}% + \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_body_gg #1#2#3#4#5#6% +\def\XINT_div_II_skipf 0000\XINT_div_II_f 0000#1.#2#3#4#5#6% {% - \xint_UDzerofork - #2\XINT_div_body_gk - 0{\XINT_div_body_ggk #2}% - \krof - {#3#4#5#6}% + \XINT_div_II_k #6{#1}{#4}{#5}% }% -\def\XINT_div_body_gk #1#2#3% +\def\XINT_div_II_f #1#2#3#4#5#6#7#8#9.% {% - \expandafter\XINT_div_body_h - \romannumeral0\XINT_div_sub_xpxp - {\romannumeral0\XINT_mul_Mr {#1}#2\Z\Z\Z\Z }{#3}\Z {#1}% + \XINT_div_II_fa {#1#2#3#4#5#6#7#8}{#1#2#3#4#5#6#7#8#9}% }% -\def\XINT_div_body_ggk #1#2#3% +\def\XINT_div_II_fa #1#2#3#4% {% - \expandafter \XINT_div_body_gggk \expandafter - {\romannumeral0\XINT_mul_Mr {#1}0000#3\Z\Z\Z\Z }% - {\romannumeral0\XINT_mul_Mr {#2}#3\Z\Z\Z\Z }% - {#1#2}% + \expandafter\XINT_div_II_g\expandafter + {\the\numexpr (#1+#4)/#3-\xint_c_i}{#2}% }% -\def\XINT_div_body_gggk #1#2#3#4% +\def\XINT_div_II_g #1#2#3#4% {% - \expandafter\XINT_div_body_h - \romannumeral0\XINT_div_sub_xpxp - {\romannumeral0\expandafter\XINT_mul_Ar - \expandafter0\expandafter{\expandafter}#2\W\X\Y\Z #1\W\X\Y\Z }% - {#4}\Z {#3}% + \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_body_h #1#2#3#4#5#6#7#8#9\Z +\def\XINT_div_II_h 1#1#2#3#4#5#6#7% {% - \ifnum #1#2#3#4>\xint_c_ - \xint_afterfi{\XINT_div_body_i {#1#2#3#4#5#6#7#8}}% - \else - \expandafter\XINT_div_body_k - \fi - {#1#2#3#4#5#6#7#8#9}% + \XINT_div_II_k #7{#5}{#6}{#1#2#3#4}% }% -\def\XINT_div_body_k #1#2#3% +\def\XINT_div_II_k #1#2#3#4#5% {% - \XINT_div_body_l {#1}{#2}% + \expandafter\XINT_div_II_l \the\numexpr #4-\xint_c_iv.{#3}#1{#2}#5.% }% -\def\XINT_div_body_i #1#2#3#4#5#6% +\def\XINT_div_II_l #1.#2#3#4#5#6#7#8#9% {% - \expandafter\XINT_div_body_j - \expandafter{\the\numexpr (#1+(#6+1)/2)/(#6+1)-1}% - {#2}{#3}{#4}{#5}{#6}% + \XINT_div_II_m {{#1}{#2}{{#3}{#4}}{#5}}{#5}{#6#7#8#9}#6#7#8#9% }% -\def\XINT_div_body_j #1#2#3#4% +\def\XINT_div_II_m #1#2#3#4.#5#6% {% - \expandafter \XINT_div_body_l \expandafter - {\romannumeral0\XINT_div_sub_xpxp - {\romannumeral0\XINT_mul_Mr {#1}#4\Z\Z\Z\Z }{\xintReverseOrder{#2}}}% - {#3+#1}% + \XINT_div_I_a {#3}{#2}{#4}{#5}{#6}#1% }% -\def\XINT_div_body_l #1#2#3#4#5#6#7% +\def\XINT_div_little_b #1#2#3#4#5#6#7% {% - \expandafter\XINT_div_body_m - \the\numexpr \xint_c_x^viii+#2\relax {#6}{#3}{#7}{#1#5}{#4}% + \XINT_div_little_c #3.{{#4}{#6}}{#1}% }% -\def\XINT_div_body_m 1#1#2#3#4#5#6#7#8% +\def\XINT_div_little_c #1#2#3#4#5.#6#7% {% - \ifnum #1#2#3#4>\xint_c_ - \xint_afterfi {\XINT_div_body_n {#8#7#6#5#4#3#2#1}}% - \else - \xint_afterfi {\XINT_div_body_n {#8#7#6#5}}% - \fi + \XINT_div_littleI_a {#1#2#3#4}#6{#7}{#5}% }% -\def\XINT_div_body_n #1#2% +\def\XINT_div_littleI_a #1#2#3% {% - \expandafter\XINT_div_body_o\expandafter - {\romannumeral0\XINT_addr_A 0{}#1\W\X\Y\Z #2\W\X\Y\Z }% + \expandafter\XINT_div_littleI_b + \the\numexpr (#1+#2)/#3-\xint_c_i{#1}{#2}{#3}% }% -\def\XINT_div_body_o #1#2#3#4% +\def\XINT_div_littleI_b #1% {% - \XINT_div_body_p {#3}{#2}{}#4\Z {#1}% + \xint_gob_til_zero #1\XINT_div_littleI_skip 0\XINT_div_littleI_c #1% }% -\def\XINT_div_body_p #1#2#3#4#5#6#7% +\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% {% - \ifnum #1 > #2 - \xint_afterfi - {\ifnum #4#5#6#7 > \xint_c_ - \expandafter\XINT_div_body_q - \else - \expandafter\XINT_div_body_repeatp - \fi }% - \else - \expandafter\XINT_div_gotofinal_a - \fi - {#1}{#2}{#3}#4#5#6#7% + \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_body_repeatp #1#2#3#4#5#6#7% +\def\XINT_div_littleIII_ab #1#2#3.#4% {% - \expandafter\XINT_div_body_p\expandafter{\the\numexpr #1-4}{#2}{0000#3}% + \expandafter\XINT_div_III_b\the\numexpr #2#3.% }% -\def\XINT_div_body_q #1#2#3#4\Z #5#6% +\def\XINT_div_littleII_b #1% {% - \XINT_div_body_b #4\Z {#4}{#2}{#6}{#3#5}{#1}% + \expandafter\XINT_div_littleII_c\expandafter {\the\numexpr #1-\xint_c_iv}% }% -\def\XINT_div_gotofinal_a #1#2#3#4\Z % +\def\XINT_div_littleII_c #1#2#3#4#5#6#7.#8% {% - \XINT_div_gotofinal_b #3\Z {#4}{#1}% + \XINT_div_littleII_d {#2#3#4#5#6}#8{#1}{#7}% }% -\def\XINT_div_gotofinal_b 0000#1\Z #2#3#4#5% +\def\XINT_div_littleII_d #1#2#3% {% - \XINT_div_final_a {#2}{#3}{#5}{#1#4}{#3}% + \expandafter\XINT_div_littleII_e\the\numexpr (#1+#2)/#3+\xint_c_ixixixix.% + {#1}{#2}{#3}% }% -\def\XINT_div_sub_xpxp #1% +\def\XINT_div_littleII_e 1#1.#2#3#4% {% - \expandafter \XINT_div_sub_xpxp_a \expandafter{#1}% + \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_sub_xpxp_a #1#2% +\def\XINT_div_littleII_f #1.#2#3#4#5#6% {% - \expandafter\expandafter\expandafter\XINT_div_sub_xpxp_b - #2\W\X\Y\Z #1\W\X\Y\Z + \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 {% @@ -2727,61 +2667,36 @@ \def\XINT_div_sub_onestep #1#2#3#4#5#6% {% \expandafter\XINT_div_sub_backtoA - \the\numexpr 11#5#4#3#2-#6+#1-\xint_c_i.% + \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#2#3#4#5#6#7% +\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_UDzerofork - #1\XINT_div_sub_C % - 0\XINT_div_sub_D % pas de retenue - \krof - {#7}#2#3#4#5% + \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_D #1#2\W\X\Y\Z +\def\XINT_div_sub_C_onestep #1#2% {% - \expandafter\space - \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_div_sub_C #1#2#3#4#5% -{% - \xint_gob_til_W #2\xint_div_sub_cz\W - \XINT_div_sub_AC_onestep {#5#4#3#2}{#1}% -}% -\def\XINT_div_sub_AC_onestep #1% -{% - \expandafter\XINT_div_sub_backtoC\the\numexpr 11#1-\xint_c_i.% + \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_AC_checkcarry #2{#3#4}% la retenue va \^etre examin\'ee -}% -\def\XINT_div_sub_AC_checkcarry #1% -{% - \xint_gob_til_one #1\xint_div_sub_AC_nocarry 1\XINT_div_sub_C + \XINT_div_sub_C #2{#3#4}% }% -\def\xint_div_sub_AC_nocarry 1\XINT_div_sub_C #1#2\W\X\Y\Z +\def\xint_div_sub_cz\W\XINT_div_sub_C_onestep #1#2% {% - \expandafter\space - \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% + \if#10% retenue + \expandafter\xint_div_sub_neg + \else\expandafter\xint_div_sub_ok + \fi }% -\def\xint_div_sub_cz\W\XINT_div_sub_AC_onestep #1#2{ #2}% -\def\xint_div_sub_az\W\XINT_div_sub_B #1#2#3#4\Z { #3}% +\def\xint_div_sub_neg #1{ -}% +\def\xint_div_sub_ok #1{ #1}% \def\xintiiFDg {\romannumeral0\xintiifdg }% \def\xintiifdg #1% {% @@ -2918,7 +2833,7 @@ \def\XINT_dshr_xzeroorneg #1\Z #2{ 0}% \def\XINT_dshr_xpositive #1\Z {% - \expandafter\xint_secondoftwo_afterstop\romannumeral0\xintdsx {#1}% + \expandafter\xint_secondoftwo_thenstop\romannumeral0\xintdsx {#1}% }% \def\xintDSH {\romannumeral0\xintdsh }% \def\xintdsh #1#2% @@ -2940,7 +2855,7 @@ \def\XINT_dsh_xiszero #1\Z #2{ #2}% \def\XINT_dsh_xisPos #1\Z #2% {% - \expandafter\xint_firstoftwo_afterstop + \expandafter\xint_firstoftwo_thenstop \romannumeral0\XINT_dsx_checksignA #2\Z {#1}% via DSx }% \def\xintDSx {\romannumeral0\xintdsx }% @@ -2975,7 +2890,7 @@ \def\XINT_dsx_xisNeg_Azero #1\Z #2{ 0}% \def\XINT_dsx_xisNeg_checkx #1% {% - \ifnum #1>999999999 + \ifnum #1>1000000 \xint_afterfi {\xintError:TooBigDecimalShift \expandafter\space\expandafter 0\xint_gobble_iv }% @@ -2983,11 +2898,12 @@ \expandafter \XINT_dsx_zeroloop \fi }% +\def\XINT_dsx_addzerosnofuss #1{\XINT_dsx_zeroloop {#1}{}\Z }% \def\XINT_dsx_zeroloop #1#2% {% - \ifnum #1<9 \XINT_dsx_exita\fi + \ifnum #1<\xint_c_ix \XINT_dsx_exita\fi \expandafter\XINT_dsx_zeroloop\expandafter - {\the\numexpr #1-8}{#200000000}% + {\the\numexpr #1-\xint_c_viii}{#200000000}% }% \def\XINT_dsx_exita\fi\expandafter\XINT_dsx_zeroloop {% @@ -3056,12 +2972,12 @@ \def\xintDecSplitR {\romannumeral0\xintdecsplitr }% \def\xintdecsplitl {% - \expandafter\xint_firstoftwo_afterstop + \expandafter\xint_firstoftwo_thenstop \romannumeral0\xintdecsplit }% \def\xintdecsplitr {% - \expandafter\xint_secondoftwo_afterstop + \expandafter\xint_secondoftwo_thenstop \romannumeral0\xintdecsplit }% \def\xintDecSplit {\romannumeral0\xintdecsplit }% @@ -3085,7 +3001,7 @@ }% \def\XINT_split_bigx #1\Z #2% {% - \ifcase\XINT__Sgn #1\Z + \ifcase\XINT_cntSgn #1\Z \or \xint_afterfi { {}{#2}}% positive big x \else \xint_afterfi { {#2}{}}% negative big x @@ -3106,9 +3022,9 @@ }% \def\XINT_split_fromleft_loop #1% {% - \ifnum #1<8 \XINT_split_fromleft_exita\fi + \ifnum #1<\xint_c_viii\XINT_split_fromleft_exita\fi \expandafter\XINT_split_fromleft_loop_perhaps\expandafter - {\the\numexpr #1-8\expandafter}\XINT_split_fromleft_eight + {\the\numexpr #1-\xint_c_viii\expandafter}\XINT_split_fromleft_eight }% \def\XINT_split_fromleft_eight #1#2#3#4#5#6#7#8#9{#9{#1#2#3#4#5#6#7#8#9}}% \def\XINT_split_fromleft_loop_perhaps #1#2% @@ -3124,7 +3040,7 @@ \def\XINT_split_fromleft_exita\fi \expandafter\XINT_split_fromleft_loop_perhaps\expandafter #1#2% {\fi \XINT_split_fromleft_exitb #1}% -\def\XINT_split_fromleft_exitb\the\numexpr #1-8\expandafter +\def\XINT_split_fromleft_exitb\the\numexpr #1-\xint_c_viii\expandafter {% \csname XINT_split_fromleft_endsplit_\romannumeral #1\endcsname }% @@ -3164,9 +3080,9 @@ }% \def\XINT_split_fromright_loop #1% {% - \ifnum #1<8 \XINT_split_fromright_exita\fi + \ifnum #1<\xint_c_viii\XINT_split_fromright_exita\fi \expandafter\XINT_split_fromright_loop_perhaps\expandafter - {\the\numexpr #1-8\expandafter }\XINT_split_fromright_eight + {\the\numexpr #1-\xint_c_viii\expandafter }\XINT_split_fromright_eight }% \def\XINT_split_fromright_eight #1#2#3#4#5#6#7#8#9{#9{#9#8#7#6#5#4#3#2#1}}% \def\XINT_split_fromright_loop_perhaps #1#2% @@ -3178,7 +3094,7 @@ \def\XINT_split_fromright_exita\fi \expandafter\XINT_split_fromright_loop_perhaps\expandafter #1#2% {\fi \XINT_split_fromright_exitb #1}% -\def\XINT_split_fromright_exitb\the\numexpr #1-8\expandafter +\def\XINT_split_fromright_exitb\the\numexpr #1-\xint_c_viii\expandafter {% \csname XINT_split_fromright_endsplit_\romannumeral #1\endcsname }% @@ -3224,7 +3140,7 @@ }% \def\XINT_dbl_zero #1\Z \W\W\W\W\W\W\W { 0}% \def\XINT_dbl_neg - {\expandafter\xint_minus_afterstop\romannumeral0\XINT_dbl_pos }% + {\expandafter\xint_minus_thenstop\romannumeral0\XINT_dbl_pos }% \def\XINT_dbl_pos {% \expandafter\XINT_dbl_a \expandafter{\expandafter}\expandafter 0% @@ -3315,7 +3231,7 @@ }% \def\XINT_dec_zero #1\W\W\W\W\W\W\W\W { -1}% \def\XINT_dec_neg - {\expandafter\xint_minus_afterstop\romannumeral0\XINT_inc_pos }% + {\expandafter\xint_minus_thenstop\romannumeral0\XINT_inc_pos }% \def\XINT_dec_pos {% \expandafter\XINT_dec_a \expandafter{\expandafter}% @@ -3380,7 +3296,6 @@ \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\XINT_dsx_addzerosnofuss #1{\XINT_dsx_zeroloop {#1}{}\Z }% \def\xintiSqrt {\romannumeral0\xintisqrt }% \def\xintisqrt {\expandafter\XINT_sqrt_post\romannumeral0\xintisquareroot }% @@ -3397,12 +3312,12 @@ 0-{\XINT_sqrt #1}% \krof }% -\def\XINT_sqrt_iszero #1\Z { 1.}% 1.09e was wrong from inception in 1.08 :-(( -\edef\XINT_sqrt_isneg #1\Z {\noexpand\xintError:RootOfNegative\space 1.}% +\def\XINT_sqrt_iszero #1\Z { 1.}% +\edef\XINT_sqrt_isneg #1\Z {\noexpand\xintError:RootOfNegative\space 1.}% \def\XINT_sqrt #1\Z {% \expandafter\XINT_sqrt_start\expandafter - {\romannumeral0\xintlength {#1}}{#1}% + {\romannumeral0\xintlength {#1}}{#1}% }% \def\XINT_sqrt_start #1% {% @@ -3442,40 +3357,19 @@ }% \def\XINT_sqrt_c #1#2% {% - \expandafter #2% - \ifcase #1 - \or 2\or 2\or 2\or 3\or 3\or 3\or 3\or 3\or %3+5 - 4\or 4\or 4\or 4\or 4\or 4\or 4\or %+7 - 5\or 5\or 5\or 5\or 5\or 5\or 5\or 5\or 5\or %+9 - 6\or 6\or 6\or 6\or 6\or 6\or 6\or 6\or 6\or 6\or 6\or %+11 - 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or 7\or %+13 - 8\or 8\or 8\or 8\or 8\or 8\or 8\or - 8\or 8\or 8\or 8\or 8\or 8\or 8\or 8\or %+15 - 9\or 9\or 9\or 9\or 9\or 9\or 9\or 9\or - 9\or 9\or 9\or 9\or 9\or 9\or 9\or 9\or 9\or %+17 - 10\or 10\or 10\or 10\or 10\or 10\or 10\or 10\or 10\or - 10\or 10\or 10\or 10\or 10\or 10\or 10\or 10\or 10\or 10\or\fi %+19 -}% -\def\XINT_sqrt_small_d #1\or #2\fi #3% + \expandafter #2\expandafter + {\the\numexpr\ifnum #1>\xint_c_iii + \ifnum #1>\xint_c_viii + \ifnum #1>15 \ifnum #1>24 \ifnum #1>35 + \ifnum #1>48 \ifnum #1>63 \ifnum #1>80 + 10\else 9\fi \else 8\fi \else 7\fi \else 6\fi + \else 5\fi \else 4\fi \else 3\fi \else 2\fi \relax }% +}% +\def\XINT_sqrt_small_d #1#2% {% - \fi - \expandafter\XINT_sqrt_small_de - \ifcase \numexpr #3/\xint_c_ii-\xint_c_i\relax - {}% - \or - 0% - \or - {00}% - \or - {000}% - \or - {0000}% - \or - \fi {#1}% -}% -\def\XINT_sqrt_small_de #1\or #2\fi #3% -{% - \fi\XINT_sqrt_small_e {#3#1}% + \expandafter\XINT_sqrt_small_e\expandafter + {\the\numexpr #1\ifcase \numexpr #2/\xint_c_ii-\xint_c_i\relax + \or 0\or 00\or 000\or 0000\fi }% }% \def\XINT_sqrt_small_e #1#2% {% @@ -3502,15 +3396,14 @@ {\the\numexpr #3-#1}% }% \def\XINT_sqrt_small_end #1#2#3{ {#3}{#2}}% -\def\XINT_sqrt_big_d #1\or #2\fi #3% +\def\XINT_sqrt_big_d #1#2% {% - \fi - \ifodd #3 - \xint_afterfi{\expandafter\XINT_sqrt_big_eB}% + \ifodd #2 + \expandafter\expandafter\expandafter\XINT_sqrt_big_eB \else - \xint_afterfi{\expandafter\XINT_sqrt_big_eA}% + \expandafter\expandafter\expandafter\XINT_sqrt_big_eA \fi - \expandafter{\the\numexpr #3/\xint_c_ii }{#1}% + \expandafter {\the\numexpr #2/\xint_c_ii }{#1}% }% \def\XINT_sqrt_big_eA #1#2#3% {% @@ -3556,7 +3449,7 @@ \def\XINT_sqrt_big_g #1#2% {% \expandafter\XINT_sqrt_big_j - \romannumeral0\xintiidivision{#1} + \romannumeral0\xintiidivision{#1}% {\romannumeral0\XINT_dbl_pos #2\R\R\R\R\R\R\R\Z \W\W\W\W\W\W\W }{#2}% }% \def\XINT_sqrt_big_j #1% @@ -3578,6 +3471,70 @@ {#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 \XINT_restorecatcodes_endinput% \endinput %% |