C# BigInteger Modulus

Description

BigInteger Modulus Returns the remainder that results from division with two specified BigInteger values.

Syntax

BigInteger.Modulus has the following syntax.


public static BigInteger operator %(
  BigInteger dividend,
  BigInteger divisor
)

Parameters

BigInteger.Modulus has the following parameters.

  • dividend - The value to be divided.
  • divisor - The value to divide by.

Returns

BigInteger.Modulus method returns The remainder that results from the division.

Example


using System;/*  ww  w .  j a va2 s  .c o m*/
using System.IO;
using System.Numerics;

public class Example
{
   public static void Main()
   {
        BigInteger num1 = 123123123;
        BigInteger num2 = 123123123;
        BigInteger remainder = num1 % num2;
        Console.WriteLine(remainder); 

    
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Numerics »




BigInteger
Complex