title: Convert void* to double
body: <p>I am attempting to use the <code>pthread</code> library to calculate <code>n</code> fibonacci numbers where <code>n</code> can be from range <code>0-1000</code>. I am running in to a weird error when I try to typecast my <code>void*</code> to a <code>double</code>.</p>
  
  <p>In my main here is my call to my calculate fibonacci function:</p>
  
  <pre><code>pthread_create(&amp;tid, &amp;attr, calc_fib, (void *)n);
  </code></pre>
  
  <p>In my <code>calc_fib</code> function I am attempting to typecast with:</p>
  
  <pre><code>void *calc_fib( void *num)
  {
      double n;
      n = (double)num;
      ...
  </code></pre>
  
  <p>However, when I attempt to do this I get the following errors:</p>
  
  <pre><code>In function ‘calc_fib’:
  error: pointer value used where a floating point value was expected
  In function ‘main’:
  error: cannot convert to a pointer type
  </code></pre>
  
  <p>Am I not able to typecast from <code>void*</code> to <code>double</code> in C or am I just doing it wrong?</p>