int, long, uint, byte等の整数型、float, double, decimal等の実数型は、いずれもその数の小さい順に並べ替えられます。
数値型の値のソート順序
Imports System
Class Sample
Shared Sub Main()
Dim intArray As Integer() = New Integer() {0, 1, -1, Integer.MaxValue, Integer.MinValue}
Dim decimalArray As Decimal() = New Decimal() { _
0D, 1D, -1D, 0.01D, -0.01D, _
Decimal.MaxValue, Decimal.MinValue _
}
Array.Sort(intArray)
Array.Sort(decimalArray)
Console.Write("Integer: ")
Console.WriteLine(String.Join(", ", intArray))
Console.Write("Decimal: ")
Console.WriteLine(String.Join(", ", decimalArray))
End Sub
End Class
実行結果
int: -2147483648, -1, 0, 1, 2147483647 decimal: -79228162514264337593543950335, -1, -0.01, 0, 0.01, 1, 79228162514264337593543950335