summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-04-03 23:06:54 +0000
committerKarl Berry <karl@freefriends.org>2010-04-03 23:06:54 +0000
commit36080b5cf06fe9bdde3b1edb30fd795a58e6bf10 (patch)
tree172e727ca5a42cbd0c2440855dbb81f3a5c2148e /Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex
parente27b3d0aaf815fdab1497a0a827998ac044e245d (diff)
pgfplots update (1apr10)
git-svn-id: svn://tug.org/texlive/trunk@17670 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex34
1 files changed, 31 insertions, 3 deletions
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 3bb41804bdb..0af3c3887c5 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: Di 29. Dez 22:11:16 CET 2009 %%%
+%%% Date of this copy: Mi 31. Mär 21:41:41 CEST 2010 %%%
@@ -94,6 +94,11 @@
fpu/output format/sci/.code= {\def\pgfmathfloatparse@output{\pgfmathfloattosci@{\pgfmathresult}}},
fpu/output format/fixed/.code= {\def\pgfmathfloatparse@output{\pgfmathfloattofixed@{\pgfmathresult}}},
fpu/output format/float,
+ fpu/rel thresh/.code={%
+ \pgfmathfloatparsenumber{#1}%
+ \let\pgfmathfloat@relthresh=\pgfmathresult
+ },
+ fpu/rel thresh=1e-4,
}
\pgfmathfloatcreate{1}{1.0}{0}\let\pgfmathfloatscale=\pgfmathresult
@@ -897,6 +902,28 @@
\ifnum\pgfmathfloatiffinite@>2 #3\else #2\fi
}%
+
+% 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
+% #4 if that is not the case.
+\long\def\pgfmathfloatifapproxequalrel#1#2#3#4{%
+ \begingroup
+ \pgfmathfloatparsenumber{#1}%
+ \let\pgfmathfloatarga=\pgfmathresult
+ \pgfmathfloatparsenumber{#2}%
+ \let\pgfmathfloatargb=\pgfmathresult
+ \pgfmathfloatrelerror@\pgfmathfloatarga\pgfmathfloatargb
+ \let\pgfmathfloatarga=\pgfmathresult
+ \pgfmathfloatlessthan@\pgfmathfloatarga\pgfmathfloat@relthresh
+ \ifpgfmathfloatcomparison
+ \def\pgfmathfloat@loc@TMPa{#3}%
+ \else
+ \def\pgfmathfloat@loc@TMPa{#4}%
+ \fi
+ \expandafter\endgroup
+ \pgfmathfloat@loc@TMPa
+}%
+
% Invokes code '#3' if the flags of the floating point number '#1'
% match the flag provided in '#2'.
%
@@ -1420,6 +1447,7 @@
}
\let\pgfmathfloatmod=\pgfmathfloatmod@
+
% A modification of \pgfmathfloatmod@ where #3 = 1/#2 is already
% known. This may be faster.
\def\pgfmathfloatmodknowsinverse@#1#2#3{%
@@ -1472,7 +1500,7 @@
%
% #1 is a one-argument macro which assigns \pgfmathresult.
\def\pgfmathfloatTRIG@#1#2{%
- \expandafter\ifx\csname pgfmathfloatTRIG@NUM\endcsname\relax% why not directly!??? Did not work!??
+ \expandafter\ifx\csname pgfmathfloatTRIG@NUM\endcsname\relax%
% Lazy evaluation:
\pgfmathfloatcreate{1}{3.6}{2}%
\global\let\pgfmathfloatTRIG@NUM=\pgfmathresult
@@ -1515,7 +1543,7 @@
\def\pgfmathfloatatan@#1{%
\begingroup
- \expandafter\ifx\csname pgfmathfloatatan@TMP\endcsname\relax% why not directly!??? Did not work!??
+ \expandafter\ifx\csname pgfmathfloatatan@TMP\endcsname\relax%
\pgfmathfloatcreate{1}{1.6}{4}%
\global\let\pgfmathfloatatan@TMP=\pgfmathresult
\pgfmathfloatcreate{2}{1.6}{4}%