本文整理匯總了VB.NET中System.Numerics.BigInteger.Max方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET BigInteger.Max方法的具體用法?VB.NET BigInteger.Max怎麽用?VB.NET BigInteger.Max使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Numerics.BigInteger
的用法示例。
在下文中一共展示了BigInteger.Max方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Example
' 導入命名空間
Imports System.Numerics
Module Example
Public Sub Main()
Dim numbers() As BigInteger = { Int64.MaxValue * BigInteger.MinusOne,
BigInteger.MinusOne,
10359321239000,
BigInteger.Pow(103988, 2),
BigInteger.Multiply(Int32.MaxValue, Int16.MaxValue),
BigInteger.Add(BigInteger.Pow(Int64.MaxValue, 2),
BigInteger.Pow(Int32.MaxValue, 2)) }
If numbers.Length < 2 Then
Console.WriteLine("Cannot determine which is the larger of {0} numbers.",
numbers.Length)
Exit Sub
End If
Dim largest As BigInteger = numbers(numbers.GetLowerBound(0))
For ctr As Integer = numbers.GetLowerBound(0) + 1 To numbers.GetUpperBound(0)
largest = BigInteger.Max(largest, numbers(ctr))
Next
Console.WriteLine("The values:")
For Each number As BigInteger In numbers
Console.WriteLine("{0,55:N0}", number)
Next
Console.WriteLine()
Console.WriteLine("The largest number of the series is:")
Console.WriteLine(" {0:N0}", largest)
End Sub
End Module
輸出:
The values: -9,223,372,036,854,775,807 -1 10,359,321,239,000 10,813,504,144 70,366,596,661,249 85,070,591,730,234,615,852,008,593,798,364,921,858 The largest number of the series is: 85,070,591,730,234,615,852,008,593,798,364,921,858