Using a related answer about fpu formatting, I was able to use \ifnum
in the case that my result was within the range of an int() [−16383.9998, +16383.9998]. The trick is to use \pgfmathfloattofixed
on the \pgfmathresult
.
\pgfkeys{/pgf/fpu=true}\pgfmathparse{...do floating point math here (with an int() result)...}\pgfmathfloattofixed{\pgfmathresult} % this allows the conversion with int()\edef\tmp{\pgfmathresult}\pgfkeys{/pgf/fpu=false}\pgfmathsetmacro\iTmp{int(\tmp)} % convert with int()\ifnum \iTmp>0 ... do stuff ...\fi