/    Sign up×
Community /Pin to ProfileBookmark

Exponent difficulty

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?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@Da_WarriahJul 25.2003 — well, i cant say ive tried using exponents myself, but something [url=http://ca2.php.net/manual/en/ref.math.php]here[/url] should help you...
Copy linkTweet thisAlerts:
@exaskoauthorJul 25.2003 — pow(2,5) = 2^5

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

Success!

Help @exasko spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...