System.Decimal.op_Equality Method

Returns a value that indicates whether two decimal values are equal.

Syntax

public static bool operator== (decimal d1, decimal d2)

Parameters

d1
The first value to compare.
d2
The second value to compare.

Returns

true if d1 and d2 are equal; otherwise, false.

Remarks

The decimal.op_Equality(decimal, decimal) method defines the operation of the equality operator for decimal values. It enables code such as the following:

code reference: System.Decimal.Operators#1

If the language you're using doesn't support custom operators, call the decimal.Equals(decimal) method instead.

Requirements

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