When I calculate something, sometimes become the interim results to big for the pgf
system. One can use the fpu
library. I read about it in the TikZ & PGF
manual (see page 627), here and here but I still get this error:
Paragraph ended before `\pgfflt@readlowlevelfloat` was complete.
What is wrong?
Here is my code:
\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{fpu}
\begin{document}
%data values:
\def\RTable{{100,100.391,100.781,101.172,101.562,101.953,102.343,102.733,103.123,103.513,103.903,104.292,104.682,105.071,105.46,105.849,106.238,106.627,107.016,107.405,107.794,108.182,108.57,108.959,109.347,109.735,110.123,110.51,110.898,111.286,111.673,112.06,112.447,112.835,113.221,113.608,113.995,114.382,114.768,115.155,115.541,115.927,116.313,116.699,117.085,117.47,117.856,118.241,118.627,119.012,119.397,119.782,120.167,120.552,120.936,121.321,121.705,122.09,122.474,122.858,123.242,123.626,124.009,124.393,124.777,125.16,125.543,125.926,126.309,126.692,127.075,127.458,127.84,128.223,128.605,128.987,129.37,129.752,130.133,130.515,130.897}}
%prints the result to the console:
\pgfkeys{/pgf/fpu}
\foreach \i in {0, ..., 80}
{
\pgfmathparse{abs(\RTable[\i] - 100 - 3.0897 / 8 * \i)}\i, \pgfmathresult\\
}
\pgfkeys{/pgf/fpu=false}
\end{document}
Update:
I'am using a macro from here (thanks to Schrödinger's cat). See my MWE:
\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{fpu}
\newcommand\pgfmathparseFPU[1]{
\begingroup
\pgfkeys{
/pgf/fpu,
/pgf/fpu/output format = fixed
}
\pgfmathparse{#1}
\pgfmathsmuggle
\pgfmathresult
\endgroup}
\begin{document}
%data values:
\def\UABmValues{{14.9, 15.8, 17.7, 18.3, 19, 20, 21.1, 22.2, 24.3, 26.9, 30.1}}
%prints the result to the console:
\foreach[count = \i from 0] \k in {30, 35, ..., 80}
{
\pgfmathparseFPU{-25500 / (\UABmValues[\i] / 1000 - 255 / 52) - 5200 - 3.0897 / 8 * \k}\i, \pgfmathresult\\
}
\end{document}
and get still a
Paragraph ended before `\pgfflt@readlowlevelfloat` was complete.
error. What do am I wrong?
Thank you for your help and effort in advance!
\pgfkeys{pgf/fpu=false}
will not do what it says on the tin unless it has recently been fixed.\foreach[count = \i from 0] \k in {30, 35, ..., 80} { \pgfmathsetmacro{\myval}{\UABmValues[\i]} \pgfmathparseFPU{-25500/(\myval/1000-255/52)-5200-3.0897/8*\k}\i, \pgfmathresult\\ }
works. As of now,fpu
does not support a couple of things, including integer manipulation, and this kind of list extraction. So you need to extract the entry withoutfpu
.