DivRem Method (Int32, Int32, Int32)
Collapse the table of content
Expand the table of content
This documentation is archived and is not being maintained.

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

Updated: February 2009

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.

ExceptionCondition
DivideByZeroException

b is zero.

The remainder is calculated by using the modulus operation.

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

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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1

Date

History

Reason

February 2009

Added the Remarks section and replaced the example.

Customer feedback.

Show:
© 2016 Microsoft