NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Decimal Modulus Operator

Determines the remainder from dividing two Decimal values.

[C#]
public static Decimal operator %(
   Decimal d1,
   Decimal d2
);
[C++]
public: static Decimal operator op_Modulus(
   Decimal d1,
   Decimal d2
);
[JScript]
returnValue = d1 % d2;

[Visual Basic] In Visual Basic, you cannot use the operators defined by a type, nor override them or define your own.

[JScript] In JScript, you can use the operators defined by a type, but you cannot override them or define your own.

Arguments [JScript]

d1
The first Decimal (the dividend).
d2
The second Decimal (the divisor).

Parameters [C#, C++]

d1
The first Decimal (the dividend).
d2
The second Decimal (the divisor).

Return Value [C#, C++, JScript]

The result's of dividing two Decimal values.

Exceptions

Exception Type Condition
DivideByZeroException If the divisor is zero.
OverflowException If the result is too large to represent as a Decimal.

Remarks [C#, C++, JScript]

The op_Mod method determines whether the result of first Decimal (the dividend) divided by second Decimal value (the divisor) (d1/ d2) and returns the remainder.

See Also

Decimal Structure | Decimal Members | System Namespace