Decimal::Equality Operator (Decimal, Decimal)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

equivalentCodeEntityM:System.Decimal.Equals(System.Object)

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

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

public:
static bool operator ==(
	Decimal d1,
	Decimal d2
)

Parameters

d1
Type: System::Decimal

The first value to compare.

d2
Type: System::Decimal

The second value to compare.

Return Value

Type: System::Boolean

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

The Equality method defines the operation of the equality operator for Decimal values. It enables code such as the following:

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

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

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: