Author
how to calculate e ^3 using Math.pow
sarah sturgeon
Greenhorn
Joined: Aug 27, 2011
Posts: 11
posted Aug 28, 2011 23:40:43
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: 18541
posted Aug 28, 2011 23:53:02
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: 38467
posted Aug 29, 2011 14:50:02
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 Aug 29, 2011 15:21:20
0

You can use this e.g:
System.out.println( Math.E+"");
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4530
posted Aug 29, 2011 15:59:39
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 Aug 29, 2011 16:02:59
0

Math.pow(Math.E,3);
is working fine for me.
Mike Simmons
Ranch Hand
Joined: Mar 05, 2008
Posts: 3012
posted Aug 29, 2011 17:24:53
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: 38467
posted Aug 30, 2011 08:59:07
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