Imports System.Numerics
Module Example
Public Sub Main()
Dim divisor As BigInteger = BigInteger.Pow(Int64.MaxValue, 2)
Dim dividends() As BigInteger = { BigInteger.Multiply(CType(Single.MaxValue, BigInteger), 2),
BigInteger.Parse("9999999999999999"),
BigInteger.One,
BigInteger.Multiply(Int32.MaxValue, Int64.MaxValue),
BigInteger.One }
For Each dividend As BigInteger In dividends
Dim quotient As BigInteger
Dim remainder As BigInteger = 0
Console.WriteLine("Dividend: {0:N0}", dividend)
Console.WriteLine("Divisor: {0:N0}", divisor)
Console.WriteLine(" Using Divide method: {0:N0}", BigInteger.Divide(dividend, divisor))
Console.WriteLine(" Using Division operator: {0:N0}", dividend / divisor)
quotient = BigInteger.DivRem(dividend, divisor, remainder)
Console.WriteLine(" Using DivRem method: {0:N0}, remainder {1:N0}", quotient, remainder)
Next
End Sub
End Module