compare

Compares the two specified double values. The sign of the integer value returned is the same as that of the integer that would be returned by the call:

Double.valueOf(d1).compareTo(Double.valueOf(d2))
*

Return

the value 0 if d1 is numerically equal to d2; a value less than 0 if d1 is numerically less than d2; and a value greater than 0 if d1 is numerically greater than d2.

Since

1.4

Parameters

d1

the first double to compare

d2

the second double to compare


Compares the two specified float values. The sign of the integer value returned is the same as that of the integer that would be returned by the call:

Float.valueOf(f1).compareTo(Float.valueOf(f2))
*

Return

the value 0 if f1 is numerically equal to f2; a value less than 0 if f1 is numerically less than f2; and a value greater than 0 if f1 is numerically greater than f2.

Since

1.4

Parameters

f1

the first float to compare.

f2

the second float to compare.


Compares two Int values numerically.

This is the same as the Java method Integer.compare(int x, int y).

Return

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Parameters

x

the first value to compare

y

the second value to compare


Compares two long values numerically. The value returned is identical to what would be returned by:

Long.valueOf(x).compareTo(Long.valueOf(y))
*

Return

the value 0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y

Since

1.7

Parameters

x

the first long to compare

y

the second long to compare


Compares two short values numerically. The value returned is identical to what would be returned by:

Short.valueOf(x).compareTo(Short.valueOf(y))

Return

the value 0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y

Since

1.7

Parameters

x

the first short to compare

y

the second short to compare