Tuesday 12 March 2013

abs(int)


abs(int)


Parameters:
a - a double value.
Returns: the largest (closest to positive infinity) double value that is not greater than the argument and is
equal to a mathematical integer.
Since: CLDC 1.1
abs(int)
Declaration:
public static int abs(int a)
Description:
Returns the absolute value of an 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.
Parameters:
a - an int value.
Returns: the absolute value of the argument.
See Also: Integer.MIN_VALUE
abs(long)
Declaration:
public static long abs(long a)
Description:
Returns the absolute value of a 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.
Parameters:
a - a long value.
Returns: the absolute value of the argument.
See Also: Long.MIN_VALUE
abs(float)
Declaration:
public static float abs(float a)
Description:
Returns the absolute value of a 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:
• If the argument is positive zero or negative zero, the result is positive zero.
• If the argument is infinite, the result is positive infinity.
• If the argument is NaN, the result is NaN.
In other words, the result is equal to the value of the expression:

Float.intBitsToFloat(0x7fffffff & Float.floatToIntBits(a))
Parameters:
a - a float value.
Returns: the absolute value of the argument.
Since: CLDC 1.1
abs(double)
Declaration:
public static double abs(double a)
Description:
Returns the absolute value of a 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:
• If the argument is positive zero or negative zero, the result is positive zero.
• If the argument is infinite, the result is positive infinity.
• If the argument is NaN, the result is NaN.
In other words, the result is equal to the value of the expression:
Double.longBitsToDouble((Double.doubleToLongBits(a)<<1)>>>1)
Parameters:
a - a double value.
Returns: the absolute value of the argument.
Since: CLDC 1.1
max(int, int)
Declaration:
public static int max(int a, int b)
Description:
Returns the greater of two 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.
Parameters:
a - an int value.
b - an int value.
Returns: the larger of a and b.
See Also: Long.MAX_VALUE
max(long, long)
Declaration:
public static long max(long a, long b)
Description:
Returns the greater of two 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.
Parameters:
a - a long value.

max(float, float)

b - a long value.
Returns: the larger of a and b.
See Also: Long.MAX_VALUE
max(float, float)
Declaration:
public static float max(float a, float b)
Description:
Returns the greater of two 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 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.
Parameters:
a - a float value.
b - a float value.
Returns: the larger of a and b.
max(double, double)
Declaration:
public static double max(double a, double b)
Description:
Returns the greater of two 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 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.
Parameters:
a - a double value.
b - a double value.
Returns: the larger of a and b.
min(int, int)
Declaration:
public static int min(int a, int b)
Description:
Returns the smaller of two 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.
Parameters:
a - an int value.
b - an int value.
Returns: the smaller of a and b.
See Also: Long.MIN_VALUE

min(long, long)
Declaration:
public static long min(long a, long b)
Description:
Returns the smaller of two 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.
Parameters:
a - a long value.
b - a long value.
Returns: the smaller of a and b.
See Also: Long.MIN_VALUE
min(float, float)
Declaration:
public static float min(float a, float b)
Description:
Returns the smaller of two 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 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.
Parameters:
a - a float value.
b - a float value.
Returns: the smaller of a and b.
Since: CLDC 1.1
min(double, double)
Declaration:
public static double min(double a, double b)
Description:
Returns the smaller of two 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 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.
Parameters:
a - a double value.
b - a double value.
Returns: the smaller of a and b.
Since: CLDC 1.1



No comments:

Post a Comment