本文整理匯總了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