summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-01-04 00:17:22 +0000
committerKarl Berry <karl@freefriends.org>2014-01-04 00:17:22 +0000
commit64cabb7b36a81f41f4bbe49f00cf5aa4fc83f66c (patch)
treea58cad8582cd6d596ac7c83e4c87166d009ea2f3 /Master/texmf-dist/tex
parent09a6ab34f799132f02f90e619fa695f2a07c426d (diff)
minifp (3jan14)
git-svn-id: svn://tug.org/texlive/trunk@32559 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/generic/minifp/mfpextra.tex40
-rw-r--r--Master/texmf-dist/tex/generic/minifp/minifp.sty11
2 files changed, 46 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/generic/minifp/mfpextra.tex b/Master/texmf-dist/tex/generic/minifp/mfpextra.tex
index 9d65d0ff1aa..71d476dd497 100644
--- a/Master/texmf-dist/tex/generic/minifp/mfpextra.tex
+++ b/Master/texmf-dist/tex/generic/minifp/mfpextra.tex
@@ -51,6 +51,7 @@
\def\Rln {\MFP@stack@Unary\MFP@Rln }%
\def\Rexp {\MFP@stack@Unary\MFP@Rexp }%
\def\Rsqrt {\MFP@stack@Unary\MFP@Rsqrt}%
+ \def\Rrand {\MFP@stack@Unary\MFP@Rrand}%
\def\Rpow {\MFP@stack@Binary\MFP@Rpow}}%
\def\MFPcos {\MFP@op@Unary\MFP@Rcos }%
\def\MFPsin {\MFP@op@Unary\MFP@Rsin }%
@@ -61,6 +62,7 @@
\def\MFPln {\MFP@op@Unary\MFP@Rln }%
\def\MFPexp {\MFP@op@Unary\MFP@Rexp }%
\def\MFPsqrt {\MFP@op@Unary\MFP@Rsqrt}%
+\def\MFPrand {\MFP@op@Unary\MFP@Rrand}%
\def\MFPpow {\MFP@op@Binary\MFP@Rpow}%
\def\MFP@logofzero@err{%
\MFP@errmsg{logarithm of zero}%
@@ -659,6 +661,44 @@
\fi
\expandafter\MFP@Isqrt@loop
\fi}%
+\newcount\MFP@randseed % the random number (and starting seed)
+\def\MFP@nextrand{\begingroup
+ \ifnum\MFP@randseed<1
+ \global\MFP@randseed\time
+ \global\multiply\MFP@randseed388 \global\advance\MFP@randseed\year
+ \global\multiply\MFP@randseed31 \global\advance\MFP@randseed\day
+ \global\multiply\MFP@randseed97 \global\advance\MFP@randseed\month
+ \MFP@nextrand \MFP@nextrand \MFP@nextrand
+ \fi
+ \MFP@tempa\MFP@randseed
+ \divide\MFP@tempa \MFP@rand@q % modulus = m*q + r
+ \MFP@tempb\MFP@tempa
+ \multiply\MFP@tempa \MFP@rand@q
+ \global\advance\MFP@randseed-\MFP@tempa % seed mod q
+ \global\multiply\MFP@randseed \MFP@rand@m
+ \multiply\MFP@tempb \MFP@rand@r
+ \global\advance\MFP@randseed-\MFP@tempb
+ \ifnum\MFP@randseed<\z@ \global\advance\MFP@randseed "7FFFFFFF\relax\fi
+ \endgroup}%
+\def\MFPrandgenA{\def\MFP@rand@m{16807 }\def\MFP@rand@q{127773 }%
+ \def\MFP@rand@r{2836 }}%
+\def\MFPrandgenB{\def\MFP@rand@m{48271 }\def\MFP@rand@q{44488 }%
+ \def\MFP@rand@r{3399 }}%
+\def\MFPrandgenC{\def\MFP@rand@m{69621 }\def\MFP@rand@q{30845 }%
+ \def\MFP@rand@r{23902 }}%
+\MFPrandgenA
+\def\MFP@getrand{% leaves result in \MFP@tempa
+ \MFP@nextrand
+ \MFP@tempa\MFP@randseed
+ \advance\MFP@tempa-1
+ \divide\MFP@tempa 21 % (2^31-3)= 100000000*21 + r
+ \ifnum \MFP@ttteight> \MFP@tempa
+ \else \@xp\MFP@getrand\fi}%
+\def\MFP@Rrand{%
+ \MFP@getrand \edef\MFP@a@Tmp{\number\MFP@tempa}%
+ \MFP@getrand \edef\MFP@b@Tmp{\number\MFP@tempa}%
+ \MFP@DPmul0\MFP@a@Tmp\MFP@b@Tmp}%
+\def\MFPsetseed#1{\global\MFP@randseed #1\relax}%
\MFP@xfinish
\endinput
%%
diff --git a/Master/texmf-dist/tex/generic/minifp/minifp.sty b/Master/texmf-dist/tex/generic/minifp/minifp.sty
index 0566ae33e1e..bcd4ad1ec7b 100644
--- a/Master/texmf-dist/tex/generic/minifp/minifp.sty
+++ b/Master/texmf-dist/tex/generic/minifp/minifp.sty
@@ -21,8 +21,8 @@
%% is Daniel H. Luecking. The Base Interpreters associated
%% with minifp are plain TeX and LaTeX.
%%
-\def\MFPfiledate{2013/05/28}%
-\def\MFPfileversion{0.95}%
+\def\MFPfiledate{2013/12/30}%
+\def\MFPfileversion{0.96}%
\expandafter
\ifx \csname MFP@finish\endcsname\relax
\else \expandafter\endinput \fi
@@ -255,7 +255,7 @@
\let\Rnoop\relax
\def\Rcmp{%
\MFPgetoperand@y\MFPgetoperand@x
- \MFP@Rcat\MFP@x@Val\MFP@Rcat\MFP@y@Val
+ \MFP@Rcattwo\MFP@y@Val\MFP@x@Val
\MFP@Rcmp}%
\def\Rchk{%
\MFPgetoperand@x
@@ -268,8 +268,8 @@
\MFPpush@result}%
\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}%
+ \Rpop\MFP@y@Val\Rpop\MFP@x@Val
+ \MFP@Rcattwo\MFP@x@Val\MFP@y@Val}%
\def\Rdup{%
\Rpop\MFP@x@Val
\MFP@Rcattwo\MFP@x@Val\MFP@x@Val}%
@@ -554,6 +554,7 @@
\advance\MFP@tempa-\MFP@numdigits@toshift\MFP@x@Int\relax
\@XP\MFP@doshift@x\@xp\MFP@x@Int\MFP@x@Frc0000000\MFP@end
\ifnum\MFP@tempa<-9
+ \MFP@Rzero
\else
\MFP@tempf\MFP@tempa
\advance\MFP@tempf 10