public class DoubleArraySorter extends Object
Modifier and Type | Method and Description |
---|---|
static void |
sort(double[] first,
double[] second)
Sorts the specified arrays of doubles into ascending numerical order.
|
static void |
sort(double[] first,
double[] second,
int fromIndex,
int toIndex)
Sorts the specified range of the specified arrays of doubles into
ascending numerical order.
|
public static void sort(double[] first, double[] second)
<
relation does not provide a total order on
all floating-point values; although they are distinct numbers
-0.0 == 0.0
is true
and a NaN value
compares neither less than, greater than, nor equal to any
floating-point value, even itself. To allow the sort to
proceed, instead of using the <
relation to
determine ascending numerical order, this method uses the total
order imposed by Double.compareTo(java.lang.Double)
. This ordering
differs from the <
relation in that
-0.0
is treated as less than 0.0
and
NaN is considered greater than any other floating-point value.
For the purposes of sorting, all NaN values are considered
equivalent and equal.
first
- the array to be sortedsecond
- second array to be sortedpublic static void sort(double[] first, double[] second, int fromIndex, int toIndex)
<
relation does not provide a total order on
all floating-point values; although they are distinct numbers
-0.0 == 0.0
is true
and a NaN value
compares neither less than, greater than, nor equal to any
floating-point value, even itself. To allow the sort to
proceed, instead of using the <
relation to
determine ascending numerical order, this method uses the total
order imposed by Double.compareTo(java.lang.Double)
. This ordering
differs from the <
relation in that
-0.0
is treated as less than 0.0
and
NaN is considered greater than any other floating-point value.
For the purposes of sorting, all NaN values are considered
equivalent and equal.
first
- the array to be sortedsecond
- second array to be sortedfromIndex
- the index of the first element (inclusive) to be
sortedtoIndex
- the index of the last element (exclusive) to be sortedIllegalArgumentException
- if fromIndex > toIndexArrayIndexOutOfBoundsException
- if fromIndex < 0 or
toIndex > a.lengthCopyright © 2016–2017 CLIF project. All rights reserved.