Link to home
Create AccountLog in
Avatar of DOCDGA
DOCDGA

asked on

Java Math question

I am having problems solving this math problem. I am doing this for fun.  The answer is 13.0 but I don't understand I how they came up with the solution.

7 - 2 + Math.log10(1000) + Math.log(Math.pow(Math.E, 5))

I understand

7 -2 + Math.log10(1000) = 8

I not sure if about the second half of the problem.

Math.log(Math.pow(Math.E, 5)

Is the 5 that is used to raise E to the fifth power? The same 5 added to 8.

If so can someone explain this to me?

Thanks for your help.
ASKER CERTIFIED SOLUTION
Avatar of d-glitch
d-glitch
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
http://docs.oracle.com/javase/7/docs/api/java/lang/Math.html#log(double)
http://docs.oracle.com/javase/7/docs/api/java/lang/Math.html#E
and
http://docs.oracle.com/javase/7/docs/api/java/lang/Math.html#pow(double, double)

have pretty good explanation of both log and pow (and how the result of the whole thing end up being the second parameter of the pow :)

PS: d-glitch got it - I am just throwing a couple of links to help with the understanding. :)
Avatar of DOCDGA
DOCDGA

ASKER

Thanks d-glitch for the explanation. I wasn't sure.

Also thanks to Venablili!!!