diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint/xintfrac.sty')
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xintfrac.sty | 95 |
1 files changed, 70 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xintfrac.sty b/Master/texmf-dist/tex/generic/xint/xintfrac.sty index 5b72d9741ef..f5c600e434a 100644 --- a/Master/texmf-dist/tex/generic/xint/xintfrac.sty +++ b/Master/texmf-dist/tex/generic/xint/xintfrac.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.4f 2021/05/10 +%% The xint bundle 1.4g 2021/05/25 %% Copyright (C) 2013-2021 by Jean-Francois Burnol %% xintfrac: Expandable operations on fractions %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintfrac}% - [2021/05/10 v1.4f Expandable operations on fractions (JFB)]% + [2021/05/25 v1.4g Expandable operations on fractions (JFB)]% \def\XINT_cntSgnFork #1% {% \ifcase #1\expandafter\xint_secondofthree @@ -103,9 +103,9 @@ \fi {#2}{#3}[#1]% }% -\def\XINT_outfrac_divisionbyzero #1#2% +\def\XINT_outfrac_divisionbyzero #1#2[#3]% {% - \XINT_signalcondition{DivisionByZero}{Division of #1 by #2}{}{0/1[0]}% + \XINT_signalcondition{DivisionByZero}{Division by zero: #1/#2.}{}{ 0/1[0]}% }% \def\XINT_outfrac_P#1{% \def\XINT_outfrac_P ##1##2% @@ -236,7 +236,7 @@ }% \def\XINT_frac_gen_Gdivbyzero_a #1~#2~% {% - \XINT_signalcondition{DivisionByZero}{Division of #1 by zero}{}{{#2}{#1}{0}}% + \XINT_signalcondition{DivisionByZero}{Division by zero: #1/0.}{}{{#2}{#1}{0}}% }% \def\XINT_frac_gen_G #1#2#3~#4~#5~% {% @@ -572,7 +572,21 @@ }% \def\XINT_denom_A #1.#2#3{ #3}% \def\XINT_denom_B -#1.#2#3{\XINT_dsx_addzeros{#1}#3;}% -\def\xintFrac {\romannumeral0\xintfrac }% +\ifdefined\documentclass +\def\xintfracTeXDeprecation#1#2{% +\PackageWarning{xintfrac}{\string#1 is deprecated. Use \string#2\MessageBreak + to suppress this warning}#2% +}% +\else +\edef\xintfracTeXDeprecation#1#2{{\newlinechar10 +\immediate\noexpand\write128{&&JPackage xintfrac Warning: \noexpand\string#1 is + deprecated. Use \noexpand\string#2&&J% +(xintfrac)\xintReplicate{16}{ }to suppress this warning +on input line \noexpand\the\inputlineno.&&J}}#2% +}% +\fi +\def\xintFrac {\xintfracTeXDeprecation\xintFrac\xintTeXFrac}% +\def\xintTeXFrac{\romannumeral0\xintfrac }% \def\xintfrac #1% {% \expandafter\XINT_fracfrac_A\romannumeral0\XINT_infrac {#1}% @@ -598,7 +612,8 @@ \frac {#2}{#3}#1% }% \def\XINT_fracfrac_E \fi\space\frac #1#2{\fi \space #1\cdot }% -\def\xintSignedFrac {\romannumeral0\xintsignedfrac }% +\def\xintSignedFrac {\xintfracTeXDeprecation\xintSignedFrac\xintTeXsignedFrac}% +\def\xintTeXsignedFrac{\romannumeral0\xintsignedfrac }% \def\xintsignedfrac #1% {% \expandafter\XINT_sgnfrac_a\romannumeral0\XINT_infrac {#1}% @@ -622,7 +637,28 @@ {% \expandafter-\romannumeral0\XINT_sgnfrac_P }% -\def\xintFwOver {\romannumeral0\xintfwover }% +\def\xintTeXfromSci#1% +{% + \expanded{\expandafter\XINT_texfromsci\expanded{#1}/\relax/\xint:}% +}% +\def\XINT_texfromsci #1/#2#3/#4\xint: +{% + \XINT_texfromsci_a #1e\relax e\xint: + {\ifx\relax#2\xint_dothis\xint_firstofone\fi + \xint_orthat{\XINT_texfromsci_frac{#2#3}}}% + {\unless\ifx\relax#2\cdot{#2#3}^{-1}\fi}% +}% +\def\XINT_texfromsci_a #1e#2#3e#4\xint:#5#6% +{% + \ifx\relax#2#5{#1}\else#1\cdot10^{#2#3}#6\fi +}% +\ifdefined\frac + \def\XINT_texfromsci_frac#1#2{\noexpand\frac{#2}{#1}}% +\else + \def\XINT_texfromsci_frac#1#2{{#2\over#1}}% +\fi +\def\xintFwOver {\xintfracTeXDeprecation\xintFwOver\xintTeXOver}% +\def\xintTeXOver{\romannumeral0\xintfwover }% \def\xintfwover #1% {% \expandafter\XINT_fwover_A\romannumeral0\XINT_infrac {#1}% @@ -646,7 +682,8 @@ \fi #1% }% -\def\xintSignedFwOver {\romannumeral0\xintsignedfwover }% +\def\xintSignedFwOver {\xintfracTeXDeprecation\xintSignedFwOver\xintTeXsignedOver}% +\def\xintTeXsignedOver{\romannumeral0\xintsignedfwover }% \def\xintsignedfwover #1% {% \expandafter\XINT_sgnfwover_a\romannumeral0\XINT_infrac {#1}% @@ -763,11 +800,11 @@ }% \def\XINT_irr_indeterminate #1#2#3#4#5% {% - \XINT_signalcondition{DivisionUndefined}{indeterminate: 0/0}{}{0/1}% + \XINT_signalcondition{DivisionUndefined}{0/0 indeterminate fraction.}{}{ 0/1}% }% \def\XINT_irr_divisionbyzero #1#2#3#4#5% {% - \XINT_signalcondition{DivisionByZero}{vanishing denominator: #5#2/0}{}{0/1}% + \XINT_signalcondition{DivisionByZero}{Division by zero: #5#2/0.}{}{ 0/1}% }% \def\XINT_irr_zero #1#2#3#4#5{ 0/1}% changed in 1.08 \def\XINT_irr_loop_a #1#2% @@ -839,11 +876,11 @@ }% \def\XINT_jrr_indeterminate #1#2#3#4#5#6#7% {% - \XINT_signalcondition{DivisionUndefined}{indeterminate: 0/0}{}{0/1}% + \XINT_signalcondition{DivisionUndefined}{0/0 indeterminate fraction.}{}{ 0/1}% }% \def\XINT_jrr_divisionbyzero #1#2#3#4#5#6#7% {% - \XINT_signalcondition{DivisionByZero}{Vanishing denominator: #7#2/0}{}{0/1}% + \XINT_signalcondition{DivisionByZero}{Division by zero: #7#2/0.}{}{ 0/1}% }% \def\XINT_jrr_zero #1#2#3#4#5#6#7{ 0/1}% changed in 1.08 \def\XINT_jrr_loop_a #1#2% @@ -1548,7 +1585,7 @@ }% \def\XINT_modtrunc_divbyzero #1#2[#3]#4.% {% - \XINT_signalcondition{DivisionByZero}{Division by #2[#3] of #1#4}{}{0/1[0]}% + \XINT_signalcondition{DivisionByZero}{Division by zero: #1#4/(#2[#3]).}{}{ 0/1[0]}% }% \def\XINT_modtrunc_aiszero #1.{ 0/1[0]}% \def\XINT_modtrunc_bneg #1% @@ -1587,7 +1624,7 @@ }% \def\XINT_divmod_divbyzero #1#2[#3]#4.% {% - \XINT_signalcondition{DivisionByZero}{Division by #2[#3] of #1#4}{}% + \XINT_signalcondition{DivisionByZero}{Division by zero: #1#4/(#2[#3]).}{}% {{0}{0/1[0]}}% à revoir... }% \def\XINT_divmod_aiszero #1.{{0}{0/1[0]}}% @@ -1921,7 +1958,7 @@ \krof #1% }% \def\XINT_inv_iszero #1]% - {\XINT_signalcondition{DivisionByZero}{Division of 1 by zero (#1])}{}{0/1[0]}}% + {\XINT_signalcondition{DivisionByZero}{Inverse of zero: inv(#1]).}{}{ 0/1[0]}}% \def\XINT_inv_a #1#2/#3[#4#5]% {% \xint_UDzerominusfork @@ -2578,16 +2615,24 @@ \def\XINT_fldiv_noopt #1#2\xint:#3% {% #1[\XINTdigits]% - {\expandafter\XINT_FL_div_a + {\expandafter\XINT_FL_div_aa \romannumeral0\XINTinfloatS[\XINTdigits]{#3}\XINTdigits.{#2}}% }% +\def\XINT_FL_div_aa #1% +{% + \xint_gob_til_zero#1\XINT_FL_div_Bzero0\XINT_FL_div_a #1% +}% +\def\XINT_FL_div_Bzero0\XINT_FL_div_a#1[#2]#3.#4% +{% + \XINT_signalcondition{DivisionByZero}{Division by zero (#1[#2]) of #4}{}{ 0[0]}% +}% \def\XINT_fldiv_opt #1[\xint:#2]%#3#4% {% \expandafter\XINT_fldiv_opt_a\the\numexpr #2.#1% }% \def\XINT_fldiv_opt_a #1.#2#3#4% {% - #2[#1]{\expandafter\XINT_FL_div_a\romannumeral0\XINTinfloatS[#1]{#4}#1.{#3}}% + #2[#1]{\expandafter\XINT_FL_div_aa\romannumeral0\XINTinfloatS[#1]{#4}#1.{#3}}% }% \def\XINT_FL_div_a #1[#2]#3.#4% {% @@ -2660,7 +2705,7 @@ {% #6{\if 1#51\xint_dothis {0[0]}\fi \xint_orthat - {\XINT_signalcondition{DivisionByZero}{0 to the power #4}{}{0[0]}}% + {\XINT_signalcondition{DivisionByZero}{0 raised to power -#4.}{}{ 0[0]}}% }% }% \def\XINT_flpow_b #1#2[#3]#4#5% @@ -2917,7 +2962,7 @@ \def\XINT_FL_fac_isneg #1.#2#3#4#5% {% #5{\XINT_signalcondition{InvalidOperation} - {Factorial of negative: (-#1)!}{}{0[0]}}% + {Factorial argument is negative: -#1.}{}{ 0[0]}}% }% \def\XINT_FL_fac_fork_b #1.% {% @@ -2931,7 +2976,7 @@ \def\XINT_FL_fac_toobig #1.#2#3#4#5% {% #5{\XINT_signalcondition{InvalidOperation} - {Factorial of too big: (#1)!}{}{0[0]}}% + {Factorial argument is too large: #1>=10^8.}{}{ 0[0]}}% }% \def\XINT_FL_fac_vbig {\expandafter\XINT_FL_fac_vbigloop_a @@ -3142,7 +3187,7 @@ \def\XINT_FL_pfac_outofrange #1.#2.#3#4#5% {% #5{\XINT_signalcondition{InvalidOperation} - {pfactorial second arg too big: 99999999 < #2}{}{0[0]}}% + {pFactorial with too large argument: #2 >= 10^8.}{}{ 0[0]}}% }% \def\XINT_FL_pfac_one #1.#2.#3#4#5{#5{1[0]}}% \def\XINT_FL_pfac_zero #1.#2.#3#4#5{#5{0[0]}}% @@ -3326,12 +3371,12 @@ \def\XINT_FL_binom_neg #1.#2.#3.#4.#5% {% #5[#4]{\XINT_signalcondition{InvalidOperation} - {binomial with first arg negative: #3}{}{0[0]}}% + {Binomial with negative argument: #3.}{}{ 0[0]}}% }% \def\XINT_FL_binom_toobig #1.#2.#3.#4.#5% {% #5[#4]{\XINT_signalcondition{InvalidOperation} - {binomial with first arg too big: 99999999 < #3}{}{0[0]}}% + {Binomial with too large argument: #3 >= 10^8.}{}{ 0[0]}}% }% \def\XINT_FL_binom_one #1.#2.#3.#4.#5{#5[#4]{1[0]}}% \def\XINT_FL_binom_zero #1.#2.#3.#4.#5{#5[#4]{0[0]}}% @@ -3385,7 +3430,7 @@ \def\XINT_FL_sqrt_isneg #1]#2.#3% {% #3[#2]{\XINT_signalcondition{InvalidOperation} - {Square root of negative: -#1]}{}{0[0]}}% + {Square root of negative: -#1].}{}{ 0[0]}}% }% \def\XINT_FL_sqrt_pos #1[#2]#3.% {% |