This documentation is archived and is not being maintained.

Math.BigMul Method

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Produces the full product of two 32-bit numbers.

[Visual Basic]
Public Shared Function BigMul( _
   ByVal a As Integer, _
   ByVal b As Integer _
) As Long
[C#]
public static long BigMul(
 int a,
 int b
);
[C++]
public: static __int64 BigMul(
 int a,
 int b
);
[JScript]
public static function BigMul(
   a : int,
 b : int
) : long;

Parameters

a
The first Int32 to multiply.
b
The second Int32 to multiply.

Return Value

The Int64 containing the product of the specified numbers.

Example

[Visual Basic] 
' This example demonstrates Math.BigMul()
Imports System

Class Sample
   Public Shared Sub Main()
      Dim int1 As Integer = Int32.MaxValue
      Dim int2 As Integer = Int32.MaxValue
      Dim longResult As Long
      '
      longResult = Math.BigMul(int1, int2)
      Console.WriteLine("Calculate the product of two Int32 values:")
      Console.WriteLine("{0} * {1} = {2}", int1, int2, longResult)
   End Sub 'Main
End Class 'Sample
'
'This example produces the following results:
'Calculate the product of two Int32 values:
'2147483647 * 2147483647 = 4611686014132420609
'

[C#] 
// This example demonstrates Math.BigMul()
using System;

class Sample 
{
    public static void Main() 
    {
    int int1 = Int32.MaxValue;
    int int2 = Int32.MaxValue;
    long 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
*/

[C++] 
// This example demonstrates Math.BigMul()
#using <mscorlib.dll>
using namespace System;

int main() 
{
    int int1 = Int32::MaxValue;
    int int2 = Int32::MaxValue;
    Int64 longResult;
//
    longResult = Math::BigMul(int1, int2);
    Console::WriteLine(S"Calculate the product of two Int32 values:");
    Console::WriteLine(S"{0} * {1} = {2}", __box(int1), __box(int2), __box(longResult));
}
/*
This example produces the following results:
Calculate the product of two Int32 values:
2147483647 * 2147483647 = 4611686014132420609
*/

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Common Language Infrastructure (CLI) Standard

See Also

Math Class | Math Members | System Namespace

Show: