Export (0) Print
Expand All

Math.BigMul Method

Produces the full product of two 32-bit numbers.

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

public static long BigMul (
	int a,
	int b
)
public static long BigMul (
	int a, 
	int b
)
public static function BigMul (
	a : int, 
	b : int
) : long
Not applicable.

Parameters

a

The first Int32 to multiply.

b

The second Int32 to multiply.

Return Value

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 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
*/

// This example demonstrates Math.BigMul()
import System.*;

class Sample
{
    public static void main(String[] args)
    {
        int int1 = Int32.MaxValue;
        int int2 = Int32.MaxValue;
        long longResult;
        //
        longResult = System.Math.BigMul(int1, int2);
        Console.WriteLine("Calculate the product of two Int32 values:");
        Console.WriteLine("{0} * {1} = {2}", System.Convert.ToString(int1), 
            System.Convert.ToString(int2), System.Convert.ToString(longResult));
    } //main
} //Sample

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

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

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1

Community Additions

ADD
Show:
© 2015 Microsoft