\pgfkeys{/pgf/fpu}
\pgfmathsetlengthmacro\x{5^2}
\show\x -> 25.0pt % OK, thanks.
\pgfmathparse{5cm^2}
What is the meaning of
]in the following?\show\pgfmathresult % ->1Y2.0238983e4]. \pgfkeys{/pgf/fpu/output format=sci}gives the expected format, but what is the cryptic
]?Why does this fail? Is unit not allowed in
{<expr>}? The manual says\pgfmathsetlengthmacro"defines<macro>as the value of<expression>in points."\pgfmathsetlengthmacro\y{5cm^2} % ! Illegal unit. \pgfmathsetlengthmacro\y{5^2cm} % ! Illegal unit. \show\y
EDIT
Here is a minimal example:
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\pgfkeys{/pgf/fpu}
\pgfkeys{/pgf/fpu/output format=sci}
\pgfmathparse{5cm^2}
%\show\pgfmathresult % -> 2.0238983e4.
% Both of these give error:
\pgfmathsetlengthmacro\x{5mm^2}
\pgfmathsetlengthmacro\x{5^2}
\pgfkeys{/pgf/fpu=false}
\end{document}
Error msg:
! Illegal unit of measure (pt inserted).
<to be read again>
e
l.10 \pgfmathsetlengthmacro\x{5mm^2}
\pgfmathsetlengthmacrocall. – egreg Oct 01 '12 at 14:53fpulibrary and I think]is doing something similar to\relax. You have to use\pgfmathprintnumberto convert it to the human-readable form. – percusse Oct 01 '12 at 14:56! Dimension too large.for both of the examples in part 2, probably because5 cmcomes out 'too big' inpt. – Joseph Wright Oct 01 '12 at 15:09