# BigInteger.Multiply(BigInteger, BigInteger) メソッド

## 定義

2 つの BigInteger 値の積を返します。Returns the product of two BigInteger values.

public:
static System::Numerics::BigInteger Multiply(System::Numerics::BigInteger left, System::Numerics::BigInteger right);
public static System.Numerics.BigInteger Multiply (System.Numerics.BigInteger left, System.Numerics.BigInteger right);
static member Multiply : System.Numerics.BigInteger * System.Numerics.BigInteger -> System.Numerics.BigInteger
Public Shared Function Multiply (left As BigInteger, right As BigInteger) As BigInteger

left
BigInteger

right
BigInteger

#### 戻り値

leftright の 2 つのパラメーターの積。The product of the left and right parameters.

## 例

long number1 = 1234567890;
long number2 = 9876543210;
try
{
long product;
product = checked(number1 * number2);
}
catch (OverflowException)
{
BigInteger product;
product = BigInteger.Multiply(number1, number2);
Console.WriteLine(product.ToString());
}
Dim number1 As Long = 1234567890
Dim number2 As Long = 9876543210
Try
Dim product As Long
product = number1 * number2
Console.WriteLine(product.ToString("N0"))
Catch e As OverflowException
Dim product As BigInteger
product = BigInteger.Multiply(number1, number2)
Console.WriteLine(product.ToString)
End Try

## 注釈

Multiply メソッドは、演算子のオーバーロードをサポートしていない言語に対して実装されます。The Multiply method is implemented for languages that do not support operator overloading. その動作は、乗算演算子を使用した乗算と同じです。Its behavior is identical to multiplication using the multiplication operator. さらに、次の例に示すように、Multiply メソッドは、乗算によって得られる製品を割り当てることによって BigInteger 変数をインスタンス化するときに、乗算演算子の代替として使用できます。In addition, the Multiply method is a useful substitute for the multiplication operator when instantiating a BigInteger variable by assigning it a product that results from multiplication, as shown in the following example.

// The statement
//    BigInteger number = Int64.MaxValue * 3;
// produces compiler error CS0220: The operation overflows at compile time in checked mode.
// The alternative:
BigInteger number = BigInteger.Multiply(Int64.MaxValue, 3);
' The statement
'    Dim number As BigInteger = Int64.MaxValue * 3
' produces compiler error BC30439: Constant expression not representable in type 'Long'.
' The alternative:
Dim number As BigInteger = BigInteger.Multiply(Int64.MaxValue, 3)