Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a java programmer. But I have a doubt regarding a mathematics. There was a method called Math.exp(double a) description:Returns Euler's number e raised to the power of a double value. and another method Math.pow(double a, double b) description:Returns the value of the first argument raised to the power of the second argument.. But I am confused what is the difference between the two. I am 15 years and we were told in school that both are the same. But here it seems to be different. Can anyone clear my doubt?

share|cite|improve this question
up vote 6 down vote accepted

Euler's number, $e \approx 2.71828$, is very important in many fields of mathematics. An important function that uses this constant is $\exp x = e^x$.

However, $\operatorname{pow}(a, b) = a^b$, a more general case.

You will notice that, if $a=e$,

Math.pow(Math.E, x)

is the same as


Once you are familiar with more properties of $e^x$, you will also note that

Math.exp(b * Math.log (a))

is the same as

Math.pow(a, b)
share|cite|improve this answer
thanks for solving by doubt .... I am having my exam today! – Pranit Bauva Dec 3 '12 at 3:44

The first one computes $e^a$ while the second computes $a^b$. The first is a special case of the second where $a = e$.

share|cite|improve this answer
In other words, the exponential function $e^a$ has one argument, where the power function $a^b$ allows for two arguments. The exponential function can be viewed as a special case of the second one, and mathematically the exponential function has a nice property for calculus. – hardmath Dec 2 '12 at 17:00
Analogously $\rm\: double(y) := 2y\:$ is $\rm\:times(x,y) := xy\:$ restricted to $\rm\:x = 2.\ \ $ – Bill Dubuque Dec 2 '12 at 17:49

Any operation of power needs two argument base and index. in case of method Math.exp(double a) it has already two exp. means "e" which has value approx.2.71.. and in case of method Math.pow(double a, double b) you have two user inputted argument a and b.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.