From 44ccd75065152cd73c512645bc4dc6d258fe62cb Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 30 Dec 2011 22:58:39 +0000 Subject: pgfplots 1.5.1 (29dec11) git-svn-id: svn://tug.org/texlive/trunk@24977 c570f23f-e606-0410-a88d-b1316a301751 --- .../pgfplotsoldpgfsupp_pgflibraryfpu.code.tex | 101 +++++++++++++++++++-- 1 file changed, 93 insertions(+), 8 deletions(-) (limited to 'Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex') diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex index c08f7dee2fe..5183f85fc8e 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex @@ -14,7 +14,7 @@ %%% - nested \input commands have been updated %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Sa 30. Apr 21:00:37 CEST 2011 %%% +%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%% @@ -177,11 +177,26 @@ \expandafter\let\expandafter#1\csname pgfmathfloat@backup@\string#1\endcsname% }% } +\def\pgfmathfloat@prepareuninstallcmd@csname#1{% + % and store backup information (globally - I don't want to do that + % all the time when the FPU is used!): + {% + \globaldefs=1 + \pgfutil@namelet{pgfmathfloat@backup@#1}{#1}% + \expandafter\gdef\expandafter\pgfmathfloat@uninstall\expandafter{\pgfmathfloat@uninstall + \pgfutil@namelet{#1}{pgfmathfloat@backup@#1}% + }% + }% +} \def\pgfmathfloat@install#1=#2{% \pgfmathfloat@prepareuninstallcmd{#1}% \let#1=#2% } +\def\pgfmathfloat@install@csname#1#2{% + \pgfmathfloat@prepareuninstallcmd@csname{#1}% + \pgfutil@namelet{#1}{#2}% +} \def\pgfmathfloat@install@unimplemented#1{% \expandafter\pgfmathfloat@prepareuninstallcmd\csname pgfmath@#1@\endcsname% \expandafter\def\csname pgfmath#1@\endcsname##1{\pgfmathfloat@notimplemented{#1}}% @@ -236,15 +251,24 @@ \pgfmathfloat@install\pgfmathcosec@=\pgfmathfloatcosec@% \pgfmathfloat@install\pgfmathexp@=\pgfmathfloatexp@% \pgfmathfloat@install\pgfmathln@=\pgfmathfloatln@% + \pgfmathfloat@install@csname{pgfmathlog10@}{pgfmathfloatlog10@}% + \pgfmathfloat@install@csname{pgfmathlog2@}{pgfmathfloatlog2@}% \pgfmathfloat@install\pgfmathsqrt@=\pgfmathfloatsqrt@% \pgfmathfloat@install\pgfmath@pi=\pgfmathfloatpi@% \pgfmathfloat@install\pgfmathpi=\pgfmathfloatpi@% \pgfmathfloat@install\pgfmathe@=\pgfmathfloate@% \pgfmathfloat@install\pgfmathe=\pgfmathfloate@% \pgfmathfloat@install\pgfmathlessthan@=\pgfmathfloatlessthan@% + \pgfmathfloat@install\pgfmathnotless@=\pgfmathfloatnotless@% + \pgfmathfloat@install\pgfmathnotgreater@=\pgfmathfloatnotgreater@% \pgfmathfloat@install\pgfmathless@=\pgfmathfloatlessthan@% \pgfmathfloat@install\pgfmathgreaterthan@=\pgfmathfloatgreaterthan@% \pgfmathfloat@install\pgfmathgreater@=\pgfmathfloatgreaterthan@% + \pgfmathfloat@install\pgfmathifthenelse@=\pgfmathfloatifthenelse@% + \pgfmathfloat@install\pgfmathequal@=\pgfmathfloatequal@% + \pgfmathfloat@install\pgfmathequalto@=\pgfmathfloatequal@% + \pgfmathfloat@install\pgfmathnotequal@=\pgfmathfloatnotequal@% + \pgfmathfloat@install\pgfmathnotequalto@=\pgfmathfloatnotequal@% \pgfmathfloat@install\pgfmathpow@=\pgfmathfloatpow@ \pgfmathfloat@install\pgfmathrand@=\pgfmathfloatrand@ \pgfmathfloat@install\pgfmathrand=\pgfmathfloatrand@ @@ -266,14 +290,10 @@ \pgfmathfloat@install\pgfmathtanh@=\pgfmathfloattanh@ \pgfmathfloat@install@unimplemented{ceil}% \pgfmathfloat@install@unimplemented{frac}% - \pgfmathfloat@install@unimplemented{log2}% - \pgfmathfloat@install@unimplemented{log10}% - \pgfmathfloat@install@unimplemented{equalto}% \pgfmathfloat@install@unimplemented{random}% \pgfmathfloat@install@unimplemented{setseed}% \pgfmathfloat@install@unimplemented{Mod}% \pgfmathfloat@install@unimplemented{real}% - \pgfmathfloat@install@unimplemented{notequal}% % \pgfmathfloat@install@unimplemented{atan2}% % \pgfmathfloat@install@unimplemented{height}% % @@ -648,6 +668,25 @@ \let\pgfmathfloatlessthan=\pgfmathfloatlessthan@ \let\pgfmathfloatless@=\pgfmathfloatlessthan@ +% ! (#1 < #2) <=> (#1 >= #2) +\def\pgfmathfloatnotless@#1#2{% + \pgfmathfloatless@{#1}{#2}% + \ifpgfmathfloatcomparison + \def\pgfmathresult{0.0}% + \else + \def\pgfmathresult{1.0}% + \fi +}% +% ! (#1 > #2) <=> (#1 <= #2) +\def\pgfmathfloatnotgreater@#1#2{% + \pgfmathfloatless@{#2}{#1}% + \ifpgfmathfloatcomparison + \def\pgfmathresult{0.0}% + \else + \def\pgfmathresult{1.0}% + \fi +}% + % compares \pgfmathfloat@a@[SME] < \pgfmathfloat@b@[SME] \def\pgfmathfloatlessthan@positive{% \ifnum\pgfmathfloat@a@E<\pgfmathfloat@b@E @@ -905,6 +944,34 @@ \ifnum\pgfmathfloatiffinite@>2 #3\else #2\fi }% +\def\pgfmathfloatifthenelse@#1#2#3{% + \pgfmathfloatifflags{#1}{0}{% + \edef\pgfmathresult{#3}%% + }{% + \edef\pgfmathresult{#2}% + }% +} +\def\pgfmathfloatequal@#1#2{% + \pgfmathfloatifapproxequalrel{#1}{#2}{% + \def\pgfmathresult{1}% + \pgfmathfloatcomparisontrue + }{% + \def\pgfmathresult{0}% + \pgfmathfloatcomparisonfalse + }% +} +\let\pgfmathfloatequalto@=\pgfmathfloatequal@ + +\def\pgfmathfloatnotequal@#1#2{% + \pgfmathfloatifapproxequalrel{#1}{#2}{% + \def\pgfmathresult{0}% + \pgfmathfloatcomparisonfalse + }{% + \def\pgfmathresult{1}% + \pgfmathfloatcomparisontrue + }% +} +\let\pgfmathfloatnotequalto@=\pgfmathfloatnotequal@ % Computes the relative error between #1 and #2 (assuming #2 != 0) and % invokes #3 if the relative error is below `/pgf/fpu/rel thresh' and @@ -953,7 +1020,7 @@ #4\relax \fi \else - \if\pgfmathfloat@loc@TMPa#2 + \if\pgfmathfloat@loc@TMPa#2% #3\relax \else #4\relax @@ -1441,8 +1508,13 @@ % assuming #2 != 0. \def\pgfmathfloatrelerror@#1#2{% \pgfmathfloatsubtract@{#1}{#2}% - \pgfmathfloatdivide@{\pgfmathresult}{#2}% - \pgfmathfloatabs@{\pgfmathresult}% + \let\pgfmathfloat@subtract=\pgfmathresult + \pgfmathfloatifflags{#2}{0}{% + \let\pgfmathresult=\pgfmathfloat@subtract + }{% + \pgfmathfloatdivide@{\pgfmathfloat@subtract}{#2}% + \pgfmathfloatabs@{\pgfmathresult}% + }% }% \let\pgfmathfloatrelerror=\pgfmathfloatrelerror@ @@ -1609,6 +1681,19 @@ } \let\pgfmathfloatln=\pgfmathfloatln@ +\expandafter\def\csname pgfmathfloatlog10@\endcsname#1{% + \pgfmathfloatln@{#1}% + \let\pgfmathfloat@log@ten=\pgfmathresult + \pgfmathfloatcreate{1}{4.34294481903252}{-1}% 1/ln(10) + \pgfmathfloatmultiply@{\pgfmathresult}{\pgfmathfloat@log@ten}% +}% +\expandafter\def\csname pgfmathfloatlog2@\endcsname#1{% + \pgfmathfloatln@{#1}% + \let\pgfmathfloat@log@two=\pgfmathresult + \pgfmathfloatcreate{1}{1.44269504088896}{0}% 1/ln(2) + \pgfmathfloatmultiply@{\pgfmathresult}{\pgfmathfloat@log@two}% +}% + % Computes log(x) into \pgfmathresult. % % This allows numbers such at 10000000 or 5.23e-10 to be represented -- cgit v1.2.3