Author 
how to calculate e ^3 using Math.pow

sarah sturgeon
Greenhorn
Joined: Aug 27, 2011
Posts: 11

posted
0

Hi everybody
I want to calculate e^3 using Math.pow
I understand that I can do the following :
Math.pow (2.718,3) where 2.718 is the value of " e"
Is there anyway i can use " e" rather than its value for better accuracy e.g Math.pow( e,3) ?
Thanks and have a great a weekend.


Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 18651

posted
2

Indeed there is. Check out the documentation for the Math class and you should find it near the top.


Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 39393

posted
0

. . . and if you go through the whole of the Math class, you find how you can dispense with the value of e altogether.


Nelson Jumbo
Greenhorn
Joined: Aug 29, 2011
Posts: 4

posted
0

You can use this e.g:
System.out.println( Math.E+"");


Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4640

posted
0

1. How does that help to get e^3?
2. To print the value of Math.E, it's unnecessary to concatenate it to an empty String.

luck, db
There are no new questions, but there may be new answers.


Nelson Jumbo
Greenhorn
Joined: Aug 29, 2011
Posts: 4

posted
0

Math.pow(Math.E,3);
is working fine for me.


Mike Simmons
Ranch Hand
Joined: Mar 05, 2008
Posts: 3018

posted
0

. . . and if you go through the whole of the Math class, you find how you can dispense with the value of e altogether.


Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 39393

posted
0

Mike Simmons wrote:. . . and if you go through the whole of the Math class, you find how you can dispense with the value of e altogether.
There is something familiar about that post, but I can't quite put my finger on it




subject: how to calculate e ^3 using Math.pow

