diff options
author | Karl Berry <karl@freefriends.org> | 2010-10-29 00:31:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-10-29 00:31:31 +0000 |
commit | 6bc1f5497cfb2f56d65c80a4c36ea3bad6dc046c (patch) | |
tree | f7751da75030fb1e06653eeb44e579fcee09c65f /Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex | |
parent | ed0c7c756e441b2d2ba3633da233fc24361ac0d3 (diff) |
pgf 2.10 (28oct10)
git-svn-id: svn://tug.org/texlive/trunk@20236 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex | 179 |
1 files changed, 179 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex new file mode 100644 index 00000000000..54a8d64220e --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex @@ -0,0 +1,179 @@ +% Copyright 2007 by Mark Wibrow +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +% This file defines the mathematical functions and operators. +% +% Version 1.4142135 11/8/2008 + +\pgfmathdeclarefunction{greater}{2}{% + \begingroup% + \ifdim#1pt>#2pt\relax% + \def\pgfmathresult{1}% + \else% + \def\pgfmathresult{0}% + \fi% + \pgfmath@smuggleone\pgfmathresult% + \endgroup% +} +\let\pgfmathgreaterthan=\pgfmathgreater + +\pgfmathdeclarefunction{less}{2}{% + \begingroup% + \ifdim#1pt<#2pt\relax% + \def\pgfmathresult{1}% + \else% + \def\pgfmathresult{0}% + \fi% + \pgfmath@smuggleone\pgfmathresult% + \endgroup% +} +\let\pgfmathlessthan=\pgfmathless + +\pgfmathdeclarefunction{equal}{2}{% + \begingroup% + \ifdim#1pt=#2pt\relax% + \def\pgfmathresult{1}% + \else% + \def\pgfmathresult{0}% + \fi% + \pgfmath@smuggleone\pgfmathresult% + \endgroup% +} +\let\pgfmathequalto=\pgfmathequal + + +% approxequalto function from Christian Feuersanger. +% +\newif\ifpgfmathcomparison +\pgfmathdeclarefunction{approxequalto}{2}{% + \begingroup% + \pgfmath@x=#1pt\relax% + \pgfmath@y=#2pt\relax% + \advance\pgfmath@x by-\pgfmath@y% + \ifdim\pgfmath@x<0pt\relax% + \multiply\pgfmath@x by-1\relax% + \fi + \ifdim\pgfmath@x<0.0001pt\relax% + \def\pgfmathresult{1.0}% + \global\pgfmathcomparisontrue% + \else% + \def\pgfmathresult{0.0}% + \global\pgfmathcomparisonfalse% + \fi% + \pgfmath@smuggleone\pgfmathresult% + \endgroup% +} + + + +% ifthenelse function. +% +\pgfmathdeclarefunction{ifthenelse}{3}{% + \begingroup% + \ifdim#1pt=0.0pt\relax% + \expandafter\def\expandafter\pgfmathresult\expandafter{#3}% + \else% + \expandafter\def\expandafter\pgfmathresult\expandafter{#2}% + \fi% + \pgfmath@smuggleone\pgfmathresult% + \endgroup% +} + +% notequal function. +% +\pgfmathdeclarefunction{notequal}{2}{% + \begingroup% + \ifdim#1pt=#2pt\relax% + \def\pgfmathresult{0}% + \else% + \def\pgfmathresult{1}% + \fi% + \pgfmath@smuggleone\pgfmathresult% + \endgroup% +} + +% notless function. +% +\pgfmathdeclarefunction{notless}{2}{% + \begingroup% + \ifdim#1pt<#2pt\relax% + \def\pgfmathresult{0}% + \else% + \def\pgfmathresult{1}% + \fi% + \pgfmath@smuggleone\pgfmathresult% + \endgroup% +} + +% notgreater function. +% +\pgfmathdeclarefunction{notgreater}{2}{% + \begingroup% + \ifdim#1pt>#2pt\relax% + \def\pgfmathresult{0}% + \else% + \def\pgfmathresult{1}% + \fi% + \pgfmath@smuggleone\pgfmathresult% + \endgroup% +} + +% and function. +% +\pgfmathdeclarefunction{and}{2}{% + \begingroup% + \def\pgfmathresult{1}% + \ifdim#1pt=0pt\relax% + \def\pgfmathresult{0}% + \else% + \ifdim#2pt=0pt\relax% + \def\pgfmathresult{0}% + \fi% + \fi% + \pgfmath@smuggleone\pgfmathresult% + \endgroup% +} + +% or function. +% +\pgfmathdeclarefunction{or}{2}{% + \begingroup% + \def\pgfmathresult{0}% + \ifdim#1pt=0pt\relax% + \ifdim#2pt=0pt\relax% + \else% + \def\pgfmathresult{1}% + \fi% + \else% + \def\pgfmathresult{1}% + \fi% + \pgfmath@smuggleone\pgfmathresult% + \endgroup% +} + +% not function. +% +\pgfmathdeclarefunction{not}{1}{% + \begingroup% + \ifdim#1pt=0pt\relax% + \def\pgfmathresult{1}% + \else% + \def\pgfmathresult{0}% + \fi% + \pgfmath@smuggleone\pgfmathresult% + \endgroup% +} + +% true function. +% +\pgfmathdeclarefunction{true}{0}{\def\pgfmathresult{1}} + +% false function. +% +\pgfmathdeclarefunction{false}{0}{\def\pgfmathresult{0}} |