Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Complex Explicit Conversion (Decimal to Complex)

 

Defines an explicit conversion of a Decimal value to a complex number.

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

public:
static explicit operator Complex (
	Decimal value
)

Parameters

value
Type: System::Decimal

The value to convert to a complex number.

Return Value

Type: System.Numerics::Complex

A complex number that has a real component equal to value and an imaginary component equal to zero.

Explicit conversion operators define types that can be converted to a Complex object. Language compilers do not perform this conversion automatically because it can involve data loss. Instead, they perform the conversion only if a casting operator (in C#) or a conversion function (such as CType in Visual Basic) is used. Otherwise, they display a compiler error.

The conversion of a Decimal value to the real part of a complex number can result in a loss of precision because a Double, which is the type of the complex number's Real property, has fewer significant digits than a Decimal.

The following example illustrates the explicit conversion of Decimal values to Complex values.

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

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2017 Microsoft