C#|数学。BigMul()方法

在C#中, BigMul() 是一个方法类方法。此方法用于计算两个32位数字的全积。 语法:

null
public static long BigMul(int a, int b)

参数:

A. :它是要乘以的第一个数字,此参数的类型为 系统Int32 . B :这是要乘以的第二个数字,该参数的类型为 系统Int32 .

返回类型: 此方法返回一个包含指定数字乘积的数字,并且此方法的返回类型为 系统Int64 . 例子:

C#

// C# program to demonstrate the
// Math.BigMul() method
using System;
namespace ConsoleApplication1 {
class Geeks {
// Main Method
static void Main( string [] args)
{
// defining two variable of type
//  System.Int32
Int32 x1 = 233232322;
Int32 x2 = 189222338;
// Using BigMul( ) method and storing
// result into a long(Int64) variable
long product = Math.BigMul(x1, x2);
// Getting the output
Console.WriteLine( "The product of the two numbers is " + product);
}
}
}


输出:

The product of the two numbers is 44132765266008836

© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享