[pstricks] Floating point calculations in LaTeX

Uwe Kern u.kern at web.de
Wed Feb 26 17:37:29 CET 2003


Chris Sangwin <sangwinc at for.mat.bham.ac.uk> schrieb am 26.02.03 16:42:07:
> 
> It occurs to me that the PSTricks package itself would really benefit from
> some easily accessible floating point routines, to allow these
> calculations to take place within LaTeX.  I've been using the fp package
> to perform these calculations within LaTeX, but this clashes with multido,
> and the syntax is a little hard to understand.

Did you try the following patch (which is given somewhere in the
fp documentation)?

\def\multido at init@n#1#2#3{%
  \edef#3{#1}%
  \ifnum\multido at count<\z@\expandafter\mdo at FPsub\else\expandafter\mdo at FPadd\fi
  {0}{#2}\multido at temp
  \multido at addtostep{\do\mdo at FPadd{\do#3}{\multido at temp}{\do#3}}}
\def\mdo at FPadd#1#2#3{%
  \edef\multido at temp{#1..\noexpand\@nil#2}%
  \expandafter\FPadd@\multido at temp..\@nil
  \let#3\multido at temp}
\def\mdo at FPsub#1#2{%
  \edef\multido at temp{\noexpand\FPsub@#2\noexpand\@empty}%
  \mdo at FPadd{#1}{\multido at temp}}

It works fine for me.

Regards
Uwe

______________________________________________________________________________
Viren? Wir wissen nicht was Ihr Arzt empfiehlt. Wir empfehlen den
Virencheck fur Ihre E-Mail-Anhange! http://freemail.web.de/features/?mc=021159



More information about the PSTricks mailing list