|
JMSLTM Numerical Library 4.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.imsl.math.JMath
Pure Java implementation of the standard java.lang.Math class. This Java code is based on C code in the package fdlibm, which can be obtained from www.netlib.org.
Field Summary | |
static double |
E
|
static double |
PI
|
Method Summary | |
static double |
abs(double x)
Returns the absolute value of a double . |
static float |
abs(float x)
Returns the absolute value of a float . |
static int |
abs(int x)
Returns the absolute value of an int . |
static long |
abs(long x)
Returns the absolute value of a long . |
static double |
acos(double x)
Returns the inverse (arc) cosine of a double . |
static double |
asin(double x)
Returns the inverse (arc) sine of a double . |
static double |
atan(double x)
Returns the inverse (arc) tangent of a double . |
static double |
atan2(double y,
double x)
Returns the angle corresponding to a Cartesian point. |
static double |
ceil(double x)
Returns the value of a double rounded toward
positive infinity to an integral value. |
static double |
cos(double x)
Returns the cosine of a double . |
static double |
exp(double x)
Returns the exponential of a double . |
static double |
floor(double x)
Returns the value of a double rounded toward
negative infinity to an integral value. |
static double |
IEEEremainder(double x,
double p)
Returns the IEEE remainder from x divided by p. |
static double |
log(double x)
Returns the natural logarithm of a double . |
static double |
max(double x,
double y)
Returns the larger of two double s. |
static float |
max(float x,
float y)
Returns the larger of two float s. |
static int |
max(int x,
int y)
Returns the larger of two int s. |
static long |
max(long x,
long y)
Returns the larger of two longs . |
static double |
min(double x,
double y)
Returns the smaller of two double s. |
static float |
min(float x,
float y)
Returns the smaller of two float s. |
static int |
min(int x,
int y)
Returns the smaller of two int s. |
static long |
min(long x,
long y)
Returns the smaller of two long s. |
static double |
pow(double x,
double y)
Returns x to the power y. |
static double |
random()
Returns a random number from a uniform distribution. |
static double |
rint(double x)
Returns the value of a double rounded toward
the closest integral value. |
static long |
round(double x)
Returns the long closest to a given double . |
static int |
round(float x)
Returns the integer closest to a given float . |
static double |
sin(double x)
Returns the sine of a double . |
static double |
sqrt(double x)
Returns the square root of a double . |
static double |
tan(double x)
Returns the tangent of a double . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final double E
public static final double PI
Method Detail |
public static double abs(double x)
double
.
x
- a double
double
representing .public static float abs(float x)
float
.
x
- a float
float
representing .public static int abs(int x)
int
.
x
- an int
int
representing .public static long abs(long x)
long
.
x
- a long
long
representing .public static double acos(double x)
double
.
x
- a double
double
representing the angle, in radians,
whose cosine is x.
It is in the range .public static double asin(double x)
double
.
x
- a double
double
representing the angle, in radians,
whose sine is x.
It is in the range .public static double atan(double x)
double
.
x
- a double
double
representing the angle, in radians,
whose tangent is x.
It is in the range .public static double atan2(double y, double x)
x
- a double
, the first argumenty
- a double
, the second argument
double
representing the angle, in radians,
the the line from (0,0) to (x,y) makes with the x-axis.
It is in the range .public static double ceil(double x)
double
rounded toward
positive infinity to an integral value.
x
- a double
double
, not less than x,
that is an integral valuepublic static double cos(double x)
double
.
x
- a double
, assumed to be in radians
double
, the cosine of xpublic static double exp(double x)
double
.
Special cases:
is , is NaN;
is 0, and
for finite argument, only is exact.
x
- a double
.
double
representing .public static double floor(double x)
double
rounded toward
negative infinity to an integral value.
x
- a double
double
, not greater than x,
that is an integral valuepublic static double IEEEremainder(double x, double p)
x
- a double
, the dividendp
- a double
, the divisor
double
representing the remainder computed
according to the IEEE 754 standard.public static double log(double x)
double
.
x
- a double
double
representing the natural (base e) logarithm of xpublic static double max(double x, double y)
double
s.
x
- a double
y
- a double
double
, the larger of x and y.
This function considers -0.0 to
be less than 0.0.public static float max(float x, float y)
float
s.
x
- a float
y
- a float
float
, the larger of x and y.
This function considers -0.0f to
be less than 0.0f.public static int max(int x, int y)
int
s.
x
- an int
y
- an int
int
, the larger of x and ypublic static long max(long x, long y)
longs
.
x
- a long
y
- a long
long
, the larger of x and ypublic static double min(double x, double y)
double
s.
x
- a double
y
- a double
double
, the smaller of x and y.
This function considers -0.0 to
be less than 0.0.public static float min(float x, float y)
float
s.
x
- a float
y
- a float
float
, the smaller of x and y.
This function considers -0.0f to
be less than 0.0f.public static int min(int x, int y)
int
s.
x
- an int
y
- an int
int
representing the smaller of x and ypublic static long min(long x, long y)
long
s.
x
- a long
y
- a long
long
, the smaller of x and ypublic static double pow(double x, double y)
x
- a double
, the basey
- a double
, the exponent
double
, x to the power ypublic static double random()
double
representing a random number from a
uniform distributionpublic static double rint(double x)
double
rounded toward
the closest integral value.
x
- a double
double
closest to x
that is an integral valuepublic static long round(double x)
long
closest to a given double
.
x
- a double
long
closest to xpublic static int round(float x)
float
.
x
- a float
int
closest to xpublic static double sin(double x)
double
.
x
- a double
, assumed to be in radians
double
, the sine of xpublic static double sqrt(double x)
double
.
x
- a double
double
representing the square root of xpublic static double tan(double x)
double
.
x
- a double
, assumed to be in radians
double
, the tangent of x
|
JMSLTM Numerical Library 4.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |