[texhax] "casting" Arrayjob to FP?
Matthew Leingang
leingang at courant.nyu.edu
Mon May 10 11:58:57 CEST 2010
Brandon,
Arrayjob doesn't get array values the same way it sets them. You have to do it like this:
\checkFooarray(1)
\def\secondnumber{\cachedata} %% works now
The arrayjob manual has lots of examples of this.
HTH,
Matthew
On May 10, 2010, at 2:27 AM, texhax-request at tug.org wrote:
>
>
>
> Hi all,
>
> I'm trying to use arrayjob (http://ctan.org/pkg/arrayjob/)to store numerical data which I handle with pstricks. Previously I've used fp (http://ctan.org/pkg/fp/) to perform useful arithmetic on data. However, fp doesn't seem to play immediately well with arrayjob.
>
> The following does not work as expected:
>
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \documentclass{minimal}
>
> \usepackage{fp}
> \usepackage{arrayjob}
>
> \begin{document}
>
> \newarray\Fooarray
> \readarray{Fooarray}{1.34}
>
> \def\firstnumber{0.34}
> \def\secondnumber{1.34} %% this works
> \def\secondnumber{\Fooarray(1)} %% this doesn't
>
> \FPadd\result\firstnumber\secondnumber
> \FPclip\result\result
> \fbox{\result}
>
> \end{document}
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> Suggestions? How can I 'cast' an arrayjob entry to an FP value?
>
> -Brandon
--
Matthew Leingang
Clinical Associate Professor of Mathematics
leingang at courant.nyu.edu
More information about the texhax
mailing list