C# Math BigMul

Description

Math BigMul produces the full product of two 32-bit numbers.

Syntax

Math.BigMul has the following syntax.


public static long BigMul(
  int a,
  int b
)

Parameters

Math.BigMul has the following parameters.

  • a - The first number to multiply.
  • b - The second number to multiply.

Returns

Math.BigMul method returns The number containing the product of the specified numbers.

Example

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


using System;/* w  w  w .  ja  v  a2 s.  co m*/

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);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version