title: Why this function returns 0 instead of a double?
body: <p>I was testing a code and I don't understand why it prints "The higher value is 0".
  This is the main function:</p>
  
  <pre><code>int main() {
      double a,b,c;
      a=576;
      b=955;
      c=higher(a,b);
      printf("The higher value is %g\n", c);
      return 0;
  }
  </code></pre>
  
  <p>and in another .c I have this function:</p>
  
  <pre><code>double higher(double a, double b){
      if (a&gt;b)
          return a;
      return b;
  }
  </code></pre>
  
  <p>NOTE: if I put higher() in main.c it works correctly, but in that way it tells me the higher value is 0. It also works if I cast the return in higer() like this:</p>
  
  <pre><code>return (int)b;
  </code></pre>
  
  <p>Is there a difference if a function that returns a double is in the same .c as main() or in a different one?</p>