diff options
author | Karl Berry <karl@freefriends.org> | 2009-07-20 23:32:19 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-07-20 23:32:19 +0000 |
commit | 2abc8d3b3a4acaf5a3e7a2a95c1de4cbe5884e1a (patch) | |
tree | a5fb9b664d00438be86ed658b7c8639dbf1f2c8a /Master/texmf-dist/tex/latex/animate/animfp.sty | |
parent | ab3190c57297b6f77dea7d556fd3d34fd2fc1772 (diff) |
animate update (20jul09)
git-svn-id: svn://tug.org/texlive/trunk@14352 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/animate/animfp.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/animate/animfp.sty | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/animate/animfp.sty b/Master/texmf-dist/tex/latex/animate/animfp.sty index 861b7df23cc..30d2d27ce04 100644 --- a/Master/texmf-dist/tex/latex/animate/animfp.sty +++ b/Master/texmf-dist/tex/latex/animate/animfp.sty @@ -12,7 +12,7 @@ % Copyright 2008 Alexander Grahn \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{animfp}[2008/07/18 fixed point addition for animate.sty] +\ProvidesPackage{animfp}[2009/06/29 fixed point addition for animate.sty] %adding two values \def\@anim@add#1#2#3{\afp@callc\afp@add#1{#2}{#3}+\relax} % #1 := #2+#3 @@ -234,13 +234,32 @@ \next% } +%remove trailing zeros of argument (A. Grahn 2009/06/29) +\def\afp@removetrailingzeros#1\relax{% + {% + \edef\afp@tmp{#1}% + \gdef\afp@reversed{}% + \expandafter\afp@reverse\afp@tmp,\@nil% + \afp@removeleadingzeros\afp@reversed\relax% + \gdef\afp@reversed{}% + \expandafter\afp@reverse\afp@tmp,\@nil% + \global\let\afp@tmp\afp@reversed% + }% +} +\def\afp@reverse#1#2\@nil{% reverse string, used in \afp@removetrailingzeros + \if#1,\else% + \xdef\afp@reversed{#1\afp@reversed}% + \afp@reverse#2\@nil% + \fi% +}% + %add two values \def\afp@add#1#2.#3.#4\relax#5.#6.#7\relax#8\relax{% % #1 macro, which gets the result - % #2 integer part of 1st value + % #2 integer part of 1st value % #3 fractional part of 1st value % #4 dummy to swallow everthing after the 2nd '.' - % #5 integer part of 2nd value + % #5 integer part of 2nd value % #6 fractional part of 2nd value % #7 dummy to swallow everthing after the 2nd '.' % @@ -307,5 +326,6 @@ % \global\let\afp@tmp\afp@tmp% }% + \afp@removetrailingzeros\afp@tmp\relax% (A. Grahn 2009/06/29) \let#1\afp@tmp% } |