title: negative log result in c
body: <p>I need to get the natural log of a number (between 0 and 1) in C. But the natural log function  in C gives an undefined error if the result is negative.</p>
  
  <p>What is the way around this?</p>
  
  <p>EDIT: Sorry folks , my code had flipped the input and output , and I wasn't able to spot it , thanks for the quick help, sorry for my obvious stupidity!</p>