Computer >> Computer tutorials >  >> Programming >> C#

C# Math.BigMul Method


Use the Math.BigMul() method to find the product of two 32-bit numbers.

The following are our two numbers.

int one = 345272828;
int two = 887685744;

Now, get the product.

long res;
res = Math.BigMul(one, two);

Example

using System;
using System.Globalization;
class Demo {
   static void Main() {
      int one = 345272828;
      int two = 887685744;
      long res;
      res = Math.BigMul(one, two);
      Console.WriteLine("{0} * {1} = {2}", one, two, res);
   }
}

Output

345272828 * 887685744 = 306493767206164032