Question:
How To Define A Float Variable To "NaN" In C?
Answer:
There is a function called isnanf() in CCES to test for NaN. This is defined in the "math_21xxx.h" header file which will be automatically called by including "math.h" in our application.
#include <stdio.h>
#include <math.h>
main (void)
{
float flag;
flag = isnanf(10.25);
printf ("isnanf(10.25) = %d (expected 0)\n",flag);
}
Refer the below help page for more information.
CrossCore® Embedded Studio 2.x.x > SHARC® Development Tools Documentation > C/C++ Library Manual for SHARC® Processors > C/C++ Run-Time Library > isnan