Click to See Complete Forum and Search --> : Exponent difficulty


exasko
07-24-2003, 07:21 PM
I started teaching myself PHP a few days ago, and have run into what seems a ridiculously simple problem.

In one of my scripts, I need to take a variable to a power. The output however is not correct, and I can not figure out where I went wrong. The script is below, I would appreciate anyone's help.

$pvi2=$pvi1^5;

When I set $pvi1=2, the output I receive is 7 (of course, it should be 32). Am I using the wrong notation? Any ideas?

Da Warriah
07-24-2003, 07:25 PM
well, i cant say ive tried using exponents myself, but something here (http://ca2.php.net/manual/en/ref.math.php) should help you...

exasko
07-24-2003, 07:34 PM
pow(2,5) = 2^5

thanks man, that link answered a question i've been trying to for 30 minutes.