#include "rtwtypes.h" #include "rtGetNaN.h" #include #include "rt_nonfinite.h" #define NumBitsPerChar 8U real_T rtGetNaN(void) { size_t bitsPerReal = sizeof(real_T) * (NumBitsPerChar); real_T nan = 0.0; if (bitsPerReal == 32U) { nan = rtGetNaNF(); } else { union { LittleEndianIEEEDouble bitVal; real_T fltVal; } tmpVal; tmpVal.bitVal.words.wordH = 0xFFF80000U; tmpVal.bitVal.words.wordL = 0x00000000U; nan = tmpVal.fltVal; } return nan; } real32_T rtGetNaNF(void) { IEEESingle nanF = { { 0.0F } }; nanF.wordL.wordLuint = 0xFFC00000U; return nanF.wordL.wordLreal; }