aspose file tools*
The moose likes Beginning Java and the fly likes how to calculate e ^3 using Math.pow Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to calculate e ^3 using Math.pow" Watch "how to calculate e ^3 using Math.pow" New topic
Author

how to calculate e ^3 using Math.pow

sarah sturgeon
Greenhorn

Joined: Aug 27, 2011
Posts: 11
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: 18987
    
    8

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: 40052
    
  28
. . . 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

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

Joined: May 03, 2008
Posts: 4664
    
    5

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

Math.pow(Math.E,3);

is working fine for me.

Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 3018
    
  10
. . . 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: 40052
    
  28
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to calculate e ^3 using Math.pow