title: Strange Numerical Behaviour of gcc Linker
body: <p>I have a problem with as simple a C code as the following:</p>
  
  <pre><code>#include &lt;math.h&gt;
  #include &lt;stdio.h&gt;
  
  int main () {
      printf ("%f\n", exp(1));
  }
  </code></pre>
  
  <p>Replacing <code>1</code> with numbers smaller than <code>710</code> results in a successful compilation with the expected effect, but for numbers higher than that  , I get a linker error, of all things:</p>
  
  <pre><code>/tmp/ccqVnsno.o: In function `main': 
  test.c:(.text+0x1c): undefined reference to `exp'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>I have tested this for numbers under 1000 with the following bash script:</p>
  
  <pre><code>for i in {0..1000}; do
      sed -i -r "s:[0-9]+:${i}:" test.c
      gcc -o test test.c
      ./test
  done
  </code></pre>
  
  <p>Putting the <code>printf</code> statements in a for loop with <code>exp</code> of the index variable results in the same linkage error, regardless of upper bound.</p>
  
  <p>What's going on here? Is the compiler recognizing 710 as some sort of limit for <code>long double</code>? Then why is the linker catching the error? Sorry for credulity, I'm new to C.</p>