diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex index e2c78d1fdf4..0ede2314cfe 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex @@ -160,6 +160,24 @@ \def\pgfmathresultunitscale{1} + +% A utility function which evaluates expression '#1' and invokes '#2' +% if the expression is true and '#3' if it is false. +\def\pgfmathifexpression#1#2#3{% + \pgfmathparse{#1}% + \pgfmath@iftrue{#2}{#3}% +}% +% Executes '#1' if \pgfmathresult is 'true', '#2' otherwise. +% WARNING : overwritten in fpu lib! +\def\pgfmath@iftrue{% + \ifdim\pgfmathresult pt=1.0pt % + \let\pgfmath@next=\pgfutil@firstoftwo + \else + \let\pgfmath@next=\pgfutil@secondoftwo + \fi + \pgfmath@next% +}% + % Stuff for compatability with the calc package. % \def\pgfmath@calc@real#1{#1} @@ -261,6 +279,10 @@ \fi \pgfmath@parse@next} +% TT: If false, octal parsing is switched off (needed for time parsing) +\newif\ifpgfmath@octalparsing +\pgfmath@octalparsingtrue + % I (CJ) *think* it replaces |{| and |}| by |\pgfmath@bgroup| and % |\pgfmath@egroup|? \def\pgfmath@parse@@@ifbgroup#1{% @@ -312,7 +334,9 @@ \let\pgfmath@base=\pgfmath@empty% \let\pgfmath@token@next=\pgfmath@token% \if#10% Check for octal prefix. - \def\pgfmath@base{8}% + \ifpgfmath@octalparsing% + \def\pgfmath@base{8}% + \fi% \fi% \let\pgfmath@parse@next=\pgfmath@parse@number% \else% |