posted 9 years ago

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

posted 9 years ago

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

posted 9 years ago

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.

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

Rancher

Posts: 42970

73

posted 9 years ago

Actually, he hasn't found what he's looking for. Note that he mentioned the

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.