title: Check if a number is +-Inf or NaN
body: <p>For the robustness reason, I want check if a float number is IEEE-754  +-Inf or  IEEE-754  Nan. My code is in the following, I want know if it is correct:</p>
  
  <pre><code> #define PLUS_INFINITE          (1.0f/0.0f)
   #define MINUS_INFINITE         (-1.0f/0.0f)
   #define NAN                    (0.0f/0.0f)
  
   float Local_Var;
   /*F is a float numnber.*/
   if((unsigned long)(F) == 0x7f800000ul)
     {
      Local_Var = PLUS_INFINITE;
     }
   elseif((unsigned long)(F) == 0xff800000ul)
     {
      Local_Var = MINUS_INFINITE;
     }
     /*fraction = anything except all 0 bits (since all 0 bits represents infinity).*/
   elseif((((unsigned long)(F) &amp; 0x007ffffful) != 0ul )
           &amp;&amp;((unsigned long)(F) == 0x7f800000ul))
          || 
          (((unsigned long)(F) &amp; 0x807ffffful) != 0ul )
          &amp;&amp;
          ((unsigned long)(F) == 0xff800000ul))
     {
      Local_Var = NAN; 
     }
     else{}
  </code></pre>