# Can't use “if” in tikzmath - undefined control sequence “ifpgfmathfloatparseactive”

MWE (copied from TikZ manual):

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{math}

\begin{document}
\begin{tikzpicture}
\tikzmath{
int \x;
for \k in {0,10,...,350}{
if \k>260 then { let \c = orange; } else {
if \k>170 then { let \c = blue; } else {
if \k>80 then { let \c = red; } else {
let \c = green; }; }; };
{
\path [fill=\c!50, draw=\c] (\k:0.5cm) -- (\k:1cm) --
(\k+5:1cm) -- (\k+5:0.5cm) -- cycle;
};
};
}
\end{tikzpicture}
\end{document}


This gives me the following error message:

! Undefined control sequence.
\tikz@math@if@@doifelse ...gfmathfloatparseactive
\pgfmathfloattofixed {\pgf...
l.19   }


I have the same problem with other code that uses if in tikzmath and this also applies to TeX files that used to compile without problems some time ago. Is the current (MiKTeX) version of TikZ broken?

I'm using MikTeX 2.9 on Windows 10, packages have been updated a few minutes ago, just in case.

UPDATE: Just to make this clearer - even this simple tikzmath code gives the same error message.

\tikzmath{
\x = 42;
if \x == 42 then {
{\fill (0,0) circle (1cm);};
};
}

• Yes, there is something odd going on here. As far as I can see, \x, which was declared in int \x;, is not used here either. – user121799 Feb 21 at 19:31
• The \x is not the problem. The error message occurs whenever if is used. See my update. – Frunobulax Feb 21 at 19:41
• Yes. I did not claim the \x was the problem. This was just to substantiate something is odd here. – user121799 Feb 21 at 19:46

\usetikzlibrary{fpu}