diff options
author | Karl Berry <karl@freefriends.org> | 2016-12-13 22:25:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-12-13 22:25:04 +0000 |
commit | 62b7fc3dff794893474f93a768c95f26477d5450 (patch) | |
tree | cef9bef7df69304de695cca46f601a91b54c9ac5 /Master/texmf-dist/tex/generic/xint/xint.sty | |
parent | a80c437516ee0dae0c4ba2c6113e3dbcffbd5e7e (diff) |
xint (13dec16)
git-svn-id: svn://tug.org/texlive/trunk@42698 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 | 395 |
1 files changed, 152 insertions, 243 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty index 25a779f3a93..289b233b71f 100644 --- a/Master/texmf-dist/tex/generic/xint/xint.sty +++ b/Master/texmf-dist/tex/generic/xint/xint.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2h 2016/11/20 +%% The xint bundle 1.2i 2016/12/13 %% Copyright (C) 2013-2016 by Jean-Francois Burnol %% xint: Expandable operations on big integers %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty (loaded by xintcore.sty) \XINT_providespackage \ProvidesPackage{xint}% - [2016/11/20 1.2h Expandable operations on big integers (JFB)]% + [2016/12/13 1.2i 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}% @@ -89,38 +89,38 @@ \else\expandafter\xint_firstofthree_thenstop \fi }% -\def\xintiiIsOne {\romannumeral0\xintiiisone }% +\def\xintiiIsOne {\romannumeral0\xintiiisone }% \def\xintiiisone #1{\expandafter\XINT_isone\romannumeral`&&@#1XY}% \def\xintIsOne {\romannumeral0\xintisone }% -\def\xintisone #1{\expandafter\XINT_isone\romannumeral0\xintnum{#1}XY}% -\def\XINT_isOne #1{\romannumeral0\XINT_isone #1XY}% +\def\xintisone #1{\expandafter\XINT_isone\romannumeral0\xintnum{#1}XY}% \def\XINT_isone #1#2#3Y% {% \unless\if#2X\xint_dothis{ 0}\fi \unless\if#11\xint_dothis{ 0}\fi \xint_orthat{ 1}% }% +\def\XINT_isOne #1{\XINT_iSone#1XY}% +\def\XINT_iSone #1#2#3Y% +{% + \unless\if#2X\xint_dothis0\fi + \unless\if#11\xint_dothis0\fi + \xint_orthat1% +}% \let\xintRev\xintReverseDigits \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 + \xint_relax\xint_relax\xint_relax\xint_relax\xint_relax + \xint_c_i\xint_c_ii\xint_c_iii\xint_c_iv + \xint_c_v\xint_c_vi\xint_c_vii\xint_c_viii\xint_c_ix\xint_bye\relax }% -\def\XINT_len_fork #1% +\edef\XINT_len_fork #1% {% - \expandafter\XINT_length_loop - \xint_UDsignfork - #1{0.}% - -{0.#1}% - \krof + \noexpand\expandafter\space + \unexpanded{\the\numexpr\xint_c_ix\expandafter + \XINT_length_loop\xint_UDsignfork#1{}-{#1}\krof}% }% \def\xintBool #1{\romannumeral`&&@% \csname if#1\endcsname\expandafter1\else\expandafter0\fi }% @@ -199,8 +199,8 @@ }% \let\xintifTrueAelseB\xintifNotZero \let\xintifFalseAelseB\xintifZero -\let\xintifTrue\xintifNotZero -\let\xintifTrueFalse\xintifNotZero +%%\let\xintifTrue\xintifNotZero % now removed +%%\let\xintifTrueFalse\xintifNotZero % now removed \def\xintifCmp {\romannumeral0\xintifcmp }% \def\xintifcmp #1#2% {% @@ -841,7 +841,7 @@ \def\xintiiMON {\romannumeral0\xintiimon }% \def\xintiimon #1% {% - \ifodd\xintiiLDg {#1} + \ifodd\xintiiLDg {#1} %<- intentional space \xint_afterfi{ -1}% \else \xint_afterfi{ 1}% @@ -850,7 +850,7 @@ \def\xintiiMMON {\romannumeral0\xintiimmon }% \def\xintiimmon #1% {% - \ifodd\xintiiLDg {#1} + \ifodd\xintiiLDg {#1} %<- intentional space \xint_afterfi{ 1}% \else \xint_afterfi{ -1}% @@ -859,7 +859,7 @@ \def\xintMON {\romannumeral0\xintmon }% \def\xintmon #1% {% - \ifodd\xintLDg {#1} + \ifodd\xintLDg {#1} %<- intentional space \xint_afterfi{ -1}% \else \xint_afterfi{ 1}% @@ -868,7 +868,7 @@ \def\xintMMON {\romannumeral0\xintmmon }% \def\xintmmon #1% {% - \ifodd\xintLDg {#1} + \ifodd\xintLDg {#1} %<- intentional space \xint_afterfi{ 1}% \else \xint_afterfi{ -1}% @@ -877,7 +877,7 @@ \def\xintiiOdd {\romannumeral0\xintiiodd }% \def\xintiiodd #1% {% - \ifodd\xintiiLDg{#1} + \ifodd\xintiiLDg{#1} %<- intentional space \xint_afterfi{ 1}% \else \xint_afterfi{ 0}% @@ -886,7 +886,7 @@ \def\xintiiEven {\romannumeral0\xintiieven }% \def\xintiieven #1% {% - \ifodd\xintiiLDg{#1} + \ifodd\xintiiLDg{#1} %<- intentional space \xint_afterfi{ 0}% \else \xint_afterfi{ 1}% @@ -895,7 +895,7 @@ \def\xintOdd {\romannumeral0\xintodd }% \def\xintodd #1% {% - \ifodd\xintLDg{#1} + \ifodd\xintLDg{#1} %<- intentional space \xint_afterfi{ 1}% \else \xint_afterfi{ 0}% @@ -904,49 +904,18 @@ \def\xintEven {\romannumeral0\xinteven }% \def\xinteven #1% {% - \ifodd\xintLDg{#1} + \ifodd\xintLDg{#1} %<- intentional space \xint_afterfi{ 0}% \else \xint_afterfi{ 1}% \fi }% -\def\xintDSL {\romannumeral0\xintdsl }% -\def\xintdsl #1% -{% - \expandafter\XINT_dsl \romannumeral`&&@#1\Z -}% -\def\XINT_DSL #1{\romannumeral0\XINT_dsl #1\Z }% -\def\XINT_dsl #1% -{% - \xint_gob_til_zero #1\xint_dsl_zero 0\XINT_dsl_ #1% -}% -\def\xint_dsl_zero 0\XINT_dsl_ 0#1\Z { 0}% -\def\XINT_dsl_ #1\Z { #10}% -\def\xintDSR {\romannumeral0\xintdsr }% -\def\xintdsr #1% -{% - \expandafter\XINT_dsr_a\expandafter {\romannumeral`&&@#1}\W\Z -}% -\def\XINT_DSR #1{\romannumeral0\XINT_dsr_a {#1}\W\Z }% -\def\XINT_dsr_a -{% - \expandafter\XINT_dsr_b\romannumeral0\xintreverseorder -}% -\def\XINT_dsr_b #1#2#3\Z -{% - \xint_gob_til_W #2\xint_dsr_onedigit\W - \xint_gob_til_minus #2\xint_dsr_onedigit-% - \expandafter\XINT_dsr_removew - \romannumeral0\xintreverseorder {#2#3}% -}% -\def\xint_dsr_onedigit #1\xintreverseorder #2{ 0}% -\def\XINT_dsr_removew #1\W { }% \def\xintDSHr {\romannumeral0\xintdshr }% -\def\xintdshr #1% +\def\xintdshr #1#2% {% - \expandafter\XINT_dshr_checkxpositive \the\numexpr #1\relax\Z + \expandafter\XINT_dshr_fork\the\numexpr#1\expandafter.\romannumeral`&&@#2;% }% -\def\XINT_dshr_checkxpositive #1% +\def\XINT_dshr_fork #1% {% \xint_UDzerominusfork 0#1\XINT_dshr_xzeroorneg @@ -954,46 +923,35 @@ 0-\XINT_dshr_xpositive \krof #1% }% -\def\XINT_dshr_xzeroorneg #1\Z #2{ 0}% -\def\XINT_dshr_xpositive #1\Z +\def\XINT_dshr_xzeroorneg #1;{ 0}% +\def\XINT_dshr_xpositive {% - \expandafter\xint_secondoftwo_thenstop\romannumeral0\xintdsx {#1}% + \expandafter\xint_secondoftwo_thenstop\romannumeral0\XINT_dsx_xisPos }% \def\xintDSH {\romannumeral0\xintdsh }% \def\xintdsh #1#2% {% - \expandafter\xint_dsh\expandafter {\romannumeral`&&@#2}{#1}% -}% -\def\xint_dsh #1#2% -{% - \expandafter\XINT_dsh_checksignx \the\numexpr #2\relax\Z {#1}% + \expandafter\XINT_dsh_fork\the\numexpr#1\expandafter.\romannumeral`&&@#2;% }% -\def\XINT_dsh_checksignx #1% +\def\XINT_dsh_fork #1% {% \xint_UDzerominusfork #1-\XINT_dsh_xiszero - 0#1\XINT_dsx_xisNeg_checkA % on passe direct dans DSx + 0#1\XINT_dsx_xisNeg_checkA 0-{\XINT_dsh_xisPos #1}% \krof }% -\def\XINT_dsh_xiszero #1\Z #2{ #2}% -\def\XINT_dsh_xisPos #1\Z #2% +\def\XINT_dsh_xiszero #1.#2;{ #2}% +\def\XINT_dsh_xisPos {% - \expandafter\xint_firstoftwo_thenstop - \romannumeral0\XINT_dsx_checksignA #2\Z {#1}% via DSx + \expandafter\xint_firstoftwo_thenstop\romannumeral0\XINT_dsx_xisPos }% \def\xintDSx {\romannumeral0\xintdsx }% \def\xintdsx #1#2% {% - \expandafter\xint_dsx\expandafter {\romannumeral`&&@#2}{#1}% + \expandafter\XINT_dsx_fork\the\numexpr#1\expandafter.\romannumeral`&&@#2;% }% -\def\xint_dsx #1#2% -{% - \expandafter\XINT_dsx_checksignx \the\numexpr #2\relax\Z {#1}% -}% -\def\XINT_DSx #1#2{\romannumeral0\XINT_dsx_checksignx #1\Z {#2}}% -\def\XINT_dsx #1#2{\XINT_dsx_checksignx #1\Z {#2}}% -\def\XINT_dsx_checksignx #1% +\def\XINT_dsx_fork #1% {% \xint_UDzerominusfork #1-\XINT_dsx_xisZero @@ -1001,48 +959,31 @@ 0-{\XINT_dsx_xisPos #1}% \krof }% -\def\XINT_dsx_xisZero #1\Z #2{{#2}{0}}% attention comme x > 0 -\def\XINT_dsx_xisNeg_checkA #1\Z #2% -{% - \XINT_dsx_xisNeg_checkA_ #2\Z {#1}% -}% -\def\XINT_dsx_xisNeg_checkA_ #1#2\Z #3% +\def\XINT_dsx_xisZero #1.#2;{{#2}{0}}% +\def\XINT_dsx_xisNeg_checkA #1.#2% {% - \xint_gob_til_zero #1\XINT_dsx_xisNeg_Azero 0% - \XINT_dsx_zeroloop #3.{}\Z {#1#2}% + \xint_gob_til_zero #2\XINT_dsx_xisNeg_Azero 0% + \expandafter\XINT_dsx_append\romannumeral\XINT_rep #1\endcsname 0.#2% }% -\def\XINT_dsx_xisNeg_Azero #1\Z #2{ 0}% -\def\XINT_dsx_addzerosnofuss #1{\XINT_dsx_zeroloop #1.{}\Z }% -\def\XINT_dsx_zeroloop #1.#2% -{% - \ifnum #1<\xint_c_ix \expandafter\XINT_dsx_exita\fi - \expandafter\XINT_dsx_zeroloop\the\numexpr #1-\xint_c_viii.{#200000000}% -}% -\def\XINT_dsx_exita - \expandafter\XINT_dsx_zeroloop\the\numexpr #1-\xint_c_viii.#2% -{% - \expandafter\expandafter\expandafter - \XINT_dsx_addzeros\csname xint_gobble_\expandafter - \romannumeral\numexpr \xint_c_viii-(#1)\endcsname #2% -}% -\def\XINT_dsx_addzeros #1\Z #2{ #2#1}% -\def\XINT_dsx_xisPos #1\Z #2% -{% - \XINT_dsx_checksignA #2\Z {#1}% -}% -\def\XINT_dsx_checksignA #1% +\def\XINT_dsx_xisNeg_Azero #1;{ 0}% +\def\XINT_dsx_addzeros #1% + {\expandafter\XINT_dsx_append\romannumeral\XINT_rep#1\endcsname0.}% +\def\XINT_dsx_addzerosnofuss #1% + {\expandafter\XINT_dsx_append\romannumeral\xintreplicate{#1}0.}% +\def\XINT_dsx_append #1.#2;{ #2#1}% +\def\XINT_dsx_xisPos #1.#2% {% \xint_UDzerominusfork - #1-\XINT_dsx_AisZero - 0#1\XINT_dsx_AisNeg - 0-{\XINT_dsx_AisPos #1}% - \krof + #2-\XINT_dsx_AisZero + 0#2\XINT_dsx_AisNeg + 0-\XINT_dsx_AisPos + \krof #1.#2% }% -\def\XINT_dsx_AisZero #1\Z #2{{0}{0}}% -\def\XINT_dsx_AisNeg #1\Z #2% +\def\XINT_dsx_AisZero #1;{{0}{0}}% +\def\XINT_dsx_AisNeg #1.-#2;% {% \expandafter\XINT_dsx_AisNeg_checkiffirstempty - \romannumeral0\XINT_split_xfork #2.#1\W\W\W\W\W\W\W\W\Z + \romannumeral0\XINT_split_xfork #1.#2\xint_bye2345678\xint_bye..% }% \def\XINT_dsx_AisNeg_checkiffirstempty #1% {% @@ -1059,10 +1000,10 @@ \expandafter\XINT_dsx_end \expandafter {\romannumeral0\XINT_num {#2}}{-#1}% }% -\def\XINT_dsx_AisPos #1\Z #2% +\def\XINT_dsx_AisPos #1.#2;% {% \expandafter\XINT_dsx_AisPos_finish - \romannumeral0\XINT_split_xfork #2.#1\W\W\W\W\W\W\W\W\Z + \romannumeral0\XINT_split_xfork #1.#2\xint_bye2345678\xint_bye..% }% \def\XINT_dsx_AisPos_finish #1.#2.% {% @@ -1076,25 +1017,28 @@ {% \expandafter\XINT_split_finish \romannumeral0\expandafter\XINT_split_xfork - \the\numexpr #1\expandafter.\romannumeral0\xintiiabs {#2}\W\W\W\W\W\W\W\W\Z + \the\numexpr #1\expandafter.\romannumeral`&&@#2% + \xint_bye2345678\xint_bye..% }% \def\xintDecSplitL {\romannumeral0\xintdecsplitl }% \def\xintdecsplitl #1#2% {% \expandafter\XINT_splitl_finish \romannumeral0\expandafter\XINT_split_xfork - \the\numexpr #1\expandafter.\romannumeral0\xintiiabs {#2}\W\W\W\W\W\W\W\W\Z + \the\numexpr #1\expandafter.\romannumeral`&&@#2% + \xint_bye2345678\xint_bye..% }% \def\xintDecSplitR {\romannumeral0\xintdecsplitr }% \def\xintdecsplitr #1#2% {% \expandafter\XINT_splitr_finish \romannumeral0\expandafter\XINT_split_xfork - \the\numexpr #1\expandafter.\romannumeral0\xintiiabs {#2}\W\W\W\W\W\W\W\W\Z + \the\numexpr #1\expandafter.\romannumeral`&&@#2% + \xint_bye2345678\xint_bye..% }% \def\XINT_split_finish #1.#2.{{#1}{#2}}% -\def\XINT_splitl_finish #1.#2.{{#1}}% -\def\XINT_splitr_finish #1.#2.{{#2}}% +\def\XINT_splitl_finish #1.#2.{ #1}% +\def\XINT_splitr_finish #1.#2.{ #2}% \def\XINT_split_xfork #1% {% \xint_UDzerominusfork @@ -1103,108 +1047,63 @@ 0-{\XINT_split_fromright #1}% \krof }% -\def\XINT_split_zerosplit #1.#2\W\W\W\W\W\W\W\W\Z{ #2..}% -\def\XINT_split_fromleft #1.%#2\W\W\W\W\W\W\W\W\Z +\def\XINT_split_zerosplit .#1\xint_bye#2\xint_bye..{ #1..}% +\def\XINT_split_fromleft + {\expandafter\XINT_split_fromleft_a\the\numexpr\xint_c_viii-}% +\def\XINT_split_fromleft_a #1% {% - \XINT_split_fromleft_loop #1.{}%#2\W\W\W\W\W\W\W\W\Z -}% -\def\XINT_split_fromleft_loop #1.% -{% - \ifnum #1<\xint_c_viii\expandafter\XINT_split_fromleft_exita\fi - \expandafter\XINT_split_fromleft_loop_perhaps - \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% -{% - \xint_gob_til_W #2\XINT_split_fromleft_toofar\W - \XINT_split_fromleft_loop #1.% -}% -\def\XINT_split_fromleft_toofar\W\XINT_split_fromleft_loop #1.#2#3\Z -{% - \XINT_split_fromleft_toofar_b #2\Z -}% -\def\XINT_split_fromleft_toofar_b #1\W #2\Z { #1..}% -\def\XINT_split_fromleft_exita - \expandafter\XINT_split_fromleft_loop_perhaps - \the\numexpr #1-\xint_c_viii\expandafter.\XINT_split_fromleft_eight -{% - \csname XINT_split_fromleft_endsplit_\romannumeral #1\endcsname -}% -\def\XINT_split_fromleft_endsplit_ #1#2\W #3\Z { #1.#2.}% -\def\XINT_split_fromleft_endsplit_i #1#2% - {\XINT_split_fromleft_checkiftoofar #2{#1#2}}% -\def\XINT_split_fromleft_endsplit_ii #1#2#3% - {\XINT_split_fromleft_checkiftoofar #3{#1#2#3}}% -\def\XINT_split_fromleft_endsplit_iii #1#2#3#4% - {\XINT_split_fromleft_checkiftoofar #4{#1#2#3#4}}% -\def\XINT_split_fromleft_endsplit_iv #1#2#3#4#5% - {\XINT_split_fromleft_checkiftoofar #5{#1#2#3#4#5}}% -\def\XINT_split_fromleft_endsplit_v #1#2#3#4#5#6% - {\XINT_split_fromleft_checkiftoofar #6{#1#2#3#4#5#6}}% -\def\XINT_split_fromleft_endsplit_vi #1#2#3#4#5#6#7% - {\XINT_split_fromleft_checkiftoofar #7{#1#2#3#4#5#6#7}}% -\def\XINT_split_fromleft_endsplit_vii #1#2#3#4#5#6#7#8% - {\XINT_split_fromleft_checkiftoofar #8{#1#2#3#4#5#6#7#8}}% -\def\XINT_split_fromleft_checkiftoofar #1#2#3\W #4\Z -{% - \xint_gob_til_W #1\XINT_split_fromleft_wenttoofar\W \space#2.#3.% -}% -\def\XINT_split_fromleft_wenttoofar\W\space #1.% -{% - \XINT_split_fromleft_wenttoofar_b #1\Z -}% -\def\XINT_split_fromleft_wenttoofar_b #1\W #2\Z { #1.}% -\def\XINT_split_fromright #1.#2\W\W\W\W\W\W\W\W\Z -{% - \expandafter\XINT_split_fromright_loop - \the\numexpr #1\expandafter.\expandafter{\expandafter}% - \romannumeral0\xintreverseorder{#2}\W\W\W\W\W\W\W\W\Z #2.% -}% -\def\XINT_split_fromright_loop #1.% -{% - \ifnum #1<\xint_c_viii\expandafter\XINT_split_fromright_exita\fi - \expandafter\XINT_split_fromright_loop_perhaps - \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% -{% - \xint_gob_til_W #2\XINT_split_fromright_toofar\W - \XINT_split_fromright_loop #1.% -}% -\def\XINT_split_fromright_toofar\W\XINT_split_fromright_loop #1\Z {.}% -\def\XINT_split_fromright_exita - \expandafter\XINT_split_fromright_loop_perhaps - \the\numexpr #1-\xint_c_viii\expandafter.\XINT_split_fromright_eight -{% - \csname XINT_split_fromright_endsplit_\romannumeral #1\endcsname -}% -\def\XINT_split_fromright_endsplit_ #1#2\W #3\Z #4.% -{% - \xintreverseorder {#2}.#1.% + \xint_UDsignfork + #1\XINT_split_fromleft_b + -{\XINT_split_fromleft_end_a #1}% + \krof }% -\def\XINT_split_fromright_endsplit_i #1#2% - {\XINT_split_fromright_checkiftoofar #2{#2#1}}% -\def\XINT_split_fromright_endsplit_ii #1#2#3% - {\XINT_split_fromright_checkiftoofar #3{#3#2#1}}% -\def\XINT_split_fromright_endsplit_iii #1#2#3#4% - {\XINT_split_fromright_checkiftoofar #4{#4#3#2#1}}% -\def\XINT_split_fromright_endsplit_iv #1#2#3#4#5% - {\XINT_split_fromright_checkiftoofar #5{#5#4#3#2#1}}% -\def\XINT_split_fromright_endsplit_v #1#2#3#4#5#6% - {\XINT_split_fromright_checkiftoofar #6{#6#5#4#3#2#1}}% -\def\XINT_split_fromright_endsplit_vi #1#2#3#4#5#6#7% - {\XINT_split_fromright_checkiftoofar #7{#7#6#5#4#3#2#1}}% -\def\XINT_split_fromright_endsplit_vii #1#2#3#4#5#6#7#8% - {\XINT_split_fromright_checkiftoofar #8{#8#7#6#5#4#3#2#1}}% -\def\XINT_split_fromright_checkiftoofar #1% +\def\XINT_split_fromleft_b #1.#2#3#4#5#6#7#8#9% +{% + \expandafter\XINT_split_fromleft_clean + \the\numexpr1#2#3#4#5#6#7#8#9\expandafter + \XINT_split_fromleft_a\the\numexpr\xint_c_viii-#1.% +}% +\def\XINT_split_fromleft_end_a #1.% +{% + \expandafter\XINT_split_fromleft_clean + \the\numexpr1\csname XINT_split_fromleft_end#1\endcsname +}% +\def\XINT_split_fromleft_clean 1{ }% +\expandafter\def\csname XINT_split_fromleft_end7\endcsname #1% + {#1\XINT_split_fromleft_end_b}% +\expandafter\def\csname XINT_split_fromleft_end6\endcsname #1#2% + {#1#2\XINT_split_fromleft_end_b}% +\expandafter\def\csname XINT_split_fromleft_end5\endcsname #1#2#3% + {#1#2#3\XINT_split_fromleft_end_b}% +\expandafter\def\csname XINT_split_fromleft_end4\endcsname #1#2#3#4% + {#1#2#3#4\XINT_split_fromleft_end_b}% +\expandafter\def\csname XINT_split_fromleft_end3\endcsname #1#2#3#4#5% + {#1#2#3#4#5\XINT_split_fromleft_end_b}% +\expandafter\def\csname XINT_split_fromleft_end2\endcsname #1#2#3#4#5#6% + {#1#2#3#4#5#6\XINT_split_fromleft_end_b}% +\expandafter\def\csname XINT_split_fromleft_end1\endcsname #1#2#3#4#5#6#7% + {#1#2#3#4#5#6#7\XINT_split_fromleft_end_b}% +\expandafter\def\csname XINT_split_fromleft_end0\endcsname #1#2#3#4#5#6#7#8% + {#1#2#3#4#5#6#7#8\XINT_split_fromleft_end_b}% +\def\XINT_split_fromleft_end_b #1\xint_bye#2\xint_bye.{.#1}% puis . +\def\XINT_split_fromright #1.#2\xint_bye +{% + \expandafter\XINT_split_fromright_a + \the\numexpr#1-\numexpr\xint_c_ix\XINT_length_loop + #2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_relax + \xint_c_i\xint_c_ii\xint_c_iii\xint_c_iv + \xint_c_v\xint_c_vi\xint_c_vii\xint_c_viii\xint_c_ix\xint_bye + .#2\xint_bye +}% +\def\XINT_split_fromright_a #1% {% - \xint_gob_til_W #1\XINT_split_fromright_wenttoofar\W - \XINT_split_fromright_endsplit_ + \xint_UDsignfork + #1\XINT_split_fromleft + -\XINT_split_fromright_Lempty + \krof }% -\def\XINT_split_fromright_wenttoofar\W - \XINT_split_fromright_endsplit_ #1\Z {.}% +\def\XINT_split_fromright_Lempty #1.#2\xint_bye#3..{.#2.}% \def\xintiiSqrt {\romannumeral0\xintiisqrt }% \def\xintiiSqrtR {\romannumeral0\xintiisqrtr }% \def\xintiiSquareRoot {\romannumeral0\xintiisquareroot }% @@ -1213,11 +1112,12 @@ \def\xintisqrt {\expandafter\XINT_sqrt_post\romannumeral0\xintisquareroot }% \def\xintiisqrt {\expandafter\XINT_sqrt_post\romannumeral0\xintiisquareroot }% \def\xintiisqrtr {\expandafter\XINT_sqrtr_post\romannumeral0\xintiisquareroot }% -\def\XINT_sqrt_post #1#2{\XINT_dec_pos #1\Z }% -\def\XINT_sqrtr_post #1#2{\xintiiifLt {#2}{#1}{ #1}{\XINT_dec_pos #1\Z}}% +\def\XINT_sqrt_post #1#2{\XINT_dec #1\XINT_dec_bye234567890\xint_bye}% +\def\XINT_sqrtr_post #1#2{\xintiiifLt {#2}{#1}% + { #1}{\XINT_dec #1\XINT_dec_bye234567890\xint_bye}}% \def\xintisquareroot #1% - {\expandafter\XINT_sqrt_checkin\romannumeral0\xintnum{#1}\Z }% -\def\xintiisquareroot #1{\expandafter\XINT_sqrt_checkin\romannumeral`&&@#1\Z }% + {\expandafter\XINT_sqrt_checkin\romannumeral0\xintnum{#1}\xint_relax }% +\def\xintiisquareroot #1{\expandafter\XINT_sqrt_checkin\romannumeral`&&@#1\xint_relax }% \def\XINT_sqrt_checkin #1% {% \xint_UDzerominusfork @@ -1226,9 +1126,9 @@ 0-{\XINT_sqrt #1}% \krof }% -\def\XINT_sqrt_iszero #1\Z { 11}% -\edef\XINT_sqrt_isneg #1\Z {\noexpand\xintError:RootOfNegative\space 11}% -\def\XINT_sqrt #1\Z +\def\XINT_sqrt_iszero #1\xint_relax { 11}% +\edef\XINT_sqrt_isneg #1\xint_relax {\noexpand\xintError:RootOfNegative\space 11}% +\def\XINT_sqrt #1\xint_relax {% \expandafter\XINT_sqrt_start\romannumeral0\xintlength {#1}.#1.% }% @@ -1415,13 +1315,13 @@ }% \def\XINT_sqrt_big_gi #1.% {% - \expandafter\XINT_sqrt_big_gj - \romannumeral0\XINT_dsx_addzerosnofuss{#1}{}.#1.% + \expandafter\XINT_sqrt_big_gj\romannumeral\xintreplicate{#1}0.#1.% }% \def\XINT_sqrt_big_gj #1.#2.#3.#4.#5.% {% \expandafter\XINT_sqrt_big_gk - \romannumeral0\xintiidivision {#4#1}{\XINT_dbl_pos #5\Z}.% + \romannumeral0\xintiidivision {#4#1}% + {\XINT_dbl #5\xint_bye2345678\xint_bye*\xint_c_ii\relax}.% #1.#5.#2.#3.% }% \def\XINT_sqrt_big_gk #1#2.#3.#4.% @@ -1437,8 +1337,7 @@ \def\XINT_sqrt_big_gm #1.#2.#3.#4.#5.% {% \expandafter\XINT_sqrt_big_gn - \romannumeral0\expandafter\XINT_split_fromleft_loop - \the\numexpr\xint_c_ii*#3.{}#5\W\W\W\W\W\W\W\W\Z + \romannumeral0\XINT_split_fromleft\xint_c_ii*#3.#5\xint_bye2345678\xint_bye..% #1.#2.#3.#4.% }% \def\XINT_sqrt_big_gn #1.#2.#3.#4.#5.#6.% @@ -1451,9 +1350,9 @@ \def\XINT_sqrt_big_ka #1.#2.#3.#4.% {% \expandafter\XINT_sqrt_big_kb - \romannumeral0\XINT_dsx_addzerosnofuss {#1}{#3}.% + \romannumeral0\XINT_dsx_addzeros {#1}#3;.% \romannumeral0\xintiisub - {\XINT_dsx_addzerosnofuss {\numexpr\xint_c_ii*#1}{#2}}% + {\XINT_dsx_addzerosnofuss {\xint_c_ii*#1}#2;}% {\xintiNum{#4}}.% }% \def\XINT_sqrt_big_kb #1.#2.% @@ -1468,7 +1367,8 @@ \def\XINT_sqrt_big_kz 0.#1.% {% \expandafter\XINT_sqrt_big_kend - \romannumeral0\xintinc{\XINT_dbl_pos #1\Z}.#1.% + \romannumeral0% + \xintinc{\XINT_dbl#1\xint_bye2345678\xint_bye*\xint_c_ii\relax}.#1.% }% \def\XINT_sqrt_big_kend #1.#2.% {% @@ -1477,7 +1377,8 @@ \def\XINT_sqrt_big_kloop #1.#2.% {% \expandafter\XINT_sqrt_big_ke - \romannumeral0\xintiidivision{#1}{\romannumeral0\XINT_dbl_pos #2\Z}{#2}% + \romannumeral0\xintiidivision{#1}% + {\romannumeral0\XINT_dbl #2\xint_bye2345678\xint_bye*\xint_c_ii\relax}{#2}% }% \def\XINT_sqrt_big_ke #1% {% @@ -1887,9 +1788,17 @@ }% \def\xintiiE {\romannumeral0\xintiie }% used in \xintMod. \def\xintiie #1#2% - {\expandafter\XINT_iie\the\numexpr #2\expandafter.\expandafter{\romannumeral`&&@#1}}% -\def\XINT_iie #1.#2{\ifnum#1>\xint_c_ \xint_dothis{\xint_dsh {#2}{-#1}}\fi - \xint_orthat{ #2}}% + {\expandafter\XINT_iie_fork\the\numexpr #2\expandafter.\romannumeral`&&@#1;}% +\def\XINT_iie_fork #1% +{% + \xint_UDsignfork + #1\XINT_iie_neg + -\XINT_iie_a + \krof #1% +}% +\def\XINT_iie_a #1.% + {\expandafter\XINT_dsx_append\romannumeral\XINT_rep #1\endcsname 0.}% +\def\XINT_iie_neg #1.#2;{ #2}% \catcode`! 11 \def\xintMax {\Did_you_mean_iiMax?or_load_xintfrac!}% \def\xintMin {\Did_you_mean_iiMin?or_load_xintfrac!}% |