Hi there!
We have C code (running on the S12) to verify, which makes heavy use of 32 bit floating point arithmetic.
The problem is that after exploring the floating point library the Codewarriors development studio has, we do not find any way to detect float overflows. Any help appreciated. Thanks in advance.
If it was C99, then you could use standard macros from math.h: fpclassify(), isfinite(), isnan() etc. Unfortunately these macros are not available in CW.
I think is_special() function defined in "\Program Files\Freescale\CodeWarrior for S12(X) V5.0\lib\hc12c\src\Math.c" is what you want. Function is static, so you can't call it directly from your code. But you may look at it to see how you can detect if your number is not a number (is_special_nan), positive infinity (is_special_inf ) or negative infinity (is_special_minf).
Also you may want to clear errno before math function calls and check if errno zero after function calls. Possible errno errors are defined in errno.h