Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Math::BigMul Method (Int32, Int32)

 

Produces the full product of two 32-bit numbers.

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

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

Parameters

a
Type: System::Int32

The first number to multiply.

b
Type: System::Int32

The second number to multiply.

Return Value

Type: System::Int64

The number containing the product of the specified numbers.

The following example demonstrates the use of the BigMul method to calculate the product of two integer values.

// This example demonstrates Math.BigMul()
using namespace System;
int main()
{
   int int1 = Int32::MaxValue;
   int int2 = Int32::MaxValue;
   Int64 longResult;

   //
   longResult = Math::BigMul( int1, int2 );
   Console::WriteLine( "Calculate the product of two Int32 values:" );
   Console::WriteLine( "{0} * {1} = {2}", int1, int2, longResult );
}

/*
This example produces the following results:
Calculate the product of two Int32 values:
2147483647 * 2147483647 = 4611686014132420609
*/

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft