本文整理汇总了VB.NET中System.Tuple<T1>.IComparable.CompareTo方法的典型用法代码示例。如果您正苦于以下问题:VB.NET Tuple<T1>.IComparable.CompareTo方法的具体用法?VB.NET Tuple<T1>.IComparable.CompareTo怎么用?VB.NET Tuple<T1>.IComparable.CompareTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了Tuple<T1>.IComparable.CompareTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Main
Module Example
Sub Main()
Dim values() = { Tuple.Create(13.54),
Tuple.Create(Double.NaN),
Tuple.Create(-189.42993),
Tuple.Create(Double.PositiveInfinity),
Tuple.Create(Double.Epsilon),
Tuple.Create(1.934E-17),
Tuple.Create(Double.NegativeInfinity),
Tuple.Create(-0.000000000003588),
Nothing}
Console.WriteLine("The values in unsorted order:")
For Each value In values
If value IsNot Nothing Then
Console.WriteLine(" {0}", value.Item1)
Else
Console.WriteLine(" <null>")
End If
Next
Console.WriteLine()
Array.Sort(values)
Console.WriteLine("The values in sorted order:")
For Each value In values
If value IsNot Nothing Then
Console.WriteLine(" {0}", value.Item1)
Else
Console.WriteLine(" <null>")
End If
Next
End Sub
End Module
输出:
The values in unsorted order: 13.54 NaN -189.42993 Infinity 4.94065645841247E-324 1.934E-17 -Infinity -3.588E-12 The values in sorted order: NaN -Infinity -189.42993 -3.588E-12 4.94065645841247E-324 1.934E-17 13.54 Infinity