本文整理汇总了VB.NET中System.Numerics.BigInteger.Remainder方法的典型用法代码示例。如果您正苦于以下问题:VB.NET BigInteger.Remainder方法的具体用法?VB.NET BigInteger.Remainder怎么用?VB.NET BigInteger.Remainder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Numerics.BigInteger
的用法示例。
在下文中一共展示了BigInteger.Remainder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Example
' 导入命名空间
Imports System.Numerics
Module Example
Public Sub Main()
Dim dividend1 As BigInteger = BigInteger.Pow(Int64.MaxValue, 3)
Dim dividend2 As BigInteger = dividend1 * BigInteger.MinusOne
Dim divisor1 As BigInteger = Int32.MaxValue
Dim divisor2 As BigInteger = divisor1 * BigInteger.MinusOne
Dim remainder1, remainder2 As BigInteger
Dim divRem1 As BigInteger = BigInteger.Zero
Dim divRem2 As BigInteger = BigInteger.Zero
remainder1 = BigInteger.Remainder(dividend1, divisor1)
remainder2 = BigInteger.Remainder(dividend2, divisor1)
BigInteger.DivRem(dividend1, divisor1, divRem1)
Console.WriteLine("BigInteger.Remainder({0}, {1}) = {2}",
dividend1, divisor1, remainder1)
Console.WriteLine("BigInteger.DivRem({0}, {1}) = {2}",
dividend1, divisor1, divRem1)
If remainder1.Equals(divRem1) Then Console.WriteLine("The remainders are equal.")
Console.WriteLine()
BigInteger.DivRem(dividend2, divisor2, divRem2)
Console.WriteLine("BigInteger.Remainder({0}, {1}) = {2}",
dividend2, divisor2, remainder2)
Console.WriteLine("BigInteger.DivRem({0}, {1}) = {2}",
dividend2, divisor2, divRem2)
If remainder2.Equals(divRem2) Then Console.WriteLine("The remainders are equal.")
Console.WriteLine()
End Sub
End Module
输出:
BigInteger.Remainder(7.8463771692333509522426190271E+56, 2147483647) = 1 BigInteger.DivRem(7.8463771692333509522426190271E+56, 2147483647) = 1 The remainders are equal. BigInteger.Remainder(-7.8463771692333509522426190271E+56, -2147483647) = -1 BigInteger.DivRem(-7.8463771692333509522426190271E+56, -2147483647) = -1 The remainders are equal.