title: log function misbehaviour!!! Any clue?
body: <p>I am writing some program in C. It has a part where it does some probability calculations, where I am using log function. normal library function log()...</p>
  
  <p>The code is something like this</p>
  
  <pre><code>double somevalue = 0.29558101472995091;
  temp = log(somevalue)
  </code></pre>
  
  <p>And guess what? The temp gets value -1856.0000000000000!!!</p>
  
  <p>As the value given for log was inside some struct I wrote this test code too, and got the same results... </p>
  
  <pre><code>int main()
  {
      double somevalue;
      double temp;
  
      somevalue = 0.29558101472995091;
      temp = log(somevalue);
      return 0;
  }
  
  Results:
  Somevalue = 0.29558101472995091
  temp = -1856.0000000000000
  </code></pre>
  
  <p>Isn't it crazy. Anyone has some clue on whats going on here. </p>
  
  <p><strong>And I am using Visual Studio 2005 for this. Can't get my hands on someother compiler now.</strong></p>
  
  <p>Thanks,</p>
  
  <p>Microkernel :)</p>