Прочетете на английски Редактиране

Споделяне чрез


Complex.Implicit Operator

Definition

Defines an implicit conversion between a Complex object and another type.

Overloads

Implicit(SByte to Complex)

Defines an implicit conversion of a signed byte to a complex number.

This API is not CLS-compliant.

Implicit(UIntPtr to Complex)

Implicitly converts a UIntPtr value to a double-precision complex number.

Implicit(UInt64 to Complex)

Defines an implicit conversion of a 64-bit unsigned integer to a complex number.

This API is not CLS-compliant.

Implicit(UInt32 to Complex)

Defines an implicit conversion of a 32-bit unsigned integer to a complex number.

This API is not CLS-compliant.

Implicit(UInt16 to Complex)

Defines an implicit conversion of a 16-bit unsigned integer to a complex number.

This API is not CLS-compliant.

Implicit(Single to Complex)

Defines an implicit conversion of a single-precision floating-point number to a complex number.

Implicit(IntPtr to Complex)

Implicitly converts a IntPtr value to a double-precision complex number.

Implicit(Double to Complex)

Defines an implicit conversion of a double-precision floating-point number to a complex number.

Implicit(Int32 to Complex)

Defines an implicit conversion of a 32-bit signed integer to a complex number.

Implicit(Int16 to Complex)

Defines an implicit conversion of a 16-bit signed integer to a complex number.

Implicit(Half to Complex)

Implicitly converts a Half value to a double-precision complex number.

Implicit(Int64 to Complex)

Defines an implicit conversion of a 64-bit signed integer to a complex number.

Implicit(Char to Complex)

Implicitly converts a Char value to a double-precision complex number.

Implicit(Byte to Complex)

Defines an implicit conversion of an unsigned byte to a complex number.

