BigInteger::Multiply Method (BigInteger, BigInteger)


Returns the product of two BigInteger values.

Namespace:   System.Numerics
Assembly:  System.Numerics (in System.Numerics.dll)

static BigInteger Multiply(
	BigInteger left,
	BigInteger right


Type: System.Numerics::BigInteger

The first number to multiply.

Type: System.Numerics::BigInteger

The second number to multiply.

Return Value

Type: System.Numerics::BigInteger

The product of the left and right parameters.

The Multiply method is implemented for languages that do not support operator overloading. Its behavior is identical to multiplication using the multiplication operator. 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.

No code example is currently available or this language may not be supported.

If necessary, this method automatically performs implicit conversion of other integral types to BigInteger objects. This is illustrated in the example in the next section, where the Multiply method is passed two Int64 values.

The following example tries to perform multiplication with two long integers. Because the result exceeds the range of a long integer, an OverflowException is thrown, and the Multiply method is called to handle the multiplication. Note that C# requires that you use either the checked keyword (as in this example) or the /checked+ compiler option to make sure an exception is thrown on a numeric overflow.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Available since 4.0
Windows Phone
Available since 8.1
Return to top