[PHP] Mathematical differences?!

2003-09-18 Thread Mario Werner
Hello all, I ported a algorithm from JavaScript to PHP and noticed that PHP outputs a different result than JS. For example: t = 0.6255264658909423 f = 20.5 ln = -6.983 d2r = 0.017453292519943295 $ra = (((6.6460656 + 2400.0513 * $t + 2.58e-5 * $t * $t +

RE: [PHP] Mathematical differences?!

2003-09-18 Thread Jay Blanchard
[snip] How could that be?! 1:1 the same code but different outputs? Is this a PHP-bug? :-? [/snip] *feelin' kinda' smart arsed today, if no one noticed* Maybe it was a JavaScipt bug all along ? ;) Actually I am worried about the order of operations and encapsulation in the equation in $ra,

Re: [PHP] Mathematical differences?!

2003-09-18 Thread Curt Zirzow
* Thus wrote Mario Werner ([EMAIL PROTECTED]): I ported a algorithm from JavaScript to PHP and noticed that PHP outputs a different result than JS. For example: t = 0.6255264658909423 f = 20.5 ln = -6.983 d2r = 0.017453292519943295 $ra =

Re: [PHP] Mathematical differences?!

2003-09-18 Thread Dan Anderson
Without spending a lot of time looking at your problem I would speculate this is the result of round off error. What is roundoff error you ask? Well the number 0.6255264658909423 does not designate 0.6255264658909423... but 0.6255264658909423 and some fraction that could not be