summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-01-05 22:40:38 +0000
committerKarl Berry <karl@freefriends.org>2019-01-05 22:40:38 +0000
commit22536bb2b5257046d271b1eaa11b4a275d5ec041 (patch)
tree2500eaf5c26b11e00ebd33a64fccfa332cd5a66c /Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex
parentcf794f0e2db6857972a9d48d4466a4f03a7057a0 (diff)
pgf (5jan19)
git-svn-id: svn://tug.org/texlive/trunk@49607 c570f23f-e606-0410-a88d-b1316a301751
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.tex17
1 files changed, 14 insertions, 3 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 03f9ca270ae..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
@@ -39,17 +39,28 @@
\pgfmathdeclarefunction{floor}{1}{%
\begingroup%
\expandafter\pgfmath@x#1pt\relax%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \expandafter\c@pgfmath@counta\the\pgfmath@x\relax\pgfmath@%
+ \afterassignment\pgfmathfloor@collect@remainder%
+ \expandafter\c@pgfmath@counta\the\pgfmath@x\pgfmath@%
\expandafter\pgfmath@x#1pt\relax%
\ifdim\pgfmath@x<0pt\relax%
- \advance\c@pgfmath@counta by -1\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
+}%
+
% ceil function.
%
\pgfmathdeclarefunction{ceil}{1}{%