Meta.Numerics Library
Explicit Operator
Meta.NumericsMeta.NumericsComplexExplicitNarrowingExplicitExplicitExplicit(Complex to Double)
Converts the complex number to a double-precision real number.
Declaration Syntax
C#Visual BasicVisual C++F#
public static explicit operator double (
	Complex z
)
Public Shared Narrowing Operator CType ( _
	z As Complex _
) As Double
static explicit operator double (
	Complex z
)
F# does not support the declaration of new casting operators.
Parameters
z (Complex)
The complex number to covert.
Return Value
The corresponding double-precision real number.
Remarks

This explicit cast will fail if the complex number has a non-zero imaginary part. If you just want to obtain the real part of a complex number, use the Re property.

Exceptions
ExceptionCondition
InvalidCastExceptionz.Im ≠ 0