本文整理汇总了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
开发者ID:VB.NET开发者,项目名称:System.Numerics,代码行数:33,代码来源:BigInteger.Remainder 输出:
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.
注:本文中的System.Numerics.BigInteger.Remainder方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论