#### File: rtGetInf.c
        1   /*
        2    * File: rtGetInf.c
        3    *
        4    * MATLAB Coder version            : 3.4
        5    * C/C++ source code generated on  : 18-Feb-2019 15:40:18
        6    */
        7
        8   /*
        9    * Abstract:
       10    *       MATLAB for code generation function to initialize non-finite, Inf and MinusInf
       11    */
       12   #include "rtGetInf.h"
       13   #define NumBitsPerChar                 8U
       14
       15   /* Function: rtGetInf ==================================================
       16    * Abstract:
       17    * Initialize rtInf needed by the generated code.
       18    * Inf is initialized as non-signaling. Assumes IEEE.
       19    */
       20   real_T rtGetInf(void)
       21   {
       22     real_T inf = 0.0;
       23     uint16_T one = 1U;
       24     enum {
       25       LittleEndian,
       26       BigEndian
       27     } machByteOrder = (*((uint8_T *) &one) == 1U) ? LittleEndian : BigEndian;
       28     switch (machByteOrder) {
       29      case LittleEndian:
       30       {
       31         union {
       32           LittleEndianIEEEDouble bitVal;
       33           real_T fltVal;
       34         } tmpVal;
       35
       36         tmpVal.bitVal.words.wordH = 0x7FF00000U;
       37         tmpVal.bitVal.words.wordL = 0x00000000U;
       38         inf = tmpVal.fltVal;
       39         break;
       40       }
       41
       42      case BigEndian:
       43       {
       44         union {
       45           BigEndianIEEEDouble bitVal;
       46           real_T fltVal;
       47         } tmpVal;
       48
       49         tmpVal.bitVal.words.wordH = 0x7FF00000U;
       50         tmpVal.bitVal.words.wordL = 0x00000000U;
       51         inf = tmpVal.fltVal;
       52         break;
       53       }
       54     }
       55
       56     return inf;
       57   }
       58
       59   /* Function: rtGetInfF ==================================================
       60    * Abstract:
       61    * Initialize rtInfF needed by the generated code.
       62    * Inf is initialized as non-signaling. Assumes IEEE.
       63    */
       64   real32_T rtGetInfF(void)
       65   {
       66     IEEESingle infF;
       67     infF.wordL.wordLuint = 0x7F800000U;
       68     return infF.wordL.wordLreal;
       69   }
       70
       71   /* Function: rtGetMinusInf ==================================================
       72    * Abstract:
       73    * Initialize rtMinusInf needed by the generated code.
       74    * Inf is initialized as non-signaling. Assumes IEEE.
       75    */
       76   real_T rtGetMinusInf(void)
       77   {
       78     real_T minf = 0.0;
       79     uint16_T one = 1U;
       80     enum {
       81       LittleEndian,
       82       BigEndian
       83     } machByteOrder = (*((uint8_T *) &one) == 1U) ? LittleEndian : BigEndian;
       84     switch (machByteOrder) {
       85      case LittleEndian:
       86       {
       87         union {
       88           LittleEndianIEEEDouble bitVal;
       89           real_T fltVal;
       90         } tmpVal;
       91
       92         tmpVal.bitVal.words.wordH = 0xFFF00000U;
       93         tmpVal.bitVal.words.wordL = 0x00000000U;
       94         minf = tmpVal.fltVal;
       95         break;
       96       }
       97
       98      case BigEndian:
       99       {
      100         union {
      101           BigEndianIEEEDouble bitVal;
      102           real_T fltVal;
      103         } tmpVal;
      104
      105         tmpVal.bitVal.words.wordH = 0xFFF00000U;
      106         tmpVal.bitVal.words.wordL = 0x00000000U;
      107         minf = tmpVal.fltVal;
      108         break;
      109       }
      110     }
      111
      112     return minf;
      113   }
      114
      115   /* Function: rtGetMinusInfF ==================================================
      116    * Abstract:
      117    * Initialize rtMinusInfF needed by the generated code.
      118    * Inf is initialized as non-signaling. Assumes IEEE.
      119    */
      120   real32_T rtGetMinusInfF(void)
      121   {
      122     IEEESingle minfF;
      123     minfF.wordL.wordLuint = 0xFF800000U;
      124     return minfF.wordL.wordLreal;
      125   }
      126
      127   /*
      128    * File trailer for rtGetInf.c
      129    *
      130    * [EOF]
      131    */
      132