本文整理汇总了VB.NET中System.Numerics.BigInteger.IComparable.CompareTo方法的典型用法代码示例。如果您正苦于以下问题:VB.NET BigInteger.IComparable.CompareTo方法的具体用法?VB.NET BigInteger.IComparable.CompareTo怎么用?VB.NET BigInteger.IComparable.CompareTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Numerics.BigInteger
的用法示例。
在下文中一共展示了BigInteger.IComparable.CompareTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: values
Dim values() As Object = { BigInteger.Pow(Int64.MaxValue, 10), Nothing,
12.534, Int64.MaxValue, BigInteger.One }
Dim number As BigInteger = UInt64.MaxValue
For Each value As Object In values
Try
Console.WriteLine("Comparing {0} with '{1}': {2}", number, value,
number.CompareTo(value))
Catch e As ArgumentException
Console.WriteLine("Unable to compare the {0} value {1} with a BigInteger.",
value.GetType().Name, value)
End Try
Next
输出:
Comparing 18446744073709551615 with '4.4555084156466750133735972424E+189': -1 Comparing 18446744073709551615 with '': 1 Unable to compare the Double value 12.534 with a BigInteger. Unable to compare the Int64 value 9223372036854775807 with a BigInteger. Comparing 18446744073709551615 with '1': 1