summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex28
1 files changed, 28 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex
index a4e510d4dc8..581cdaade5f 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex
@@ -301,3 +301,31 @@
\def\pgfmathsetbasenumberlength#1{\def\pgfmath@basenumberlength{#1}}
\pgfmathsetbasenumberlength{1}%
+
+% \pgfmathtodigitlist\marg{macro}\marg{number}}
+%
+% This command converts \meta{number} into a comma-separated
+% list of digits and stores the result in \meta{macro}.
+% The \marg{number} is \emph{not} parsed before processing.
+%
+\def\pgfmathtodigitlist#1#2{%
+ \def\pgfmath@temp{#1}%
+ \let\pgfmath@digitlist=\pgfutil@empty%
+ \edef\pgfmath@@tmp{#2}%
+ \expandafter\pgfmath@todigitlist\pgfmath@@tmp @%
+}
+\def\pgfmath@base@atchar{@}
+\def\pgfmath@todigitlist#1{%
+ \def\pgfmath@digit{#1}%
+ \ifx\pgfmath@digit\pgfmath@base@atchar%
+ \expandafter\let\pgfmath@temp=\pgfmath@digitlist%
+ \else%
+ \ifx\pgfmath@digitlist\pgfutil@empty%
+ \edef\pgfmath@digitlist{#1}%
+ \else%
+ \edef\pgfmath@digitlist{\pgfmath@digitlist,#1}%
+ \fi%
+ \expandafter\pgfmath@todigitlist%
+ \fi%
+}
+