public final class Math
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static int |
abs(int i)
Returns the absolute value of the argument.
|
static long |
abs(long l)
Returns the absolute value of the argument.
|
static int |
max(int i1,
int i2)
Returns the most positive (closest to positive infinity) of the two
arguments.
|
static long |
max(long l1,
long l2)
Returns the most positive (closest to positive infinity) of the two
arguments.
|
static int |
min(int i1,
int i2)
Returns the most negative (closest to negative infinity) of the two
arguments.
|
static long |
min(long l1,
long l2)
Returns the most negative (closest to negative infinity) of the two
arguments.
|
public static int abs(int i)
If the argument is Integer.MIN_VALUE
, Integer.MIN_VALUE
is returned.
i
- the value whose absolute value has to be computed.public static long abs(long l)
Long.MIN_VALUE
, Long.MIN_VALUE
is returned.l
- the value whose absolute value has to be computed.public static int max(int i1, int i2)
i1
- the first argument.i2
- the second argument.i1
and i2
.public static long max(long l1, long l2)
l1
- the first argument.l2
- the second argument.l1
and l2
.public static int min(int i1, int i2)
i1
- the first argument.i2
- the second argument.i1
and i2
.public static long min(long l1, long l2)
l1
- the first argument.l2
- the second argument.l1
and l2
.