Export (0) Print
Expand All

Math::BigMul Method

Produces the full product of two 32-bit numbers.

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

static long long BigMul(
	int a, 
	int b


Type: System::Int32

The first Int32 to multiply.

Type: System::Int32

The second Int32 to multiply.

Return Value

Type: System::Int64
The Int64 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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1

Community Additions

© 2014 Microsoft