public final class Math extends Object
Modifier and Type | Method and Description |
---|---|
static double |
abs(double a)
Returns the absolute value of a double value.
|
static float |
abs(float a)
Returns the absolute value of a float value.
|
static int |
abs(int a)
Returns the absolute value of an integer value.
|
static long |
abs(long a)
Returns the absolute value of a long value.
|
static double |
acos(double a)
Inverse cosine function.
|
static double |
asin(double a)
Inverse sine function.
|
static double |
atan(double x)
The inverse tangent function.
|
static double |
atan2(double y,
double x)
The inverse tangent function.
|
static double |
ceil(double a)
Returns the smallest (closest to negative infinity) double value that is
not less than the argument and is equal to a mathematical integer.
|
static double |
cos(double x)
Cosine function.
|
static double |
exp(double x)
Exponential function.
|
static double |
floor(double a)
Returns the largest (closest to positive infinity) double value that is
not greater than the argument and is equal to a mathematical integer.
|
static double |
log(double x)
Natural log function.
|
static double |
log10(double x)
Returns the base 10 logarithm of a
double value. |
static double |
max(double a,
double b)
Returns the greater of two double values.
|
static float |
max(float a,
float b)
Returns the greater of two float values.
|
static int |
max(int a,
int b)
Returns the greater of two integer values.
|
static long |
max(long a,
long b)
Returns the greater of two long values.
|
static double |
min(double a,
double b)
Returns the lesser of two double values.
|
static float |
min(float a,
float b)
Returns the lesser of two float values.
|
static int |
min(int a,
int b)
Returns the lesser of two integer values.
|
static long |
min(long a,
long b)
Returns the lesser of two long values.
|
static double |
pow(double a,
double b)
Power function.
|
static double |
random()
Random number generator.
|
static double |
rint(double a)
Returns the closest mathematical integer to the argument.
|
static long |
round(double a)
Returns the closest long to the argument.
|
static int |
round(float a)
Returns the closest int to the argument.
|
static double |
signum(double d)
Returns -1, 1 or 0 depending on the sign of f.
|
static float |
signum(float f)
Returns -1, 1 or 0 depending on the sign of f.
|
static double |
sin(double x)
Sine function.
|
static double |
sqrt(double x)
Computes square-root of x.
|
static double |
tan(double x)
Tangent function.
|
static double |
toDegrees(double angrad)
Converts radians to degrees.
|
static double |
toRadians(double angdeg)
Converts degrees to radians.
|
public static final double E
public static final double PI
public static double abs(double a)
public static float abs(float a)
public static int abs(int a)
public static long abs(long a)
public static double acos(double a)
public static double asin(double a)
public static double atan(double x)
public static double atan2(double y, double x)
public static double ceil(double a)
public static double cos(double x)
public static double exp(double x)
public static double floor(double a)
public static double log(double x)
public static double log10(double x)
double
value.public static double max(double a, double b)
public static float max(float a, float b)
public static int max(int a, int b)
public static long max(long a, long b)
public static double min(double a, double b)
public static float min(float a, float b)
public static int min(int a, int b)
public static long min(long a, long b)
public static double pow(double a, double b)
public static double random()
public static double rint(double a)
public static long round(double a)
public static int round(float a)
public static double signum(double d)
public static float signum(float f)
public static double sin(double x)
public static double sqrt(double x)
public static double tan(double x)
public static double toDegrees(double angrad)
public static double toRadians(double angdeg)