my dog learned polymorphism
The moose likes Beginning Java and the fly likes Mathematic function? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Mathematic function?" Watch "Mathematic function?" New topic

Mathematic function?

sahar sa
Ranch Hand

Joined: Jul 06, 2009
Posts: 102
Dear friends,
I need to code a formula which contains Natural logarithm and "e" power 3 for example. by e I mean the transcendental number which is around 2.71 ... .
Is there any constant in java as "e" or no?
Is there any function that can calculates Ln (natural logarithm)?
do you know any source that can help me?
Thank you so much,
Henry Wong

Joined: Sep 28, 2004
Posts: 20373



Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Jelle Klap

Joined: Mar 10, 2008
Posts: 1950

Have a look at java.lang.Math.

Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
David Newton

Joined: Sep 29, 2008
Posts: 12617

And if there wasn't already such a thing, just *type it in* and set it to a variable.
subject: Mathematic function?
It's not a secret anymore!