title: Return error code as double
body: <p>I wonder if I can return error code as double in the following way in C:</p>
  
  <pre><code>double getValue()
  {
      double ret = 0;
  
      if (error1)
      {
          return -1;
      }
      if (error2)
      {
          return -2;
      }
      return ret = ....;
  }
  
  int main(void)
  {
      double val = getValue();
  
      if (-1 == val)
      {
          printf("getValue: error1\n")
          return -1;
      }
      else if (-2 == val)
      {
          printf("getValue: error2\n");
          return -2;
      }
  
      ......
      return 0;
  }
  </code></pre>
  
  <p>so when the return value is >= 0 then it is correct value which can be used for calculations. When value is less than zero error occurred. 
  Will I get the floating-point-comparison problem when I compare return value with -1 or -2 ?</p>