\documentclass[border=3mm, varwidth]{standalone}
\usepackage{tikz, amsmath}
\usepgflibrary{fpu}
% Das braucht man scheints:
\pgfkeys{/pgf/fpu/handlers/invalid number/.code={%
\pgfmathfloatparsenumber{3Y0.0e0]}%
}
}
\begin{document}
$\begin{array}{c | c}
\text{Flag} & \text{Meaning} \\ \hline
0 & 0 \\
1 & \text{positive} \\
2 & \text{negative} \\
3 & \text{NaN} \\
4 & \infty \\
5 & -\infty \\
\end{array}$
%Beispiel:
%\pgfmathfloatparsenumber{123.52}
%\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E}
%Flag: \F; Mantissa \M; Exponent \E
%$\to$ \pgfmathfloattofixed{\pgfmathresult} \pgfmathresult
\newcommand\foo[1]{
\pgfmathfloatparsenumber{#1}
\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E}
\pgfmathparse{\F==0 ? "$#1$ is zero" : (
\F==1 ? "$#1$ is positive" : (
\F==2 ? "$#1$ is negative" : (
\F==3 ? "$#1$ is a string (NaN)" : (
\F==4 ? "$\infty$" : (
\F==5 ? "$-\infty$" : ("I do not know"
))))))}\pgfmathresult}
\foreach \Test in {1,-1,0,1.23,a,sin(30)}{\foo{\Test} \\}
Aber: % \foo{\frac32} % error
Ich glaube mit \usetikzlibrary{math} könnte das gehen.Vielleicht irgendwie damit
https://tex.stackexchange.com/a/168018/46023