C# Math.BigMul 方法

csharpprogrammingserver side programming

使用 Math.BigMul() 方法查找两个 32 位数字的乘积。

以下是我们的两个数字。

int one = 345272828;
int two = 887685744;

现在,获取乘积。

long res;
res = Math.BigMul(one, two);

示例

using System;
using System.Globalization;
class Demo {
   static void Main() {
      int one = 345272828;
      int two = 887685744;
      long res;
      res = Math.BigMul(one, two);
      Console.WriteLine("{0} * {1} = {2}", one, two, res);
   }
}

输出

345272828 * 887685744 = 306493767206164032

相关文章