C# Tutorial C# Advanced C# References

C# Math - BigMul() Method



The C# BigMul() method returns full product of two 32 bit numbers.

Syntax

public static long BigMul (int x, int y);

Parameters

x Specify first value to multiply.
y Specify second value to multiply.

Return Value

Returns full product of two 32 bit numbers.

Example:

In the example below, BigMul() method returns full product of two 32 bit numbers.

using System;

class MyProgram {
  static void Main(string[] args) {
    Console.WriteLine("Math.BigMul(2255, 33897) = "
                      + Math.BigMul(2255, 33897));
    Console.WriteLine("Math.BigMul(-2256, 54567) = "
                      + Math.BigMul(-2256, 54567));
    Console.WriteLine("Math.BigMul(2123, 35688) = "
                      + Math.BigMul(2123, 35688));
  }
}

The output of the above code will be:

Math.BigMul(2255, 33897) = 76437735
Math.BigMul(-2256, 54567) = -123103152
Math.BigMul(2123, 35688) = 75765624

❮ C# Math Methods