This documentation is archived and is not being maintained.

BigInteger::DivRem Method

Divides one BigInteger value by another, returns the result, and returns the remainder in an output parameter.

Namespace:  System.Numerics
Assembly:  System.Numerics (in System.Numerics.dll)

public:
static BigInteger DivRem(
	BigInteger dividend, 
	BigInteger divisor, 
	[OutAttribute] BigInteger% remainder
)

Parameters

dividend
Type: System.Numerics::BigInteger
The value to be divided.
divisor
Type: System.Numerics::BigInteger
The value to divide by.
remainder
Type: System.Numerics::BigInteger%
When this method returns, contains a BigInteger value that represents the remainder from the division. This parameter is passed uninitialized.

Return Value

Type: System.Numerics::BigInteger
The quotient of the division.

ExceptionCondition
DivideByZeroException

divisor is 0 (zero).

This method preserves both the quotient and the remainder that results from integer division. If you are not interested in the remainder, use the Divide method or the division operator; if you are only interested in the remainder, use the Remainder method.

The sign of the returned remainder value is the same as the sign of the dividend parameter.

The behavior of the DivRem method is identical to that of the Math::DivRem method.

The following example creates an array of BigInteger values. It then uses each element as the quotient in a division operation that uses the Divide method, the division operator (/), and the DivRem method.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: