#### File: rt_nonfinite.c
        1   /*
        2    * File: rt_nonfinite.c
        3    *
        4    * MATLAB Coder version            : 3.4
        5    * C/C++ source code generated on  : 27-Feb-2019 07:49:44
        6    */
        7
        8   /*
        9    * Abstract:
       10    *      MATLAB for code generation function to initialize non-finites,
       11    *      (Inf, NaN and -Inf).
       12    */
       13   #include "rt_nonfinite.h"
       14   #include "rtGetNaN.h"
       15   #include "rtGetInf.h"
       16
       17   real_T rtInf;
       18   real_T rtMinusInf;
       19   real_T rtNaN;
       20   real32_T rtInfF;
       21   real32_T rtMinusInfF;
       22   real32_T rtNaNF;
       23
       24   /* Function: rt_InitInfAndNaN ==================================================
       25    * Abstract:
       26    * Initialize the rtInf, rtMinusInf, and rtNaN needed by the
       27    * generated code. NaN is initialized as non-signaling. Assumes IEEE.
       28    */
       29   void rt_InitInfAndNaN(size_t realSize)
       30   {
       31     (void) (realSize);
       32     rtNaN = rtGetNaN();
       33     rtNaNF = rtGetNaNF();
       34     rtInf = rtGetInf();
       35     rtInfF = rtGetInfF();
       36     rtMinusInf = rtGetMinusInf();
       37     rtMinusInfF = rtGetMinusInfF();
       38   }
       39
       40   /* Function: rtIsInf ==================================================
       41    * Abstract:
       42    * Test if value is infinite
       43    */
       44   boolean_T rtIsInf(real_T value)
       45   {
       46     return ((value==rtInf || value==rtMinusInf) ? 1U : 0U);
       47   }
       48
       49   /* Function: rtIsInfF =================================================
       50    * Abstract:
       51    * Test if single-precision value is infinite
       52    */
       53   boolean_T rtIsInfF(real32_T value)
       54   {
       55     return(((value)==rtInfF || (value)==rtMinusInfF) ? 1U : 0U);
       56   }
       57
       58   /* Function: rtIsNaN ==================================================
       59    * Abstract:
       60    * Test if value is not a number
       61    */
       62   boolean_T rtIsNaN(real_T value)
       63   {
       64
       65   #if defined(_MSC_VER) && (_MSC_VER <= 1200)
       66
       67     return _isnan(value)? TRUE:FALSE;
       68
       69   #else
       70
       71     return (value!=value)? 1U:0U;
       72
       73   #endif
       74
       75   }
       76
       77   /* Function: rtIsNaNF =================================================
       78    * Abstract:
       79    * Test if single-precision value is not a number
       80    */
       81   boolean_T rtIsNaNF(real32_T value)
       82   {
       83
       84   #if defined(_MSC_VER) && (_MSC_VER <= 1200)
       85
       86     return _isnan((real_T)value)? true:false;
       87
       88   #else
       89
       90     return (value!=value)? 1U:0U;
       91
       92   #endif
       93
       94   }
       95
       96   /*
       97    * File trailer for rt_nonfinite.c
       98    *
       99    * [EOF]
      100    */
      101