title: Why is PHP float division and POW giving wrong results and unexpected results?
body: <p>Does anyone know why this happens and if it can be fixed. I'm comparing results from C and PHP, but PHP is giving me different results.</p>
  
  <p>I can supply some code if needed but has anyone experienced this before?</p>
  
  <p>PHP code</p>
  
  <pre>
  $tempnum = 1.0e - 5 * -44954; // substr($line1,53,6);
  $bstar = $tempnum / pow(10.0, 3);
  
  $bstar gives me -0.00044954 in PHP but it should be -0.000450
  </pre>
  
  <p>C code</p>
  
  <pre>
  double tempnum = 1.0e - 5 * -44954;
  double bstar = tempnum / pow(10.0, 3);
  
  printf bstar gives me -0.000450
  </pre>
  
  <p>Thanks for your responses so far, but how does PHP come to this conclusion...</p>
  
  <pre>
  $twopi =        6.28318530717958623;    /* 2*Pi  */
  $xmnpda=        1440; //1.44E3  ;       /* Minutes per day */
  
  $temp = (($twopi/$xmnpda)/$xmnpda);
  
  $xndt2o = -0.000603;
  $xndt2o = $xndt2o * $temp;
  
  echo $xndt2o gives me -1.8256568188E-9 in PHP but in C it gives me -0.000000
  </pre>
  
  <p>I don't know what all that is about in PHP.</p>