aspose file tools*
The moose likes Beginning Java and the fly likes java.math Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java.math" Watch "java.math" New topic
Author

java.math

Olivier Legat
Ranch Hand

Joined: Nov 17, 2007
Posts: 176

Is there any imports in java that I can use to perform functions like logarithms, e^x, cos, sin, tan, square root ... etc. I've looked up the java sun webpage at the import java.math but the only useful thing I found was pow(int expo). Is there any way I can get those other complex functions? I really need them. Just the name of an import would be very much appreciated.


Olly
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

Most of the basic math functions, such as cos, sin, tan, acos, asin, atan, etc should be inside the math package. If you're looking for a very complex math functions, should can take a look at http://commons.apache.org/math/


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Balasubramanian Chandrasekaran
Ranch Hand

Joined: Nov 28, 2007
Posts: 215

Originally posted by Olivier Legat:
Is there any imports in java that I can use to perform functions like logarithms, e^x, cos, sin, tan, square root ... etc. I've looked up the java sun webpage at the import java.math but the only useful thing I found was pow(int expo). Is there any way I can get those other complex functions? I really need them. Just the name of an import would be very much appreciated.


You already got the answer for your question. Please take a close look at the methods in java.lang.math(which you stated as your subject)

Here is the link which you already come through.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
Originally posted by Balasubramanian Chandrasekaran:
You already got the answer for your question. Please take a close look at the methods in java.lang.math(which you stated as your subject)

Actually, he hasn't found what he's looking for. Note that he mentioned the java.math package (which doesn't have trigonometric functions). The functions he's looking for are in the java.lang.Math class as you pointed out.


Ping & DNS - my free Android networking tools app
Olivier Legat
Ranch Hand

Joined: Nov 17, 2007
Posts: 176

Oh great! Thanks Ulf Dittmer, this is exactly what I need
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java.math