Addition Operator

Decimal.Addition Operator (Decimal, Decimal)


Adds two specified Decimal values.

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

public static decimal operator +(
	decimal d1,
	decimal d2


Type: System.Decimal

The first value to add.

Type: System.Decimal

The second value to add.

Return Value

Type: System.Decimal

The result of adding d1 and d2.

Exception Condition

The return value is less than MinValue or greater than MaxValue.

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

Snippet section 3 of code snippet {"project_id":"3fedad16-eaf1-41a6-8f96-0c1949c68f32","entity_id":"c6311be3-35b7-428b-9cd3-f2e7bd4bc5aa","entity_type":"CodeSnippet","locale":"en-US"} in source file ({"filename":"/CS/httpwebrequest_contentlength.cs","blob_type":"Source","blob_id":"-002fcs-002fhttpwebrequest-005fcontentlength-002ecs","blob_revision":1}) overlaps with other snippet sections. Ensure the tags are placed correctly.

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

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