Mono Class Library: System.Decimal Overview | Members

System.Decimal.Divide Method

Divides the value of one decimal by another.

public static decimal Divide (decimal d1, decimal d2)

Parameters

d1
The dividend.
d2
The divisor.

Returns

A decimal containing the result of dividing d1 by d2. The scale of the result, before any rounding, is the closest scale to the preferred scale which will preserve a result equal to the exact result. The preferred scale is the scale of d1 less the scale of d2. For example, 2.20 / 2 gives 1.10.

Exceptions

TypeReason
DivideByZeroExceptiond2 is zero.
OverflowExceptionThe result 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