diff options
author | Karl Berry <karl@freefriends.org> | 2013-07-17 22:13:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-07-17 22:13:10 +0000 |
commit | eec0a21648f82e9f409ed8151e1bc83f34bfec79 (patch) | |
tree | dd59250c0f9496a72010ad5b1097e0199888f06f /Master/texmf-dist/tex | |
parent | d9add100de8f268f2b408533a41cc5624ef1ee7a (diff) |
minifp (17jul13)
git-svn-id: svn://tug.org/texlive/trunk@31221 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/minifp/mfpextra.tex | 416 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/minifp/minifp.sty | 268 |
2 files changed, 339 insertions, 345 deletions
diff --git a/Master/texmf-dist/tex/generic/minifp/mfpextra.tex b/Master/texmf-dist/tex/generic/minifp/mfpextra.tex index 2e9a6d88bf0..9d65d0ff1aa 100644 --- a/Master/texmf-dist/tex/generic/minifp/mfpextra.tex +++ b/Master/texmf-dist/tex/generic/minifp/mfpextra.tex @@ -21,6 +21,26 @@ %% is Daniel H. Luecking. The Base Interpreters associated %% with minifp are plain TeX and LaTeX. %% +\expandafter\ifx\csname MFP@xfinish\endcsname\relax +\else \expandafter\endinput\fi +\expandafter\edef\csname MFP@xfinish\endcsname{% + \catcode64=\the\catcode64 \space + \catcode46=\the\catcode46 \space + \catcode60=\the\catcode60 \space + \catcode62=\the\catcode62 \space}% +\catcode64=11 % @ +\catcode46=12 % . (period) +\catcode60=12 % < +\catcode62=12 % > +\ifx\MFP@Rextra\UndEfInEd \input minifp.sty \fi +\ifx\MFP@Rextra\@empty +\else + \immediate\write16{mfpextra.tex: already loaded.^^J}% + \MFP@xfinish + \expandafter\endinput +\fi +\immediate\write16{% + mfpextra.tex: extra operations for the MiniFP package.^^J}% \def\MFP@Rextra{% \def\Rcos {\MFP@stack@Unary\MFP@Rcos }% \def\Rsin {\MFP@stack@Unary\MFP@Rsin }% @@ -51,104 +71,110 @@ \def\LogOfZeroFrac{\MaxRealFrac}% \def\MFP@expoverflow@err{% \MFP@errmsg{Power too large}% - {The power you tried to calcualate is too large for % + {The power you tried to calculate is too large for % 8 digits. If you continue, ^^Jthe value assigned will be % \MaxRealInt.\MaxRealFrac.}}% -\def\MFP@sqrtofneg@err{% - \MFP@errmsg{square root of a negative number}% - {You tried to take the square root of a negative value. What % - were you thinking? If you continue, zero will be returned.}}% \def\MFP@badpower@err{% \MFP@errmsg{negative power of zero}% {You tried to take a negative power of zero. What were you thinking? If you ^^Jcontinue, the value assigned will be % \xOverZeroInt.\xOverZeroFrac.}}% +\def\MFPshowreg #1{% +\ifMFPdebug +\begingroup + \edef\theregister{% + #1 = \expandafter \MFP@Sign + \csname MFP@#1@Sgn\endcsname % + \csname MFP@#1@Int\endcsname.% + \csname MFP@#1@Frc\endcsname}% + \show\theregister +\endgroup +\fi}% \def\MFP@Rcopyz#1{\MFP@Rload {#1}\MFP@z@Sgn\MFP@z@Int\MFP@z@Frc}% \def\MFP@Rcopyzx{\MFP@Rcopyz x}% \def\MFP@Rcopyzy{\MFP@Rcopyz y}% -\def\MFP@Rdeg{% - \MFP@Rcopy xt\MFP@Rload y1{57}{29577951}\MFP@Rmul - \MFP@Rcopyz s\MFP@Rcopy tx\MFP@Rload y10{30823209}\MFP@Rmul - \MFP@tempa\MFP@z@Int\relax - \ifnum\MFP@z@Frc<50000000 \else \advance\MFP@tempa 1 \fi - \MFP@Rload x{\ifnum\MFP@tempa>0 \MFP@z@Sgn\else0\fi}0\MFP@tempa - \MFP@Rcopy sy\MFP@Radd}% -\def\MFP@Rrad{% - \MFP@Rcopy xt\MFP@Rload y10{0174 5329}\MFP@Rmul - \MFP@Rcopyz s\MFP@Rcopy tx\MFP@Rload y10{25199433}\MFP@Rmul - \MFP@tempa\MFP@z@Int\relax - \ifnum\MFP@z@Frc<50000000 \else \advance\MFP@tempa 1 \fi - \MFP@Rload x{\ifnum\MFP@tempa>0 \MFP@z@Sgn\else0\fi}0\MFP@tempa - \MFP@Rcopy sy\MFP@Radd}% -\def\MFP@Rcos{% - \MFP@Rcopy xy\MFP@Rload x1{90}0\MFP@Rsub - \MFP@Rcopyzx\MFP@Rsin}% -\def\MFP@Rsin{% - \ifnum \MFP@x@Sgn=0 % return 0 +\def\MFP@DPmul#1#2#3{% + \ifnum\MFP@x@Sgn=0 \MFP@Rzero \else - \MFP@tempa\MFP@x@Int\relax - \MFP@reduce@angle - \ifnum \MFP@tempa<180 - \edef\MFP@sin@Sgn{\MFP@x@Sgn}% - \else - \edef\MFP@sin@Sgn{\number-\MFP@x@Sgn}% - \advance \MFP@tempa-180 + \MFP@Rcopy xv% + \MFP@Rload y1{#1}{#2}\MFP@Rmul + \edef\MFP@w@Und{\MFP@z@Und}% + \ifnum\MFP@z@Frc@iii>4999 + \MFP@tempa\MFP@z@Frc \advance\MFP@tempa-1 + \edef\MFP@z@Frc{\number\MFP@tempa}% + \makeMFP@eightdigits\MFP@z@Frc \fi - \MFP@tempb\MFP@x@Frc\relax - \ifnum\MFP@tempa>0 - \MFP@@Rsin - \else\ifnum\MFP@tempb>0 - \MFP@@Rsin + \MFP@Rcopyz w% + \MFP@Rcopy vx\MFP@Rload y10{#3}\MFP@Rmul + \MFP@Rcopyzx\MFP@Rload y\MFP@v@Sgn 0{\MFP@w@Und}\MFP@Radd + \MFP@tempa\MFP@z@Int\relax + \ifnum\MFP@z@Frc<50000000 \else \advance\MFP@tempa 1 \fi + \ifnum\MFP@tempa<\MFP@ttteight\relax + \MFP@Rload x{\ifnum\MFP@tempa>0 \MFP@z@Sgn\else0\fi}0\MFP@tempa \else - \MFP@Rzero - \fi\fi + \MFP@Rload x\MFP@z@Sgn10% + \fi + \MFP@Rcopy wy\MFP@Radd \fi}% +\def\MFP@Rdeg{\MFP@DPmul{57}{29577951}{30823209}}% +\def\MFP@Rrad{\MFP@DPmul{0}{01745329}{25199433}}% +\def\MFP@RbaseX{\MFP@DPmul{0}{43429448}{19032518}}% +\def\MFP@RbaseE{\MFP@DPmul{2}{30258509}{29940457}}% +\def\MFP@Rcos{% + \MFP@Rcopy xy\MFP@Rload x1{90}0\MFP@Rsub + \MFP@Rcopyzx\MFP@Rsin}% +\def\MFP@Rsin{% + \MFP@tempa\MFP@x@Int + \MFP@tempb\MFP@x@Frc + \MFP@tempc\MFP@x@Sgn\relax + \MFP@reduce@angle + \ifnum\MFP@tempa>0 \MFP@@Rsin + \else\ifnum\MFP@tempb>0 \MFP@@Rsin + \else \MFP@Rzero + \fi\fi}% \def\MFP@reduce@angle{% - \ifnum\MFP@tempa<360 + \ifnum\MFP@tempa<180 \else - \advance\MFP@tempa-360 + \advance\MFP@tempa-180 + \MFP@tempc-\MFP@tempc \@xp\MFP@reduce@angle \fi}% \def\MFP@@Rsin{% \ifnum\MFP@tempa<90 \else + \MFP@tempa -\MFP@tempa \ifnum\MFP@tempb>0 - \advance\MFP@tempa 1 \MFP@tempb -\MFP@tempb \advance\MFP@tempb \MFP@ttteight\relax + \advance\MFP@tempa 179 + \else \advance\MFP@tempa 180 \fi - \MFP@tempa -\MFP@tempa - \advance\MFP@tempa 180 \fi \ifnum\MFP@tempa=90 - \MFP@Rloadz \MFP@sin@Sgn10% + \MFP@Rloadz \MFP@tempc10% \else \advance\MFP@tempb 50 \divide\MFP@tempb 100 \multiply\MFP@tempa 1000000 \advance\MFP@tempb\MFP@tempa \ifnum\MFP@tempb=0 \MFP@Rzero \else - \MFP@Rload x10\MFP@tempb - \MFP@Rcopy xs% + \MFP@Rload s\MFP@tempc0\MFP@tempb + \MFP@Rcopy sx% \MFP@Rsq \ifnum \MFP@z@Frc>0 \MFP@Rcopyz t\MFP@Rsin@prog \else \MFP@Rcopy sx% \fi - \MFP@Rload y11{74532925}\MFP@Rmul - \ifnum\MFP@z@Sgn=0 \else - \let\MFP@z@Sgn\MFP@sin@Sgn - \fi + \MFP@DPmul 1{74532925}{19943296}% \fi \fi}% \def\MFP@Rsin@prog{% - \MFP@Rcopy tx% - \MFP@Rload y10{00559959}\MFP@Rsmul\MFP@com@iter{01450559}% - \MFP@com@iter{01952675}\MFP@com@iter{02769249}\MFP@com@iter{04230797}% - \MFP@com@iter{07252796}\MFP@com@iter{15230871}\MFP@com@iter{50769570}% - \MFP@flipz \MFP@Rcopyzx \MFP@Rcopy sy\MFP@Rsmul \MFP@Rcopyzx}% + \MFP@Rcopy tx\MFP@Rload y10{01952676}\MFP@Rsmul% + \MFP@com@iter{02769249}\MFP@com@iter{04230797}\MFP@com@iter{07252796}% + \MFP@com@iter{15230871}\MFP@com@iter{50769570}\MFP@flipz \MFP@Rcopyzx + \MFP@Rcopy sy\MFP@Rsmul\MFP@Rcopyzx\edef\MFP@x@Sgn{\MFP@s@Sgn}}% \def\MFP@flipz{% \ifnum\MFP@z@Sgn=0 \MFP@Rloadz 110% @@ -161,16 +187,11 @@ \MFP@Rcopyzx\MFP@Rcopy ty\MFP@Rsmul \MFP@Rcopyzx\MFP@Rload y10{#1}\MFP@Rsmul}% \def\MFP@Rsmul{% - \ifnum \MFP@x@Sgn=0 - \MFP@Rzero - \else\ifnum \MFP@y@Sgn=0 - \MFP@Rzero - \else\ifnum\MFP@x@Int>0 - \MFP@Rcopy yz% - \else\ifnum\MFP@y@Int>0 - \MFP@Rcopy xz% - \else - \MFP@@Rsmul + \ifnum \MFP@x@Sgn=0 \MFP@Rzero + \else\ifnum \MFP@y@Sgn=0 \MFP@Rzero + \else\ifnum\MFP@x@Int>0 \MFP@Rcopy yz% + \else\ifnum\MFP@y@Int>0 \MFP@Rcopy xz% + \else \MFP@@Rsmul \fi\fi\fi\fi}% \def\MFP@@Rsmul{% \MFP@split\MFP@x@Frc\MFP@x@Frc@i\MFP@x@Frc@ii @@ -190,15 +211,11 @@ \advance\MFP@tempb1 \edef\MFP@z@Frc@ii{\number\MFP@tempb}\fi \MFP@carrym\MFP@z@Frc@ii\MFP@z@Frc@i - \makeMFP@fourdigits\MFP@z@Frc@iv - \makeMFP@fourdigits\MFP@z@Frc@iii \makeMFP@fourdigits\MFP@z@Frc@ii \makeMFP@fourdigits\MFP@z@Frc@i \def\MFP@z@Int{0}% \edef\MFP@z@Frc{\MFP@z@Frc@i\MFP@z@Frc@ii}% - \edef\MFP@z@Sgn{\ifnum\MFP@z@Frc=0 0\else 1\fi}% - \edef\MFP@z@Und{\MFP@z@Frc@iii\MFP@z@Frc@iv}% - \edef\MFP@z@Ovr{0}}% + \edef\MFP@z@Sgn{\ifnum\MFP@z@Frc=0 0\else 1\fi}}% \def\MFP@Rangle{% \ifcase\MFP@y@Sgn\relax \ifcase\MFP@x@Sgn\relax @@ -223,70 +240,72 @@ \def\MFP@x@Sgn{1}\MFP@@Rangle \MFP@Rcopyzy\MFP@Rload x1{180}0\MFP@Rsub \fi - \let\MFP@z@Sgn\MFP@angle@Sgn - }}% + \let\MFP@z@Sgn\MFP@angle@Sgn}}% \def\MFP@@Rangle{% \MFP@Rcmp \ifMFP@neg - \MFP@Rcopy xs\MFP@Rcopy yx\MFP@Rcopy sy% + \MFP@Rcopy xw\MFP@Rcopy yx\MFP@Rcopy wy% \MFP@@@Rangle \MFP@Rload x1{90}0\MFP@Rcopyzy\MFP@Rsub \else \MFP@@@Rangle - \fi -}% + \fi}% \def\MFP@Rquad{\MFP@Rdbl\MFP@Rcopyzx\MFP@Rdbl}% \def\MFP@@@Rangle{% \MFP@Rcopy xs\MFP@Rcopy yt% - \ifnum\MFP@y@Int<500000 + \ifnum\MFP@x@Int<1000000 \else - \MFP@Rload y1{200}0\MFP@Rdiv - \MFP@Rcopyz s\MFP@Rcopy tx% - \MFP@Rload y1{200}0\MFP@Rdiv - \MFP@Rcopyz t% + \MFP@RdivC \MFP@Rcopyz s% + \MFP@Rcopy tx\MFP@RdivC \MFP@Rcopyz t% \fi - \MFP@Rcopy tx\MFP@Rdbl\MFP@Rcopyzx\MFP@Rcopy sy\MFP@Rcmp - \ifMFP@pos - \MFP@Rsub\MFP@Rcopyz u\MFP@Rcopy sx\MFP@Rdbl - \MFP@Rcopyzx\MFP@Rcopy ty\MFP@Radd - \MFP@Rcopyz s\MFP@Rcopy ut% - \MFP@Rload a1{2656}{50511771}% + \ifnum\MFP@t@Sgn=0 \MFP@Rzero \else - \MFP@Rload a000% - \fi - \MFP@Rcopy tx\MFP@Rquad\MFP@Rcopyzx\MFP@Rcopy sy\MFP@Rcmp - \ifMFP@pos - \MFP@Rsub\MFP@Rcopyz u\MFP@Rcopy sx\MFP@Rquad - \MFP@Rcopyzx\MFP@Rcopy ty\MFP@Radd - \MFP@Rcopyz s\MFP@Rcopy ut% - \MFP@Rcopy ax\MFP@Rload y1{1403}{62434679}% - \MFP@Radd\MFP@Rcopy za% - \fi - \MFP@Rcopy tx\MFP@RmulC - \MFP@Rcopyzx\MFP@Rcopy sy\MFP@Rdiv - \MFP@Rcopyzx\MFP@Ratanc - \MFP@Rcopyzx\MFP@Rdeg - \MFP@Rcopyzx\MFP@Rcopy ay\MFP@Radd - \MFP@Rcopyzx\MFP@RdivC}% + \MFP@Rcopy tx\MFP@Rdbl\MFP@Rcopyzx\MFP@Rcopy sy\MFP@Rcmp + \ifMFP@pos + \MFP@Rsub\MFP@Rcopyz u\MFP@Rcopy sx\MFP@Rdbl + \MFP@Rcopyzx\MFP@Rcopy ty\MFP@Radd + \MFP@Rcopyz s\MFP@Rcopy ut% + \MFP@Rload a1{2656}{50511771}% + \else + \MFP@Rload a000% + \fi + \MFP@Rcopy tx\MFP@Rquad\MFP@Rcopyzx\MFP@Rcopy sy\MFP@Rcmp + \ifMFP@pos + \MFP@Rsub\MFP@Rcopyz u\MFP@Rcopy sx\MFP@Rquad + \MFP@Rcopyzx\MFP@Rcopy ty\MFP@Radd + \MFP@Rcopyz s\MFP@Rcopy ut% + \MFP@Rcopy ax\MFP@Rload y1{1403}{62434679}% + \MFP@Radd\MFP@Rcopy za% + \fi + \MFP@Rcopy tx\MFP@RmulC + \MFP@Rcopyzx\MFP@Rcopy sy\MFP@Rdiv + \MFP@Rcopyzx\MFP@Ratanc + \MFP@Rcopyzx\MFP@Rdeg + \MFP@Rcopyzx\MFP@Rcopy ay\MFP@Radd + \MFP@Rcopyzx\MFP@RdivC + \fi}% +\def\MFP@twoofmany#1#2#3\MFP@end{#1#2}% +\def\MFP@gobbletwo#1#2{}% \def\MFP@RmulC{% - \makeMFP@eightdigits\MFP@x@Frc - \edef\MFP@Tmp{\number\MFP@x@Int.\MFP@x@Frc}% - \@xp\MFP@@RmulC\MFP@Tmp\mfp@end}% -\def\MFP@@RmulC#1.#2#3#4\mfp@end{% - \MFP@Rloadz\MFP@x@Sgn{#1#2#3}{#400}}% + \edef\MFP@z@Int{\MFP@x@Int\@xp\MFP@twoofmany\MFP@x@Frc\MFP@end}% + \edef\MFP@z@Frc{\@xp\MFP@gobbletwo\MFP@x@Frc00}% + \edef\MFP@z@Sgn{\MFP@x@Sgn}}% \def\MFP@RdivC{% \makeMFP@eightdigits\MFP@x@Int \makeMFP@eightdigits\MFP@x@Frc - \@XP\MFP@@RdivC\@xp\MFP@x@Int\MFP@x@Frc\mfp@end}% + \@XP\MFP@@RdivC\@xp\MFP@x@Int\MFP@x@Frc\MFP@end}% \def\MFP@@RdivC#1#2#3#4#5#6{% \edef\MFP@z@Int{\number#1#2#3#4#5#6}% \MFP@@@RdivC}% -\def\MFP@@@RdivC#1#2#3#4#5#6#7#8#9\mfp@end{% +\def\MFP@@@RdivC#1#2#3#4#5#6#7#8#9\MFP@end{% \MFP@tempa#1#2#3#4#5#6#7#8\relax \ifnum#9>49 \advance\MFP@tempa1 \fi + \edef\MFP@z@Frc{\number\MFP@tempa}% + \makeMFP@eightdigits\MFP@z@Frc \edef\MFP@z@Sgn{\MFP@x@Sgn}% - \ifnum\MFP@tempa=0 \ifnum\MFP@x@Int=0 \def\MFP@z@Sgn{0}\fi\fi - \MFP@Rloadz\MFP@z@Sgn\MFP@z@Int\MFP@tempa}% + \ifnum\MFP@tempa=0 + \ifnum\MFP@z@Int=0 \def\MFP@z@Sgn{0}\fi + \fi}% \def\MFP@scaledmul{\MFP@Rmul\MFP@Rcopyzx\MFP@RdivC}% \def\MFP@atan@iter#1#2{% \MFP@Rcopy uy\MFP@scaledmul @@ -294,82 +313,80 @@ \MFP@Rcopyzy\MFP@Rload x1{100}{00000000}% \MFP@Rsub\MFP@Rcopyzx}% \def\MFP@Ratanc{% - \MFP@Rcopy xs% - \MFP@Rcopy xy\MFP@scaledmul\MFP@Rcopyz u% - \MFP@Rcopyzx\MFP@Rload y1{86}{66666667}% - \MFP@scaledmul - \MFP@Rcopyzy\MFP@Rload x1{100}{00000000}% - \MFP@Rsub\MFP@Rcopyzx - \MFP@atan@iter{84}{61538462}\MFP@atan@iter{81}{81818182}% - \MFP@atan@iter{77}{77777778}\MFP@atan@iter{71}{42857143}% - \MFP@atan@iter{60}{00000000}\MFP@atan@iter{33}{33333333}% - \MFP@Rcopy sy\MFP@scaledmul}% -\def\MFP@Rlog{% + \MFP@Rcopy xs\MFP@Rcopy xy\MFP@scaledmul + \ifnum \MFP@z@Sgn=0 + \MFP@Rcopy sz% + \else + \MFP@Rcopyz u\MFP@Rcopyzx + \MFP@Rload y1{86}{66666667}\MFP@scaledmul + \MFP@Rcopyzy\MFP@Rload x1{100}{00000000}\MFP@Rsub\MFP@Rcopyzx + \MFP@atan@iter{84}{61538462}\MFP@atan@iter{81}{81818182}% + \MFP@atan@iter{77}{77777778}\MFP@atan@iter{71}{42857143}% + \MFP@atan@iter{60}{00000000}\MFP@atan@iter{33}{33333333}% + \MFP@Rcopy sy\MFP@scaledmul + \fi}% +\newif\ifMFP@natural +\def\MFP@Rlog{\MFP@naturalfalse\MFP@Rlog@}% +\def\MFP@Rln{\MFP@naturaltrue\MFP@Rlog@}% +\def\MFP@Rlog@{% \ifnum\MFP@x@Sgn=0 \MFP@logofzero@err \MFP@Rloadz{-1}\LogOfZeroInt\LogOfZeroFrac \else \ifnum \MFP@x@Sgn<0 - \MFP@warn{The logarithm of a negative number is complex.% + \MFP@warn{The logarithm of a negative number is complex. \MFP@msgbreak Only the real part will be computed}% + \def\MFP@x@Sgn{1}% \fi \MFP@Rload s000% \ifnum \MFP@x@Int=0 \edef\MFP@x@Tmp{\number\MFP@x@Frc}% - \MFP@tempa=\MFP@numzeros\MFP@x@Tmp\relax + \MFP@tempa=\MFP@numshiftL\MFP@x@Tmp\relax \def\MFP@s@Sgn{-1}% - \edef\MFP@t@Int{\@xp\MFP@firstofmany\MFP@x@Tmp\mfp@end}% + \edef\MFP@t@Int{\@xp\MFP@oneofmany\MFP@x@Tmp\MFP@end}% \edef\MFP@t@Frc{\@xp\@gobble\MFP@x@Tmp0}% - \MFPpadto@eight\MFP@t@Frc + \MFP@padtoeight\MFP@t@Frc \else - \MFP@tempa\MFP@numdigits\MFP@x@Int - \edef\MFP@x@Tmp{\MFP@x@Int\MFP@x@Frc}% gather all digits - \edef\MFP@s@Sgn{1}% - \edef\MFP@t@Int{\@xp\MFP@firstofmany\MFP@x@Tmp\mfp@end}% + \MFP@tempa\MFP@numshiftR\MFP@x@Int + \edef\MFP@x@Tmp{\MFP@x@Int\MFP@x@Frc}% + \ifnum\MFP@tempa>0 \def\MFP@s@Sgn{1}\fi + \edef\MFP@t@Int{\@xp\MFP@oneofmany\MFP@x@Tmp\MFP@end}% \edef\MFP@x@Tmp{\@xp\@gobble\MFP@x@Tmp}% - \edef\MFP@t@Frc{\@xp\MFP@firsteightofmany\MFP@x@Tmp\mfp@end}% + \edef\MFP@t@Frc{\@xp\MFP@eightofmany\MFP@x@Tmp\MFP@end}% \fi \edef\MFP@s@Int{\number\MFP@tempa}% \def\MFP@t@Sgn{1}% \MFP@Rlog@reduce + \ifMFP@natural \MFP@Rcopy sx\MFP@RbaseE \MFP@Rcopy zs\fi \ifnum\MFP@t@Frc=0 \MFP@Rcopy sz% \else - \MFP@Rlog@prog + \def\MFP@t@Int{0}\MFP@Rlog@prog + \ifMFP@natural\else \MFP@Rcopyzx \MFP@RbaseX \fi + \MFP@Rcopy sy\MFP@Rcopyzx\MFP@Radd \fi \fi}% -\def\showreg #1{% for debugging -\begingroup - \edef\reg{% - #1 = (\csname MFP@#1@Sgn\endcsname)% - \csname MFP@#1@Int\endcsname.% - \csname MFP@#1@Frc\endcsname}% - \show\reg -\endgroup}% -\def\MFP@numdigits#1{\@xp\MFP@ninthofmany#176543210\mfp@end}% -\def\MFP@numzeros#1{% - \@xp\MFP@ninthofmany#112345678\mfp@end}% +\def\MFP@numshiftR#1{\@xp\MFP@ninthofmany#176543210\MFP@end}% +\def\MFP@numshiftL#1{\@xp\MFP@ninthofmany#112345678\MFP@end}% \def\MFP@Rlog@reduce{% - \MFP@reduceonce 3{16227766}{31622777}{50000000}% - \MFP@reduceonce 1{77827941}{56234133}{25000000}% - \MFP@reduceonce 1{33352143}{74989421}{12500000}% - \MFP@reduceonce 1{15478198}{86596433}{06250000}}% + \MFP@Rcopy tx\MFP@RmulC\MFP@Rcopyz t% + \MFP@reduceonce {316}{31622776}{60168379}{50000000}% + \MFP@reduceonce {177}{56234132}{51903491}{25000000}% + \MFP@reduceonce {133}{74989420}{93324558}{12500000}% + \MFP@reduceonce {115}{86596432}{33600654}{06250000}% + \MFP@Rcopy tx\MFP@RdivC\MFP@Rcopyz t}% \def\MFP@reduceonce#1#2#3#4{% - \MFP@Rcopy tx\MFP@Rload y1{#1}{#2}\MFP@Rcmp - \ifMFP@neg\else - \MFP@Rload y10{#3}\MFP@Rmul - \MFP@Rcopyz t\MFP@Rcopy sx\MFP@Rload y10{#4}\MFP@Radd + \ifnum\MFP@t@Int>#1\relax + \MFP@Rcopy tx% + \MFP@DPmul 0{#2}{#3}\MFP@Rcopyz t% + \MFP@Rcopy sx\MFP@Rload y10{#4}\MFP@Radd \MFP@Rcopyz s% \fi}% \def\MFP@Rlog@prog{% - \MFP@Rcopy tx\MFP@Rdecr - \MFP@Rcopyz t% - \MFP@Rcopyzx\MFP@Rload y10{43750000}\MFP@Rsmul - \MFP@com@iter{85714286}\MFP@com@iter{83333333}\MFP@com@iter{80000000}% - \MFP@com@iter{75000000}\MFP@com@iter{66666667}\MFP@com@iter{50000000}% - \MFP@com@iter{43429448}\MFP@Rcopyzx\MFP@Rcopy sy\MFP@Radd}% -\def\MFP@Rln{% - \MFP@Rlog\MFP@Rcopyzx\MFP@Rload y12{30258509}\MFP@Rmul}% + \MFP@Rcopy tx\MFP@Rload y10{88888889}\MFP@Rsmul + \MFP@com@iter{87500000}\MFP@com@iter{85714286}\MFP@com@iter{83333333}% + \MFP@com@iter{80000000}\MFP@com@iter{75000000}\MFP@com@iter{66666667}% + \MFP@com@iter{50000000}\MFP@flipz\MFP@Rcopyzx\MFP@Rcopy ty\MFP@Rsmul}% \def\MFP@Rexp{% \ifcase\MFP@x@Sgn\relax \MFP@Rloadz 110% @@ -381,10 +398,10 @@ \fi}% \def\MFP@Rexp@pos{% \MFP@Rload y1{18}{42068074}\MFP@Rcmp - \ifMFP@pos % overflow + \ifMFP@pos \MFP@expoverflow@err \MFP@Rloadz 1\MaxRealInt\MaxRealFrac - \else % handle integer part + \else \MFP@tempa\MFP@x@Int \edef\MFP@powerof@e{% 1\ifcase\MFP@tempa @@ -412,7 +429,7 @@ \ifnum\MFP@x@Frc=0 \else \MFP@Rcopyz s% - \MFP@tempa=\@xp\MFP@firstofmany\MFP@x@Frc\mfp@end + \MFP@tempa=\@xp\MFP@oneofmany\MFP@x@Frc\MFP@end \edef\MFP@powerof@e{% y1\ifcase\MFP@tempa 10\or @@ -429,7 +446,7 @@ \edef\MFP@t@Frc{0\@xp\@gobble\MFP@x@Frc}% \MFP@Rcopy sx\@xp\MFP@Rload\MFP@powerof@e\MFP@Rmul \ifnum\MFP@t@Frc=0 - \else % handle the rest + \else \MFP@Rcopyz s\MFP@Rload t10\MFP@t@Frc \MFP@Rexp@pos@prog \MFP@Rcopy sx\MFP@Rcopyzy\MFP@Rmul @@ -437,9 +454,10 @@ \fi \fi}% \def\MFP@Rexp@pos@prog{% - \MFP@Rcopy tz\MFP@Rexp@iter{16666667}\MFP@Rexp@iter{20000000}% - \MFP@Rexp@iter{25000000}\MFP@Rexp@iter{33333333}% - \MFP@Rexp@iter{50000000}\MFP@Rcopyzx\MFP@Rincr}% + \MFP@Rcopy tz\MFP@Rexp@iter{14285714}\MFP@Rexp@iter{16666667}% + \MFP@Rexp@iter{20000000}\MFP@Rexp@iter{25000000}% + \MFP@Rexp@iter{33333333}\MFP@Rexp@iter{50000000}\MFP@Rcopyzx + \MFP@Rincr}% \def\MFP@Rexp@iter#1{% \MFP@Rcopyzx\MFP@Rload y10{#1}\MFP@Rsmul \MFP@Rcopyzx\MFP@Rcopy ty\MFP@Rsmul @@ -449,7 +467,7 @@ \MFP@Rcmp \ifMFP@pos \MFP@Rloadz 000% - \else % handle integer part + \else \MFP@tempa\MFP@x@Int \edef\MFP@powerof@e{% \ifcase\MFP@tempa @@ -476,9 +494,9 @@ 000\fi}% \@xp\MFP@Rloadz\MFP@powerof@e \ifnum\MFP@x@Frc=0 - \else % handle first decimal digit + \else \MFP@Rcopyz s% - \MFP@tempa=\@xp\MFP@firstofmany\MFP@x@Frc\mfp@end + \MFP@tempa=\@xp\MFP@oneofmany\MFP@x@Frc\MFP@end \edef\MFP@powerof@e{% y1\ifcase\MFP@tempa 10\or @@ -495,18 +513,19 @@ \edef\MFP@t@Frc{0\@xp\@gobble\MFP@x@Frc}% \MFP@Rcopy sx\@xp\MFP@Rload\MFP@powerof@e\MFP@Rmul \ifnum\MFP@t@Frc=0 - \else % handle the rest + \else \MFP@Rcopyz s\MFP@Rload t10\MFP@t@Frc \MFP@Rexp@neg@prog - \MFP@Rcopy sx\MFP@Rcopyzy\MFP@Rmul + \MFP@Rcopyzx\MFP@Rcopy sy\MFP@Rmul \fi \fi \fi}% \def\MFP@Rexp@neg@prog{% - \MFP@Rcopy tx\MFP@Rload y10{16666667}\MFP@Rsmul - \MFP@com@iter{20000000}\MFP@com@iter{25000000}% - \MFP@com@iter{33333333}\MFP@com@iter{50000000}% - \MFP@flipz\MFP@Rcopyzx\MFP@Rcopy ty\MFP@Rsmul\MFP@flipz}% + \MFP@Rcopy tx\MFP@Rload y10{14285712}\MFP@Rsmul + \MFP@com@iter{16666667}\MFP@com@iter{20000000}% + \MFP@com@iter{25000000}\MFP@com@iter{33333333}% + \MFP@com@iter{50000000}\MFP@flipz\MFP@Rcopyzx + \MFP@Rcopy ty\MFP@Rsmul\MFP@flipz}% \def\MFP@Rpow{% \ifnum\MFP@y@Frc>0 \MFP@warn{The "pow" function requires an integer power. @@ -523,30 +542,23 @@ \MFP@badpower@err \MFP@Rloadz 1\xOverZeroInt\xOverZeroFrac \fi - \else % integer power of nonzero number - % get the sign in case an overflow interrupts the calculations. + \else \ifnum\MFP@x@Sgn>0 \def\MFP@power@Sgn{1}% \else \edef\MFP@power@Sgn{\ifodd\MFP@loopctr -\fi 1}% -\ifMFPdebug - \show\MFP@power@Sgn -\fi \fi \ifnum\MFP@y@Sgn<0 \MFP@Rinv \MFP@Rcopyzx\fi \ifnum\MFP@loopctr=1 \MFP@Rloadz \MFP@power@Sgn\MFP@x@Int\MFP@x@Frc \else \MFP@@Rpow -\ifMFPdebug - \showreg z% -\fi \fi \fi - \fi}% % + \fi}% \def\MFP@@Rpow{% - \MFP@Rcopy xq% initialize register to be squared - \MFP@Rload p110% initialize register to hold partial products + \MFP@Rcopy xq% + \MFP@Rload p110% \MFP@Rpow@loop}% \def\MFP@Rpow@loop{% \ifodd\MFP@loopctr @@ -568,32 +580,40 @@ \def\MFP@handle@expoverflow{% \MFP@expoverflow@err \MFP@loopctr=0 - \MFP@Rloadz\MFP@power@Sgn\MaxRealInt\MaxRealFrac -}% + \MFP@Rloadz\MFP@power@Sgn\MaxRealInt\MaxRealFrac}% \def\MFP@Rsqrt{% \ifcase\MFP@x@Sgn\relax \MFP@Rzero \or \ifnum\MFP@x@Int=0 - \let\MFP@sqrt@reduce=Y% + \def\MFP@sqrt@reduce{2}% \edef\MFP@x@Int{\number\MFP@x@Frc}% \edef\MFP@x@Frc{00000000}% + \else\ifnum\MFP@x@Int<10000 + \def\MFP@sqrt@reduce{1}% + \edef\MFP@x@Int{\MFP@x@Int\@xp\MFP@fourofmany\MFP@x@Frc\MFP@end}% + \edef\MFP@x@Frc{\@xp\MFP@gobblefour\MFP@x@Frc0000}% \else - \let\MFP@sqrt@reduce=N% - \fi + \def\MFP@sqrt@reduce{0}% + \fi\fi \MFP@Rcopy xt% \MFP@Isqrt \MFP@Rcopyz s\MFP@Rcopyzy \MFP@Rcopy tx\MFP@Rdiv \MFP@Rcopy sx\MFP@Rcopyzy\MFP@Radd \MFP@Rcopyzx\MFP@Rhalve - \ifx Y\MFP@sqrt@reduce - \MFP@Rcopyzx\MFP@Rload y10{10000}\MFP@Rmul + \ifcase \MFP@sqrt@reduce\relax + \or + \MFP@Rcopyzx\MFP@Rload y10{01000000}\MFP@Rmul + \or + \MFP@Rcopyzx\MFP@Rload y10{00010000}\MFP@Rmul \fi \else - \MFP@sqrtofneg@err + \MFP@warn{Square root of a negative number. Zero will be returned.}% \MFP@Rzero \fi}% +\def\MFP@fourofmany#1#2#3#4#5\MFP@end{#1#2#3#4}% +\def\MFP@gobblefour#1#2#3#4{}% \def\MFP@ItoQ#1#2{% \MFP@tempa#1\relax\MFP@tempb#2\relax \def\MFP@ItoQ@Tmp{}\MFP@ItoQ@loop}% @@ -617,7 +637,7 @@ \def\MFP@Isqrt{% \MFP@ItoQ\MFP@x@Int\MFP@x@Frc \MFP@tempa=0 \MFP@tempb=0 \MFP@tempc=0 - \expandafter\MFP@Isqrt@loop\MFP@ItoQ@Tmp\mfp@end + \expandafter\MFP@Isqrt@loop\MFP@ItoQ@Tmp\MFP@end \MFP@tempa=\MFP@tempc \divide\MFP@tempc\MFP@tttfour \edef\MFP@z@Int{\number\MFP@tempc}% @@ -628,7 +648,7 @@ \edef\MFP@z@Frc{\MFP@z@Frc0000}% \def\MFP@z@Sgn{1}}% \def\MFP@Isqrt@loop#1{% - \ifx\mfp@end #1% + \ifx\MFP@end #1% \else \multiply\MFP@tempa 2 \multiply\MFP@tempb 4 \multiply\MFP@tempc 2 \advance \MFP@tempb#1\relax @@ -638,8 +658,8 @@ \advance\MFP@tempa 1 \fi \expandafter\MFP@Isqrt@loop - \fi -}% + \fi}% +\MFP@xfinish \endinput %% %% End of file `mfpextra.tex'. diff --git a/Master/texmf-dist/tex/generic/minifp/minifp.sty b/Master/texmf-dist/tex/generic/minifp/minifp.sty index 321ec4197f1..0566ae33e1e 100644 --- a/Master/texmf-dist/tex/generic/minifp/minifp.sty +++ b/Master/texmf-dist/tex/generic/minifp/minifp.sty @@ -21,16 +21,16 @@ %% is Daniel H. Luecking. The Base Interpreters associated %% with minifp are plain TeX and LaTeX. %% -\def\MFPfiledate{2013/02/01}% -\def\MFPfileversion{0.92}% +\def\MFPfiledate{2013/05/28}% +\def\MFPfileversion{0.95}% \expandafter \ifx \csname MFP@finish\endcsname\relax \else \expandafter\endinput \fi \expandafter\edef\csname MFP@finish\endcsname{% - \catcode64=\the\catcode64 \space % @ - \catcode46=\the\catcode46 \space % . - \catcode60=\the\catcode60 \space % < - \catcode62=\the\catcode62 \space}% > + \catcode64=\the\catcode64 \space + \catcode46=\the\catcode46 \space + \catcode60=\the\catcode60 \space + \catcode62=\the\catcode62 \space}% \ifx\ProvidesPackage\UndEfInEd \newlinechar`\^^J% \message{% @@ -44,28 +44,22 @@ \DeclareOption{extra}{\def\MFPextra{}}% \ProcessOptions\relax \fi -\catcode64=11 % @=letter (already is in LaTeX) +\catcode64=11 \ifx\MFPextra\UndEfInEd \def\MFP@loadextra{}% \else \def\MFP@loadextra{\input mfpextra\relax}% \fi -\def\MFPloadextra{% - \edef\MFP@load@extra{% - \catcode46=12 \catcode60=12 \catcode62=12 \catcode64=11 - \noexpand\input mfpextra\relax - \catcode46=\the\catcode46\relax\catcode60=\the\catcode60\relax - \catcode62=\the\catcode62\relax\catcode64=\the\catcode64\relax}% - \MFP@load@extra}% -\catcode46=12 % . -\catcode60=12 % < -\catcode62=12 % > -\long\def\gobbleto@mfp@end#1\mfp@end{}% -\ifx\mfp@end\UndEfInEd\def\mfp@end{\@empty}\fi +\def\MFPloadextra{\input mfpextra\relax}% +\catcode46=12 +\catcode60=12 +\catcode62=12 +\long\def\gobbleto@MFP@end#1\MFP@end{}% +\def\MFP@end{\@empty}% \ifx\documentclass\UndEfInEd \def\MFP@ifnoLaTeX{}% \else - \let\MFP@ifnoLaTeX\gobbleto@mfp@end + \let\MFP@ifnoLaTeX\gobbleto@MFP@end \fi \let\@xp\expandafter \def\@XP{\@xp\@xp\@xp}% @@ -97,13 +91,13 @@ \long\def\@firstofone #1{#1}% \long\def\@firstoftwo #1#2{#1}% \long\def\@secondoftwo#1#2{#2}% -\mfp@end +\MFP@end \def\MFP@tttfour {10000}% ttt = Ten To The \def\MFP@ttteight{100000000}% -\def\MFP@firstofmany#1#2\mfp@end{#1}% -\def\MFP@fifthofmany#1#2#3#4#5#6\mfp@end{#5}% -\def\MFP@ninthofmany#1#2#3#4#5#6#7#8{\MFP@firstofmany}% -\def\MFP@firsteightofmany#1#2#3#4#5#6#7#8#9\mfp@end{#1#2#3#4#5#6#7#8}% +\def\MFP@oneofmany#1#2\MFP@end{#1}% +\def\MFP@fifthofmany#1#2#3#4#5#6\MFP@end{#5}% +\def\MFP@ninthofmany#1#2#3#4#5#6#7#8{\MFP@oneofmany}% +\def\MFP@eightofmany#1#2#3#4#5#6#7#8#9\MFP@end{#1#2#3#4#5#6#7#8}% \let\MFP@eos\relax \def\MFP@EOS{\MFP@eos}% \def\MFP@initRstack{\def\MFP@Rstack{\MFP@eos}}% @@ -116,22 +110,19 @@ \countdef \MFP@tempf 10 \newcount \MFP@loopctr \def\MFP@endgroup@after#1{\edef\x{\endgroup#1}\x}% -\def\MFP@endgroup@return{\MFP@endgroup@after\MFP@returned@values}% -\def\MFP@def@after{\def\noexpand}% +\def\MFP@afterdef{\def\noexpand}% \def\MFP@returned@values{% - \MFP@def@after\MFP@z@Val{\MFP@z@Sign\MFP@z@Int.\MFP@z@Frc}% - \MFP@def@after\MFP@z@Ovr{\MFP@z@Ovr}% - \MFP@def@after\MFP@z@Und{\MFP@z@Und}% - \MFP@def@after\MFPcurr@Sgn{\MFP@z@Sgn}}% + \MFP@afterdef\MFP@z@Val{\MFP@z@Sign\MFP@z@Int.\MFP@z@Frc}% + \MFP@afterdef\MFP@z@Ovr{\MFP@z@Ovr}% + \MFP@afterdef\MFP@z@Und{\MFP@z@Und}% + \MFP@afterdef\MFPcurr@Sgn{\MFP@z@Sgn}}% \def\MFP@subroutine#1{% \begingroup - \MFP@basic@init@z + \MFP@Rzero + \def\MFP@z@Ovr{0}% + \def\MFP@z@Und{0}% #1% - \MFP@endgroup@return}% -\def\MFP@basic@init@z{% - \MFP@Rzero - \def\MFP@z@Ovr{0}% - \def\MFP@z@Und{0}}% + \MFP@endgroup@after\MFP@returned@values}% \def\MFP@Rzero{% \def\MFP@z@Sgn{0}% \def\MFP@z@Int{0}% @@ -170,28 +161,24 @@ \def\MFPparse@real#1#2#3#4{% \MFPnospace@def\MFPtemp@Val{#4}% \MFPprocess@into@parts\MFPtemp@Val#1#2#3% - \MFPpadto@eight#3}% + \MFP@padtoeight#3}% \def\MFPparse@x{\MFPparse@real\MFP@x@Sgn\MFP@x@Int\MFP@x@Frc}% \def\MFPparse@y{\MFPparse@real\MFP@y@Sgn\MFP@y@Int\MFP@y@Frc}% \def\MFPnospace@def#1#2{% \edef#1{#2\space}\edef#1{\@xp\zap@space#1\@empty}}% \def\MFPprocess@into@parts#1#2#3#4{% - \@xp\MFPsplit@dot#1..\mfp@end #3#4% - \ifnum#31<0 - \def#2{-1}% - \else - \def#2{1}% + \@xp\MFPsplit@dot#1..\MFP@end #3#4% + \ifnum#31<0 \def#2{-1}% + \else \def#2{1}% \fi \ifnum #30=0 \def#3{0}% - \ifnum 0#4=0 - \def#2{0}% - \fi + \ifnum 0#4=0 \def#2{0}\fi \fi \edef#3{\number \ifnum #2<0 -\fi#3}}% -\def\MFPsplit@dot#1.#2.#3\mfp@end#4#5{\edef#4{#1}\edef#5{#2}}% -\def\MFPpadto@eight#1{% - \edef#1{\@xp\MFP@firsteightofmany#100000000\mfp@end}}% +\def\MFPsplit@dot#1.#2.#3\MFP@end#4#5{\edef#4{#1}\edef#5{#2}}% +\def\MFP@padtoeight#1{% + \edef#1{\@xp\MFP@eightofmany#100000000\MFP@end}}% \def\MFPgetoperand@x{\Rpop\MFP@x@Val \MFPprocess@into@parts\MFP@x@Val\MFP@x@Sgn\MFP@x@Int\MFP@x@Frc}% \def\MFPgetoperand@y{\Rpop\MFP@y@Val @@ -211,8 +198,8 @@ \@xp\@secondoftwo \fi}% \def\MFP@popit{\if@EndofStack\doMFP@EOS\doMFP@popit}% -\def\doMFP@EOS#1\mfp@end#2{\MFP@popempty@err\let#2\EndofStack}% -\def\doMFP@popit#1#2\mfp@end#3{\edef\MFP@Rstack{#2}\edef#3{#1}}% +\def\doMFP@EOS#1\MFP@end#2{\MFP@popempty@err\let#2\EndofStack}% +\def\doMFP@popit#1#2\MFP@end#3{\edef\MFP@Rstack{#2}\edef#3{#1}}% \def\MFPchk#1{% \MFPparse@x{#1}% \MFP@Rchk\MFP@x@Sgn}% @@ -267,8 +254,8 @@ \def\Rmax {\MFP@stack@Binary\MFP@Rmax}% \let\Rnoop\relax \def\Rcmp{% - \MFPgetoperand@y\MFPgetoperand@x % get operands (last pushed is y) - \MFP@Rcat\MFP@x@Val\MFP@Rcat\MFP@y@Val % put back: LOFI + \MFPgetoperand@y\MFPgetoperand@x + \MFP@Rcat\MFP@x@Val\MFP@Rcat\MFP@y@Val \MFP@Rcmp}% \def\Rchk{% \MFPgetoperand@x @@ -279,7 +266,7 @@ \edef\MFP@z@Val{\MFP@x@Sign\MFP@x@Int.\MFP@x@Frc}% \edef\MFPcurr@Sgn{\MFP@x@Sgn}% \MFPpush@result}% - \def\Rpop{\@xp\MFP@popit\MFP@Rstack\mfp@end}% + \def\Rpop{\@xp\MFP@popit\MFP@Rstack\MFP@end}% \def\Rexch{% \Rpop\MFP@x@Val\Rpop\MFP@y@Val \MFP@Rcattwo\MFP@y@Val\MFP@x@Val}% @@ -316,6 +303,10 @@ \def\MFPdiv{\MFP@op@Binary\MFP@Rdiv}% \def\MFPmin{\MFP@op@Binary\MFP@Rmin}% \def\MFPmax{\MFP@op@Binary\MFP@Rmax}% +\def\MFP@stack@Nullary#1{% + \MFP@subroutine{#1}\MFPpush@result}% +\def\MFP@op@Nullary#1{% + \MFP@subroutine{#1}\MFPstore@result}% \def\MFP@stack@Unary#1{% \MFPgetoperand@x \MFP@subroutine{#1}\MFPpush@result}% @@ -339,7 +330,7 @@ \MFP@tempb\MFP@x@Frc\relax \ifodd\MFP@tempb \def\MFP@z@Und{5}% - \advance\MFP@tempb 1 % round up + \advance\MFP@tempb 1 \ifnum\MFP@ttteight=\MFP@tempb \MFP@tempb0 \advance\MFP@tempa1 \fi @@ -379,17 +370,17 @@ \edef\MFP@x@Sgn{\number -\MFP@x@Sgn}\MFP@Rincr \edef\MFP@z@Sgn{\number -\MFP@z@Sgn}}% \def\MFP@Rstore{\MFP@Rcopy xz}% -\def\MFP@Rfloororceil#1{% +\def\MFP@Rfloorceil#1{% \MFP@tempa\MFP@x@Int\relax - \ifnum 0#1\MFP@x@Sgn + \ifnum \MFP@x@Sgn #10 \ifnum\MFP@x@Frc=0 \else \advance\MFP@tempa1 \fi \fi \MFP@Rloadz{\ifnum\MFP@x@Int=0 0\else\MFP@x@Sgn\fi}\MFP@tempa0}% -\def\MFP@Rfloor{\MFP@Rfloororceil>}% -\def\MFP@Rceil {\MFP@Rfloororceil<}% +\def\MFP@Rfloor{\MFP@Rfloorceil<}% +\def\MFP@Rceil {\MFP@Rfloorceil>}% \def\MFP@split#1#2#3{% \begingroup \MFP@tempa#1\relax @@ -399,38 +390,27 @@ \multiply\MFP@tempb by\MFP@tttfour \advance\MFP@tempa-\MFP@tempb \MFP@endgroup@after{% - \MFP@def@after#2{#2}% - \MFP@def@after#3{\number\MFP@tempa}% + \MFP@afterdef#2{#2}% + \MFP@afterdef#3{\number\MFP@tempa}% }}% -\def\MFP@x@split{% +\def\MFP@@split{% \MFP@split\MFP@x@Int\MFP@x@Int@ii\MFP@x@Int@i - \MFP@split\MFP@x@Frc\MFP@x@Frc@i\MFP@x@Frc@ii}% -\def\MFP@y@split{% + \MFP@split\MFP@x@Frc\MFP@x@Frc@i\MFP@x@Frc@ii \MFP@split\MFP@y@Int\MFP@y@Int@ii\MFP@y@Int@i \MFP@split\MFP@y@Frc\MFP@y@Frc@i\MFP@y@Frc@ii}% -\def\MFPmore@init@z{% - \def\MFP@z@Frc@iv {0}% - \def\MFP@z@Frc@iii{0}% - \def\MFP@z@Frc@ii {0}% - \def\MFP@z@Frc@i {0}% - \def\MFP@z@Int@i {0}% - \def\MFP@z@Int@ii {0}% - \def\MFP@z@Int@iii{0}}% -\def\MFP@fourdigits#1{% - \@xp\MFP@fifthofmany\number#1{}{0}{00}{000}\mfp@end\number#1}% -\def\makeMFP@fourdigits#1{\edef#1{\MFP@fourdigits{#1}}}% -\def\MFP@eightdigits#1{% - \@xp\MFP@ninthofmany\number#1% - {}{0}{00}{000}{0000}{00000}{000000}{0000000}\mfp@end\number#1}% -\def\makeMFP@eightdigits#1{\edef#1{\MFP@eightdigits{#1}}}% +\def\makeMFP@fourdigits#1{% + \edef#1{\@xp\MFP@fifthofmany\number#1{}{0}{00}{000}\MFP@end\number#1}}% +\def\makeMFP@eightdigits#1{% + \edef#1{\@xp\MFP@ninthofmany\number#1% + {}{0}{00}{000}{0000}{00000}{000000}{0000000}\MFP@end\number#1}}% \def\MFP@carrya{\MFP@carry\MFP@ttteight}% \def\MFP@carrym{\MFP@carry\MFP@tttfour}% \def\MFP@carry#1#2#3{% \begingroup \MFP@carryi{#1}#2#3% \MFP@endgroup@after{% - \MFP@def@after#3{\number\MFP@tempa}% - \MFP@def@after#2{\number\MFP@tempb}% + \MFP@afterdef#3{\number\MFP@tempa}% + \MFP@afterdef#2{\number\MFP@tempb}% }}% \def\MFP@carryi#1#2#3{% \MFP@tempa=#3\relax @@ -445,7 +425,7 @@ \MFP@tempa#1% \advance\MFP@tempa#2\relax \MFP@endgroup@after{% - \MFP@def@after#3{\number\MFP@tempa}% + \MFP@afterdef#3{\number\MFP@tempa}% }}% \def\MFP@multiplyone#1#2{% \MFP@tempa#1% @@ -500,24 +480,25 @@ \edef\MFP@z@Frc{\number\MFP@tempb}% \makeMFP@eightdigits\MFP@z@Frc}% \def\MFP@Rmul{% - \MFP@tempa\MFP@x@Sgn \multiply\MFP@tempa\MFP@y@Sgn\relax - \ifnum 0=\MFP@tempa - \MFP@Rzero - \else - \edef\MFP@z@Sgn{\number\MFP@tempa}% - \@xp\MFP@@Rmul - \fi}% + \ifnum\MFP@x@Sgn=0 \MFP@Rzero + \else\ifnum\MFP@y@Sgn=0 \MFP@Rzero + \else \edef\MFP@z@Sgn{\number\MFP@x@Sign\MFP@y@Sgn}% + \@XP\MFP@@Rmul + \fi\fi}% \def\MFP@@Rmul{% - \MFPmore@init@z - \MFP@x@split\MFP@y@split + \def\MFP@z@Frc@iv {0}\def\MFP@z@Frc@iii{0}% + \def\MFP@z@Frc@ii {0}\def\MFP@z@Frc@i {0}% + \def\MFP@z@Int@i {0}\def\MFP@z@Int@ii {0}% + \def\MFP@z@Int@iii{0}% + \MFP@@split \MFP@multiplyfour \MFP@y@Frc@ii \MFP@z@Frc@i - \MFP@z@Frc@ii \MFP@z@Frc@iii\MFP@z@Frc@iv + \MFP@z@Frc@ii \MFP@z@Frc@iii \MFP@z@Frc@iv \MFP@multiplyfour \MFP@y@Frc@i \MFP@z@Int@i - \MFP@z@Frc@i \MFP@z@Frc@ii \MFP@z@Frc@iii + \MFP@z@Frc@i \MFP@z@Frc@ii \MFP@z@Frc@iii \MFP@multiplyfour \MFP@y@Int@i \MFP@z@Int@ii - \MFP@z@Int@i \MFP@z@Frc@i \MFP@z@Frc@ii + \MFP@z@Int@i \MFP@z@Frc@i \MFP@z@Frc@ii \MFP@multiplyfour \MFP@y@Int@ii \MFP@z@Int@iii - \MFP@z@Int@ii \MFP@z@Int@i \MFP@z@Frc@i + \MFP@z@Int@ii \MFP@z@Int@i \MFP@z@Frc@i \MFP@carrym\MFP@z@Frc@iv\MFP@z@Frc@iii \MFP@carrym\MFP@z@Frc@iii\MFP@z@Frc@ii \ifnum\MFP@z@Frc@iii<5000 \else @@ -540,12 +521,10 @@ \edef\MFP@z@Und{\MFP@z@Frc@iii\MFP@z@Frc@iv}% \ifnum\MFP@z@Int>0 \else\ifnum\MFP@z@Frc>0 - \else - \def\MFP@z@Sgn{0}% + \else \def\MFP@z@Sgn{0}% \fi\fi}% \def\MFP@Rdiv{% - \ifnum\MFP@y@Sgn=0 - \MFP@dividebyzero@err + \ifnum\MFP@y@Sgn=0 \MFP@dividebyzero@err \ifnum\MFP@x@Sgn=0 \edef\MFP@z@Int{\ZeroOverZeroInt}% \edef\MFP@z@Frc{\ZeroOverZeroFrac}% @@ -554,13 +533,8 @@ \edef\MFP@z@Frc{\xOverZeroFrac}% \fi \edef\MFP@z@Sgn{\MFP@x@Sgn}% - \else\ifnum\MFP@x@Sgn=0 - \MFP@Rzero - \else - \MFP@tempa\MFP@x@Sgn - \multiply\MFP@tempa\MFP@y@Sgn - \edef\MFP@z@Sgn{\number\MFP@tempa}% - \MFP@@Rdiv + \else\ifnum\MFP@x@Sgn=0 \MFP@Rzero + \else \edef\MFP@z@Sgn{\number\MFP@x@Sign\MFP@y@Sgn}\MFP@@Rdiv \fi\fi}% \def\MFP@@Rdiv{% \ifnum\MFP@y@Int=0 @@ -571,14 +545,14 @@ \MFP@tempa=0 \fi \advance\MFP@tempa\MFP@numdigits@toshift\MFP@y@Int\relax - \@XP\MFP@doshift@y\@xp\MFP@y@Int\MFP@y@Frc0000000\mfp@end + \@XP\MFP@doshift@y\@xp\MFP@y@Int\MFP@y@Frc0000000\MFP@end \ifnum\MFP@x@Int=0 \edef\MFP@x@Int{\number\MFP@x@Frc}% \def\MFP@x@Frc{00000000}% \advance\MFP@tempa -8 \fi \advance\MFP@tempa-\MFP@numdigits@toshift\MFP@x@Int\relax - \@XP\MFP@doshift@x\@xp\MFP@x@Int\MFP@x@Frc0000000\mfp@end + \@XP\MFP@doshift@x\@xp\MFP@x@Int\MFP@x@Frc0000000\MFP@end \ifnum\MFP@tempa<-9 \else \MFP@tempf\MFP@tempa @@ -593,13 +567,13 @@ \makeMFP@eightdigits\MFP@z@Frc \fi \fi}% -\def\MFP@numdigits@toshift#1{\@xp\MFP@ninthofmany#101234567\mfp@end}% -\def\MFP@doshift@x#1#2#3#4#5#6#7#8#9\mfp@end{% +\def\MFP@numdigits@toshift#1{\@xp\MFP@ninthofmany#101234567\MFP@end}% +\def\MFP@doshift@x#1#2#3#4#5#6#7#8#9\MFP@end{% \def\MFP@x@Int{#1#2#3#4#5#6#7#8}% - \edef\MFP@x@Frc{\MFP@firsteightofmany#9\mfp@end}}% -\def\MFP@doshift@y#1#2#3#4#5#6#7#8#9\mfp@end{% + \edef\MFP@x@Frc{\MFP@eightofmany#9\MFP@end}}% +\def\MFP@doshift@y#1#2#3#4#5#6#7#8#9\MFP@end{% \def \MFP@y@Int{#1#2#3#4#5#6#7#8}% - \edef\MFP@y@Frc{\MFP@firsteightofmany#9\mfp@end}}% + \edef\MFP@y@Frc{\MFP@eightofmany#9\MFP@end}}% \def\MFP@Rdivloop{% \MFP@tempb\MFP@x@Int % \MFP@tempb = n_1 \MFP@tempc\MFP@y@Int % \MFP@tempc = d_1 @@ -634,7 +608,7 @@ \fi \advance\MFP@tempf -1 \ifnum\MFP@tempf>0 - \edef\MFP@x@Int{\MFP@x@Int0}% easy multiplications by 10 + \edef\MFP@x@Int{\MFP@x@Int0}% \edef\MFP@x@Frc{\MFP@x@Frc0}% \MFP@carrya\MFP@x@Frc\MFP@x@Int \@xp\MFP@Rdivloop @@ -643,7 +617,7 @@ \advance \MFP@tempa -7 \ifnum\MFP@tempa>0 \def\MFP@z@Ovr{}% - \@xp\MFPget@Ovrdigits\MFP@z@digits\mfp@end + \@xp\MFPget@Ovrdigits\MFP@z@digits\MFP@end \else \ifnum\MFP@tempa<-7 \edef\MFP@z@digits{00000000\MFP@z@digits}% @@ -661,7 +635,7 @@ 0000\else 00000% \fi \MFP@z@digits}% - \@xp\MFPget@Intdigits\MFP@z@digits\mfp@end + \@xp\MFPget@Intdigits\MFP@z@digits\MFP@end \fi}% \def\MFPget@Ovrdigits#1{% \edef\MFP@z@Ovr{\MFP@z@Ovr#1}% @@ -676,7 +650,7 @@ \MFPget@Frcdigits}% \def\MFPget@Frcdigits#1#2#3#4#5#6#7#8#9{% \def\MFP@z@Frc{#1#2#3#4#5#6#7#8}% - \def\MFP@z@Und{#9}\gobbleto@mfp@end}% + \def\MFP@z@Und{#9}\gobbleto@MFP@end}% \def\MFP@Rmax{% \MFP@Rcmp \ifMFP@neg \MFP@Rcopy yz\else\MFP@Rcopy xz\fi}% \def\MFP@Rmin{% @@ -691,15 +665,15 @@ \@xp\MFP@Rtrunc \fi}% \def\MFP@Rtrunc#1{% - \edef\MFP@x@Frc{\@xp\MFP@@Rtrunc\MFP@x@Frc\mfp@end}% - \ifnum\MFP@x@Int=0 % possibly returns 0 + \edef\MFP@x@Frc{\@xp\MFP@@Rtrunc\MFP@x@Frc\MFP@end}% + \ifnum\MFP@x@Int=0 \ifnum\MFP@x@Frc=0 \def\MFP@x@Sgn{0}% \fi \fi \MFP@endgroup@after{% - \MFP@def@after#1{\MFP@x@Sign\MFP@x@Int.\MFP@x@Frc}}}% -\def\MFP@@Rtrunc#1#2#3#4#5#6#7#8#9\mfp@end{% + \MFP@afterdef#1{\MFP@x@Sign\MFP@x@Int.\MFP@x@Frc}}}% +\def\MFP@@Rtrunc#1#2#3#4#5#6#7#8#9\MFP@end{% \ifcase\MFP@tempa\or #1\or #1#2\or @@ -711,9 +685,9 @@ #1#2#3#4#5#6#7#8\fi}% \def\MFP@iRtrunc#1{% \makeMFP@eightdigits\MFP@x@Int - \edef\MFP@x@Val{\number\MFP@x@Sign\@xp\MFP@@iRtrunc\MFP@x@Int\mfp@end}% - \MFP@endgroup@after{\MFP@def@after#1{\MFP@x@Val}}}% -\def\MFP@@iRtrunc#1#2#3#4#5#6#7#8#9\mfp@end{% + \edef\MFP@x@Val{\number\MFP@x@Sign\@xp\MFP@@iRtrunc\MFP@x@Int\MFP@end}% + \MFP@endgroup@after{\MFP@afterdef#1{\MFP@x@Val}}}% +\def\MFP@@iRtrunc#1#2#3#4#5#6#7#8#9\MFP@end{% \ifcase-\MFP@tempa #1#2#3#4#5#6#7#8\or #1#2#3#4#5#6#70\or @@ -730,32 +704,32 @@ \ifnum 0>\MFP@tempa \edef\MFP@y@Tmp{% \ifcase-\MFP@tempa\or - 5\or % .5 x 10^1 - 50\or % .5 x 10^2 - 500\or % .5 x 10^3 - 5000\or % .5 x 10^4 - 50000\or % .5 x 10^5 - 500000\or % .5 x 10^6 - 5000000\else % .5 x 10^7 - 50000000\fi % .5 x 10^8 + 5\or + 50\or + 500\or + 5000\or + 50000\or + 500000\or + 5000000\else + 50000000\fi }% \else \edef\MFP@y@Tmp{% \ifcase\MFP@tempa - .5\or % .5 x 10^0 - .05\or % .5 x 10^{-1} - .005\or % .5 x 10^{-2} - .0005\or % .5 x 10^{-3} - .00005\or % .5 x 10^{-4} - .000005\or % .5 x 10^{-5} - .0000005\or % .5 x 10^{-6} - .00000005\else% .5 x 10^{-7} - 0\fi % + .5\or + .05\or + .005\or + .0005\or + .00005\or + .000005\or + .0000005\or + .00000005\else + 0\fi }% \fi \MFPchk{#2}\ifMFP@neg\edef\MFP@y@Tmp{-\MFP@y@Tmp}\fi \MFPadd{#2}\MFP@y@Tmp\MFP@z@Tmp - \MFP@endgroup@after{\MFP@def@after\MFP@z@Tmp{\MFP@z@Tmp}}% + \MFP@endgroup@after{\MFP@afterdef\MFP@z@Tmp{\MFP@z@Tmp}}% \MFPtruncate{#1}\MFP@z@Tmp}% \def\MFPstrip{% \@ifstar{\MFP@strip{}}{\MFP@strip{.0}}}% @@ -764,22 +738,22 @@ \ifnum \MFP@x@Frc=0 \edef#3{\MFP@x@Sign\MFP@x@Int#1}% \else - \edef#3{\MFP@x@Sign\MFP@x@Int.\@xp\MFP@@strip\MFP@x@Frc\mfp@end}% + \edef#3{\MFP@x@Sign\MFP@x@Int.\@xp\MFP@@strip\MFP@x@Frc\MFP@end}% \fi}% -\def\MFP@@strip#1#2\mfp@end{% +\def\MFP@@strip#1#2\MFP@end{% #1% \ifnum 0#2>0 \@xp\MFP@@strip \else - \@xp\gobbleto@mfp@end - \fi#2\mfp@end}% + \@xp\gobbleto@MFP@end + \fi#2\MFP@end}% \def\MFP@Global#1{\toks@\@xp{#1}\xdef#1{\the\toks@}}% \def\MFP@GlobalStack{\MFP@Global\MFP@Rstack}% \def\MFP@Export#1{% \begingroup \toks@\@xp{\MFPprogram@returns}% \MFP@endgroup@after{% - \MFP@def@after\MFPprogram@returns{\the\toks@ \MFP@def@after#1{#1}}% + \MFP@afterdef\MFPprogram@returns{\the\toks@ \MFP@afterdef#1{#1}}% }}% \def\MFP@ExportStack{\MFP@Export\MFP@Rstack}% \def\MFP@Rload #1#2#3#4{% |