public final class XMath
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static double |
E
Deprecated.
As of release 1.4.4, replaced by
Math.E |
static double |
PI
Deprecated.
As of release 1.4.4, replaced by
Math.PI |
| Modifier and Type | Method and Description |
|---|---|
static double |
abs(double a)
Deprecated.
As of release 1.4.4, replaced by
Math.abs(double) |
static float |
abs(float a)
Deprecated.
As of release 1.4.4, replaced by
Math.abs(float) |
static int |
abs(int a)
Deprecated.
As of release 1.4.4, replaced by
Math.abs(int) |
static long |
abs(long a)
Deprecated.
As of release 1.4.4, replaced by
Math.abs(long) |
static double |
acos(double a)
Deprecated.
As of release 1.4.4, replaced by
Math.acos(double) |
static double |
asin(double a)
Deprecated.
As of release 1.4.4, replaced by
Math.asin(double) |
static double |
atan(double a)
Deprecated.
As of release 1.4.4, replaced by
Math.atan(double) |
static double |
ceil(double a)
Deprecated.
As of release 1.4.4, replaced by
Math.ceil(double) |
static double |
cos(double a)
Deprecated.
As of release 1.4.4, replaced by
Math.cos(double) |
static double |
exp(double a)
Deprecated.
As of release 1.4.4, replaced by
Math.exp(double) |
static double |
floor(double a)
Deprecated.
As of release 1.4.4, replaced by
Math.floor(double) |
static double |
limit(double value,
double min,
double max)
Limits a value between two others:
If
value is lower than min, returns
min.
If value is greater than max, returns
max.
Otherwise, returns value.
|
static float |
limit(float value,
float min,
float max)
Limits a value between two others:
If
value is lower than min, returns
min.
If value is greater than max, returns
max.
Otherwise, returns value.
|
static int |
limit(int value,
int min,
int max)
Limits a value between two others:
If
value is lower than min, returns
min.
If value is greater than max, returns
max.
Otherwise, returns value.
|
static long |
limit(long value,
long min,
long max)
Limits a value between two others:
If
value is lower than min, returns
min.
If value is greater than max, returns
max.
Otherwise, returns value.
|
static double |
log(double a)
Deprecated.
As of release 1.4.4, replaced by
Math.log(double) |
static double |
max(double a,
double b)
Deprecated.
As of release 1.4.4, replaced by
Math.max(double, double) |
static float |
max(float a,
float b)
Deprecated.
As of release 1.4.4, replaced by
Math.max(float, float) |
static int |
max(int a,
int b)
Deprecated.
As of release 1.4.4, replaced by
Math.max(int, int) |
static long |
max(long a,
long b)
Deprecated.
As of release 1.4.4, replaced by
Math.max(long, long) |
static double |
min(double a,
double b)
Deprecated.
As of release 1.4.4, replaced by
Math.min(double, double) |
static float |
min(float a,
float b)
Deprecated.
As of release 1.4.4, replaced by
Math.min(float, float) |
static int |
min(int a,
int b)
Deprecated.
As of release 1.4.4, replaced by
Math.min(int, int) |
static long |
min(long a,
long b)
Deprecated.
As of release 1.4.4, replaced by
Math.min(long, long) |
static double |
pow(double a,
double b)
Deprecated.
As of release 1.4.4, replaced by
Math.pow(double, double) |
static double |
sin(double a)
Deprecated.
As of release 1.4.4, replaced by
Math.sin(double) |
static double |
sqrt(double a)
Deprecated.
As of release 1.4.4, replaced by
Math.sqrt(double) |
static double |
tan(double a)
Deprecated.
As of release 1.4.4, replaced by
Math.tan(double) |
static double |
toDegrees(double angrad)
Deprecated.
As of release 1.4.4, replaced by
Math.toDegrees(double) |
static double |
toRadians(double angdeg)
Deprecated.
As of release 1.4.4, replaced by
Math.toRadians(double) |
@Deprecated public static final double E
Math.Edouble value that is closer than any other to e, the
base of the natural logarithms.@Deprecated public static final double PI
Math.PIdouble value that is closer than any other to pi, the
ratio of the circumference of a circle to its diameter.@Deprecated public static double abs(double a)
Math.abs(double)double value. If the argument is
not negative, the argument is returned. If the argument is negative, the
negation of the argument is returned. Special cases:
Double.longBitsToDouble((Double.doubleToLongBits(a)<<1)>>>1)
a - the argument whose absolute value is to be determined@Deprecated public static float abs(float a)
Math.abs(float)float value. If the argument is
not negative, the argument is returned. If the argument is negative, the
negation of the argument is returned. Special cases:
Float.intBitsToFloat(0x7fffffff & Float.floatToIntBits(a))
a - the argument whose absolute value is to be determined@Deprecated public static int abs(int a)
Math.abs(int)int value. If the argument is
not negative, the argument is returned. If the argument is negative, the
negation of the argument is returned.
Note that if the argument is equal to the value of
Integer.MIN_VALUE, the most negative representable
int value, the result is that same value, which is negative.
a - the argument whose absolute value is to be determinedInteger.MIN_VALUE@Deprecated public static long abs(long a)
Math.abs(long)long value. If the argument is
not negative, the argument is returned. If the argument is negative, the
negation of the argument is returned.
Note that if the argument is equal to the value of
Long.MIN_VALUE, the most negative representable
long value, the result is that same value, which is negative.
a - the argument whose absolute value is to be determinedLong.MIN_VALUE@Deprecated public static double ceil(double a)
Math.ceil(double)double value
that is greater than or equal to the argument and is equal to a mathematical
integer. Special cases:
Math.ceil(x) is exactly the value of
-Math.floor(-x).a - a value.@Deprecated public static double cos(double a)
Math.cos(double)The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
a - an angle, in radians.@Deprecated public static double floor(double a)
Math.floor(double)double value
that is less than or equal to the argument and is equal to a mathematical
integer. Special cases:
a - a value.@Deprecated
public static double max(double a,
double b)
Math.max(double, double)double values. That is, the result is
the argument closer to positive infinity. If the arguments have the same
value, the result is that same value. If either value is NaN, then the result
is NaN. Unlike the numerical comparison operators, this method considers
negative zero to be strictly smaller than positive zero. If one argument is
positive zero and the other negative zero, the result is positive zero.a - an argument.b - another argument.a and b.@Deprecated
public static float max(float a,
float b)
Math.max(float, float)float values. That is, the result is
the argument closer to positive infinity. If the arguments have the same
value, the result is that same value. If either value is NaN, then the result
is NaN. Unlike the numerical comparison operators, this method considers
negative zero to be strictly smaller than positive zero. If one argument is
positive zero and the other negative zero, the result is positive zero.a - an argument.b - another argument.a and b.@Deprecated
public static long max(long a,
long b)
Math.max(long, long)long values. That is, the result is
the argument closer to the value of Long.MAX_VALUE. If the
arguments have the same value, the result is that same value.a - an argument.b - another argument.a and b.Long.MAX_VALUE@Deprecated
public static int max(int a,
int b)
Math.max(int, int)int values. That is, the result is
the argument closer to the value of Integer.MAX_VALUE. If the
arguments have the same value, the result is that same value.a - an argument.b - another argument.a and b.Long.MAX_VALUE@Deprecated
public static double min(double a,
double b)
Math.min(double, double)double values. That is, the result is
the value closer to negative infinity. If the arguments have the same value,
the result is that same value. If either value is NaN, then the result is
NaN. Unlike the numerical comparison operators, this method considers
negative zero to be strictly smaller than positive zero. If one argument is
positive zero and the other is negative zero, the result is negative zero.a - an argument.b - another argument.a and b.@Deprecated
public static float min(float a,
float b)
Math.min(float, float)float values. That is, the result is
the value closer to negative infinity. If the arguments have the same value,
the result is that same value. If either value is NaN, then the result is
NaN. Unlike the numerical comparison operators, this method considers
negative zero to be strictly smaller than positive zero. If one argument is
positive zero and the other is negative zero, the result is negative zero.a - an argument.b - another argument.a and b.@Deprecated
public static int min(int a,
int b)
Math.min(int, int)int values. That is, the result the
argument closer to the value of Integer.MIN_VALUE. If the
arguments have the same value, the result is that same value.a - an argument.b - another argument.a and b.Long.MIN_VALUE@Deprecated
public static long min(long a,
long b)
Math.min(long, long)long values. That is, the result is
the argument closer to the value of Long.MIN_VALUE. If the
arguments have the same value, the result is that same value.a - an argument.b - another argument.a and b.Long.MIN_VALUE@Deprecated public static double sin(double a)
Math.sin(double)The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
a - an angle, in radians.@Deprecated public static double sqrt(double a)
Math.sqrt(double)double
value. Special cases:
double value closest to the true
mathematical square root of the argument value.a - a value.a. If the argument is NaN or
less than zero, the result is NaN.@Deprecated public static double tan(double a)
Math.tan(double)The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
a - an angle, in radians.@Deprecated public static double toDegrees(double angrad)
Math.toDegrees(double)cos(toRadians(90.0)) to
exactly equal 0.0.angrad - an angle, in radiansangrad in degrees.@Deprecated public static double toRadians(double angdeg)
Math.toRadians(double)angdeg - an angle, in degreesangdeg in radians.@Deprecated public static double asin(double a)
Math.asin(double)The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
a - the value whose arc sine is to be returned.@Deprecated public static double acos(double a)
Math.acos(double)The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
a - the value whose arc cosine is to be returned.@Deprecated public static double atan(double a)
Math.atan(double)The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
a - the value whose arc tangent is to be returned.@Deprecated public static double log(double a)
Math.log(double)The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.
a - the value whose the natural logarithm is to be returned@Deprecated public static double exp(double a)
Math.exp(double)a - the exponent to raise e to.@Deprecated
public static double pow(double a,
double b)
Math.pow(double, double)
(In the foregoing descriptions, a floating-point value is considered to be an
integer if and only if it is finite and a fixed point of the method
ceil or, equivalently, a fixed point of the method
floor. A value is a fixed point of a one-argument method
if and only if the result of applying the method to the value is equal to the
value.)
The computed result must be within 1 ulp of the exact result. Results must be
semi-monotonic.
a - the base.b - the exponent.public static int limit(int value,
int min,
int max)
value is lower than min, returns
min.value is greater than max, returns
max.value.value - the value to limitmin - the lower boundmax - the upper boundjava.lang.IllegalArgumentException - if min is greater than maxpublic static float limit(float value,
float min,
float max)
value is lower than min, returns
min.value is greater than max, returns
max.value.value - the value to limitmin - the lower boundmax - the upper boundjava.lang.IllegalArgumentException - if min is greater than maxpublic static long limit(long value,
long min,
long max)
value is lower than min, returns
min.value is greater than max, returns
max.value.value - the value to limitmin - the lower boundmax - the upper boundjava.lang.IllegalArgumentException - if min is greater than maxpublic static double limit(double value,
double min,
double max)
value is lower than min, returns
min.value is greater than max, returns
max.value.value - the value to limitmin - the lower boundmax - the upper boundjava.lang.IllegalArgumentException - if min is greater than max