Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

c#
math
bigmul
communitycreator

What is Math.BigMul() in C#?

Arslan Bajwa

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

C# has a built-in Math class which provides useful mathematical functions and operations. The class has the BigMul() function, which is used to compute the full product of two specified numbers.

Variants

BigMul(Int32, Int32)

Syntax

This function returns the full product of two numbers.

  public static long BigMul (int param1, int param2);

where:

  • param1, param2 are the input values to be multiplied in BigMul()

BigMul(Int64, Int64, Int64)

Syntax

This function returns the high 64-bits of product of param1 and param2.

  public static long BigMul (long param1, long param2, out long low);

where:

  • param1, param2 are the input values to be multiplied in BigMul()
  • low is the low 64-bit of the product

BigMul(UInt64, UInt64, UInt64)

Syntax

This function returns the high 64-bits of product of param1 and param2.

  public static ulong BigMul (ulong param1, ulong param2, out ulong low);

where:

  • param1, param2 are the input values to be multiplied in BigMul()
  • low is the low 64-bit of the product

Example

using System;
class HelloWorld
{
    static void Main()
    {
        System.Console.WriteLine(Math.BigMul(4,5));

        System.Console.WriteLine(Math.BigMul(50,15));
    }
}

RELATED TAGS

c#
math
bigmul
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring