summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex156
1 files changed, 78 insertions, 78 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex
index 4bd05c18c41..07f7b8b6d90 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex
@@ -13,111 +13,111 @@
% round function. Uses asymmetric half-up rounding.
%
-\pgfmathdeclarefunction{round}{1}{%
- \begingroup%
- \expandafter\pgfmath@x#1pt\relax%
- \afterassignment\pgfmath@xa%
- \expandafter\c@pgfmath@counta\the\pgfmath@x\relax%
- \pgfmath@xb\pgfmath@x%
- \ifdim\pgfmath@xb<0pt\relax%
- \ifdim\pgfmath@xa<0.5pt\relax%
- \else%
- \advance\c@pgfmath@counta-1\relax%
- \fi%
- \else%
- \ifdim\pgfmath@xa<0.5pt\relax%
- \else%
- \advance\c@pgfmath@counta1\relax%
- \fi%
- \fi%
- \pgfmath@returnone\the\c@pgfmath@counta pt%
- \endgroup%
+\pgfmathdeclarefunction{round}{1}{%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \afterassignment\pgfmath@xa%
+ \expandafter\c@pgfmath@counta\the\pgfmath@x\relax%
+ \pgfmath@xb\pgfmath@x%
+ \ifdim\pgfmath@xb<0pt\relax%
+ \ifdim\pgfmath@xa<0.5pt\relax%
+ \else%
+ \advance\c@pgfmath@counta-1\relax%
+ \fi%
+ \else%
+ \ifdim\pgfmath@xa<0.5pt\relax%
+ \else%
+ \advance\c@pgfmath@counta1\relax%
+ \fi%
+ \fi%
+ \pgfmath@returnone\the\c@pgfmath@counta pt%
+ \endgroup%
}%
% floor function.
%
-\pgfmathdeclarefunction{floor}{1}{%
- \begingroup%
- \expandafter\pgfmath@x#1pt\relax%
- \afterassignment\pgfmathfloor@collect@remainder%
- \expandafter\c@pgfmath@counta\the\pgfmath@x\pgfmath@%
- \expandafter\pgfmath@x#1pt\relax%
- \ifdim\pgfmath@x<0pt\relax%
- \ifdim\pgfmathfloor@remainder>0pt
- \advance\c@pgfmath@counta by -1\relax%
- \else
- % ok, we stripped only '0'.
- \fi
- \fi%
- \pgfmath@x\c@pgfmath@counta pt\relax%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
+\pgfmathdeclarefunction{floor}{1}{%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \afterassignment\pgfmathfloor@collect@remainder%
+ \expandafter\c@pgfmath@counta\the\pgfmath@x\pgfmath@%
+ \expandafter\pgfmath@x#1pt\relax%
+ \ifdim\pgfmath@x<0pt\relax%
+ \ifdim\pgfmathfloor@remainder>0pt
+ \advance\c@pgfmath@counta by -1\relax%
+ \else
+ % ok, we stripped only '0'.
+ \fi
+ \fi%
+ \pgfmath@x\c@pgfmath@counta pt\relax%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
}%
\def\pgfmathfloor@collect@remainder#1\pgfmath@{%
- \def\pgfmathfloor@remainder{#1}%
- \ifx\pgfmathfloor@remainder\pgfutil@empty
- \def\pgfmathfloor@remainder{0}%
- \fi
+ \def\pgfmathfloor@remainder{#1}%
+ \ifx\pgfmathfloor@remainder\pgfutil@empty
+ \def\pgfmathfloor@remainder{0}%
+ \fi
}%
% ceil function.
%
-\pgfmathdeclarefunction{ceil}{1}{%
- \begingroup%
- \expandafter\pgfmath@x#1pt\relax%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \expandafter\c@pgfmath@counta\the\pgfmath@x\relax\pgfmath@%
- \pgfmath@y\pgfmath@x%
- \advance\pgfmath@y-\c@pgfmath@counta pt\relax%
- \pgfmath@x\c@pgfmath@counta pt\relax%
- \ifdim\pgfmath@y>0pt\relax%
- \advance\pgfmath@x1pt\relax%
- \fi%
- \pgfmath@returnone\pgfmath@x%
- \endgroup%
+\pgfmathdeclarefunction{ceil}{1}{%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter\c@pgfmath@counta\the\pgfmath@x\relax\pgfmath@%
+ \pgfmath@y\pgfmath@x%
+ \advance\pgfmath@y-\c@pgfmath@counta pt\relax%
+ \pgfmath@x\c@pgfmath@counta pt\relax%
+ \ifdim\pgfmath@y>0pt\relax%
+ \advance\pgfmath@x1pt\relax%
+ \fi%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
}%
% int function
%
\pgfmathdeclarefunction{int}{1}{%
- \begingroup%
- \expandafter\pgfmathint@@#1.\pgfmath@stop
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup}
+ \begingroup%
+ \expandafter\pgfmathint@@#1.\pgfmath@stop
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup}
\def\pgfmathint@@#1.#2\pgfmath@stop{%
- \def\pgfmath@temp{#1}%
- \ifx\pgfmath@temp\pgfmath@empty%
- \def\pgfmathresult{0}%
- \else%
- \pgfmath@in@{#1}{+-+0-0}%
- \ifpgfmath@in@
- \def\pgfmathresult{0}%
- \else%
- \def\pgfmathresult{#1}%
- \fi%
- \fi}
+ \def\pgfmath@temp{#1}%
+ \ifx\pgfmath@temp\pgfmath@empty%
+ \def\pgfmathresult{0}%
+ \else%
+ \pgfmath@in@{#1}{+-+0-0}%
+ \ifpgfmath@in@
+ \def\pgfmathresult{0}%
+ \else%
+ \def\pgfmathresult{#1}%
+ \fi%
+ \fi}
% frac function.
%
-\pgfmathdeclarefunction{frac}{1}{%
- \begingroup%
- \expandafter\pgfmathfrac@@#1.\pgfmath@stop%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup}
+\pgfmathdeclarefunction{frac}{1}{%
+ \begingroup%
+ \expandafter\pgfmathfrac@@#1.\pgfmath@stop%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup}
\def\pgfmathfrac@@#1.{%
- \pgfmath@ifnextchar\pgfmath@stop{\def\pgfmathresult{0.0}\pgfmath@gobbleone}{\pgfmathfrac@@@}%
+ \pgfmath@ifnextchar\pgfmath@stop{\def\pgfmathresult{0.0}\pgfmath@gobbleone}{\pgfmathfrac@@@}%
}
\def\pgfmathfrac@@@#1.\pgfmath@stop{\def\pgfmathresult{0.#1}}
% real function.
%
\pgfmathdeclarefunction{real}{1}{%
- \begingroup%
- \pgfmath@x=#1pt\relax%
- \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@x}}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
+ \begingroup%
+ \pgfmath@x=#1pt\relax%
+ \edef\pgfmathresult{\pgfmath@tonumber{\pgfmath@x}}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
}