Does anyone know why this is happening and whether it can be fixed. I compare the results with C and PHP, but PHP gives me different results.
I can provide some code if necessary, but has anyone experienced this before?
thank
Php code
$ 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
C code
double tempnum = 1.0e - 5 * -44954;
double bstar = tempnum / pow (10.0, 3);
printf bstar gives me -0.000450
Thanks for your answers so far, but how does PHP come to this conclusion ...
$ 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
, PHP.
user586028