Implicit(SByte to Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Important

This API is not CLS-compliant.

Defines an implicit conversion of a signed byte to a complex number.

This API is not CLS-compliant.

C#
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.Complex(sbyte value);

Parameters

value
SByte

The value to convert to a complex number.

Returns

An object that contains the value of the value parameter as its real part and zero as its imaginary part.

Attributes

Remarks

The overloads of the Implicit operator define the types from which a compiler can automatically convert a Complex object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException.

This overload lets the compiler handle conversions from a signed byte to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the signed byte and whose imaginary part is equal to zero.

C#
sbyte sbyteValue = -12;
System.Numerics.Complex c1 = sbyteValue;
Console.WriteLine(c1);
// The example displays the following output:
//       (-12, 0)

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(UIntPtr to Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Important

This API is not CLS-compliant.

Implicitly converts a UIntPtr value to a double-precision complex number.

C#
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.Complex(UIntPtr value);

Parameters

value
UIntPtr

The value to convert.

Returns

value converted to a double-precision complex number.

Attributes

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

Implicit(UInt64 to Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Important

This API is not CLS-compliant.

Defines an implicit conversion of a 64-bit unsigned integer to a complex number.

This API is not CLS-compliant.

C#
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.Complex(ulong value);

Parameters

value
UInt64

The value to convert to a complex number.

Returns

An object that contains the value of the value parameter as its real part and zero as its imaginary part.

Attributes

Remarks

The overloads of the Implicit operator define the types from which a compiler can automatically convert a Complex object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException.

This overload lets the compiler handle conversions from an unsigned 64-bit integer to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the unsigned 64-bit integer and whose imaginary part is equal to zero.

C#
ulong longValue = 951034217;
System.Numerics.Complex c1 = longValue;
Console.WriteLine(c1);
// The example displays the following output:
//       (951034217, 0)

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(UInt32 to Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Important

This API is not CLS-compliant.

Defines an implicit conversion of a 32-bit unsigned integer to a complex number.

This API is not CLS-compliant.

C#
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.Complex(uint value);

Parameters

value
UInt32

The value to convert to a complex number.

Returns

An object that contains the value of the value parameter as its real part and zero as its imaginary part.

Attributes

Remarks

The overloads of the Implicit operator define the types from which a compiler can automatically convert a Complex object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException.

This overload lets the compiler handle conversions from an unsigned 32-bit integer to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the unsigned 32-bit integer and whose imaginary part is equal to zero.

C#
uint value = 197461;
System.Numerics.Complex c1 = value;
Console.WriteLine(c1);
// The example displays the following output:
//       (197461, 0)

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(UInt16 to Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Important

This API is not CLS-compliant.

Defines an implicit conversion of a 16-bit unsigned integer to a complex number.

This API is not CLS-compliant.

C#
[System.CLSCompliant(false)]
public static implicit operator System.Numerics.Complex(ushort value);

Parameters

value
UInt16

The value to convert to a complex number.

Returns

An object that contains the value of the value parameter as its real part and zero as its imaginary part.

Attributes

Remarks

The overloads of the Implicit operator define the types from which a compiler can automatically convert a Complex object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException.

This overload lets the compiler handle conversions from an unsigned 16-bit integer to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the unsigned 16-bit integer and whose imaginary part is equal to zero.

C#
ushort shortValue = 421;
System.Numerics.Complex c1 = shortValue;
Console.WriteLine(c1);
// The example displays the following output:
//       (421, 0)

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(Single to Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Defines an implicit conversion of a single-precision floating-point number to a complex number.

C#
public static implicit operator System.Numerics.Complex(float value);

Parameters

value
Single

The value to convert to a complex number.

Returns

An object that contains the value of the value parameter as its real part and zero as its imaginary part.

Remarks

The overloads of the Implicit operator define the types from which a compiler can automatically convert a Complex object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException.

This overload lets the compiler handle conversions from a Single value to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the Single value and whose imaginary part is equal to zero.

C#
float singleValue = 1.032e-08f;
System.Numerics.Complex c1 = singleValue;
Console.WriteLine(c1);
// The example displays the following output:
//       (1.03199999657022E-08, 0)

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(IntPtr to Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Implicitly converts a IntPtr value to a double-precision complex number.

C#
public static implicit operator System.Numerics.Complex(IntPtr value);

Parameters

value
IntPtr

The value to convert.

Returns

value converted to a double-precision complex number.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

Implicit(Double to Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Defines an implicit conversion of a double-precision floating-point number to a complex number.

C#
public static implicit operator System.Numerics.Complex(double value);

Parameters

value
Double

The value to convert to a complex number.

Returns

An object that contains the value of the value parameter as its real part and zero as its imaginary part.

Remarks

The overloads of the Implicit operator define the types from which a compiler can automatically convert a Complex object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException.

This overload lets the compiler handle conversions from a Double value to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the Double value and whose imaginary part is equal to zero.

C#
double doubleValue = 1.032e-16;
System.Numerics.Complex c1 = doubleValue;
Console.WriteLine(c1);
// The example displays the following output:
//       (1.032E-16, 0)

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(Int32 to Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Defines an implicit conversion of a 32-bit signed integer to a complex number.

C#
public static implicit operator System.Numerics.Complex(int value);

Parameters

value
Int32

The value to convert to a complex number.

Returns

An object that contains the value of the value parameter as its real part and zero as its imaginary part.

Remarks

The overloads of the Implicit operator define the types from which a compiler can automatically convert a Complex object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException.

This overload lets the compiler handle conversions from a signed 32-bit integer to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the signed 32-bit integer and whose imaginary part is equal to zero.

C#
int intValue = 1034217;
System.Numerics.Complex c1 = intValue;
Console.WriteLine(c1);
// The example displays the following output:
//       (1034217, 0)

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(Int16 to Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Defines an implicit conversion of a 16-bit signed integer to a complex number.

C#
public static implicit operator System.Numerics.Complex(short value);

Parameters

value
Int16

The value to convert to a complex number.

Returns

An object that contains the value of the value parameter as its real part and zero as its imaginary part.

Remarks

The overloads of the Implicit operator define the types from which a compiler can automatically convert a Complex object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException.

This overload lets the compiler handle conversions from a signed 16-bit integer to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the signed 16-bit integer and whose imaginary part is equal to zero.

C#
short shortValue = 16024;
System.Numerics.Complex c1 = shortValue;
Console.WriteLine(c1);
// The example displays the following output:
//       (16024, 0)

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(Half to Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Implicitly converts a Half value to a double-precision complex number.

C#
public static implicit operator System.Numerics.Complex(Half value);

Parameters

value
Half

The value to convert.

Returns

value converted to a double-precision complex number.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

Implicit(Int64 to Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Defines an implicit conversion of a 64-bit signed integer to a complex number.

C#
public static implicit operator System.Numerics.Complex(long value);

Parameters

value
Int64

The value to convert to a complex number.

Returns

An object that contains the value of the value parameter as its real part and zero as its imaginary part.

Remarks

The overloads of the Implicit operator define the types from which a compiler can automatically convert a Complex object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException.

This overload lets the compiler handle conversions from a signed 64-bit integer to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the signed 64-bit integer and whose imaginary part is equal to zero.

C#
long longValue = 951034217;
System.Numerics.Complex c1 = longValue;
Console.WriteLine(c1);
// The example displays the following output:
//       (951034217, 0)

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

Implicit(Char to Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Implicitly converts a Char value to a double-precision complex number.

C#
public static implicit operator System.Numerics.Complex(char value);

Parameters

value
Char

The value to convert.

Returns

value converted to a double-precision complex number.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

Implicit(Byte to Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Defines an implicit conversion of an unsigned byte to a complex number.

C#
public static implicit operator System.Numerics.Complex(byte value);

Parameters

value
Byte

The value to convert to a complex number.

Returns

An object that contains the value of the value parameter as its real part and zero as its imaginary part.

Remarks

The overloads of the Implicit operator define the types from which a compiler can automatically convert a Complex object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an OverflowException.

This overload lets the compiler handle conversions from a Byte value to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the Byte value and whose imaginary part is equal to zero.

C#
byte byteValue = 122;
System.Numerics.Complex c1 = byteValue;
Console.WriteLine(c1);
// The example displays the following output:
//       (122, 0)

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0