Math::DivRem Method (Int32, Int32, Int32%)

 

Calculates the quotient of two 32-bit signed integers and also returns the remainder in an output parameter.

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

public:
static int DivRem(
	int a,
	int b,
	[OutAttribute] int% result
)

Parameters

a
Type: System::Int32

The dividend.

b
Type: System::Int32

The divisor.

result
Type: System::Int32%

The remainder.

Return Value

Type: System::Int32

The quotient of the specified numbers.

Exception Condition
DivideByZeroException

b is zero.

The remainder is calculated by using the modulus operation.

The following example demonstrates the DivRem(Int32, Int32, Int32%) method.

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

.NET Framework
Available since 1.1
Return to top
Show: