Mono Class Library: System.Decimal Overview | Members

System.Decimal.Remainder Method

Computes the remainder after dividing two decimal values.

public static decimal Remainder (decimal d1, decimal d2)

Parameters

d1
The dividend.
d2
The divisor.
d2
Documentation for this section has not yet been entered.

Returns

The remainder after dividing d1 by d2 to give an integer result. The sign of the result, if non-zero, is the same as the sign of d1, and the scale of the result is the larger of the scales of d1 and d2.

For example, -10 % 3 gives -1, and 3.6 % 1.3 gives 1.0 (where % indicates the remainder operation).

Exceptions

TypeReason
DivideByZeroExceptiond2 is zero.
OverflowExceptiond1 divided by d2 is greater than decimal.MaxValue or less than decimal.MinValue.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0