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

 Live Demo

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

Updated on: 23-Jun-2020

118 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements