Page 1 of 1

Math potency in PHP

Posted: Mon Jan 31, 2011 3:38 am
by asai
Hi
I am trying to insert this code in a PHP file:

Code: Select all

$answer = (5.545*($a^0.3732)/($e^0.20442));
But the answer gets wrong.
Is the sign for potency correct or is it another way to do this?

Re: Math potency in PHP

Posted: Mon Jan 31, 2011 4:27 am
by klevis miho
I don't know what potency means, but I know that the sign "^" is the square of (2^3 = 2x2x2)

Re: Math potency in PHP

Posted: Mon Jan 31, 2011 5:31 am
by Weirdan
^ operator is used for exclusive OR (bitwise operator). To raise a number to a power you need to use pow() function.