Complex.Explicit 연산자
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
Complex 개체와 다른 형식 간의 명시적 변환을 정의합니다.
오버로드
| Name | Description |
|---|---|
| Explicit(UInt128 to Complex) |
값을 배정밀도 복소수로 명시적으로 변환 UInt128 합니다. |
| Explicit(BigInteger to Complex) |
BigInteger 값을 복소수로 변환하는 명시적 변환을 정의합니다. |
| Explicit(Decimal to Complex) |
Decimal 값을 복소수로 변환하는 명시적 변환을 정의합니다. |
| Explicit(Int128 to Complex) |
값을 배정밀도 복소수로 명시적으로 변환 Int128 합니다. |
Explicit(UInt128 to Complex)
- Source:
- Complex.cs
- Source:
- Complex.cs
- Source:
- Complex.cs
- Source:
- Complex.cs
Important
이 API는 CLS 규격이 아닙니다.
값을 배정밀도 복소수로 명시적으로 변환 UInt128 합니다.
public:
static explicit operator System::Numerics::Complex(UInt128 value);
[System.CLSCompliant(false)]
public static explicit operator System.Numerics.Complex(UInt128 value);
[<System.CLSCompliant(false)>]
static member op_Explicit : UInt128 -> System.Numerics.Complex
Public Shared Narrowing Operator CType (value As UInt128) As Complex
매개 변수
- value
- UInt128
변환할 값입니다.
반환
value 을 배정밀도 복소수로 변환합니다.
- 특성
적용 대상
Explicit(BigInteger to Complex)
- Source:
- Complex.cs
- Source:
- Complex.cs
- Source:
- Complex.cs
- Source:
- Complex.cs
BigInteger 값을 복소수로 변환하는 명시적 변환을 정의합니다.
public:
static explicit operator System::Numerics::Complex(System::Numerics::BigInteger value);
public static explicit operator System.Numerics.Complex(System.Numerics.BigInteger value);
static member op_Explicit : System.Numerics.BigInteger -> System.Numerics.Complex
Public Shared Narrowing Operator CType (value As BigInteger) As Complex
매개 변수
- value
- BigInteger
복소수로 변환할 값입니다.
반환
value와 일치하는 실수 구성 요소와 0과 일치하는 허수 구성 요소가 있는 복소수입니다.
예제
다음 예제에서는 값을 값으로 명시적으로 변환 BigInteger 하는 방법을 Complex 보여 줍니다.
BigInteger[] numbers= {
((BigInteger) Double.MaxValue) * 2,
BigInteger.Parse("901345277852317852466891423"),
BigInteger.One };
foreach (BigInteger number in numbers)
{
Complex c1 = (Complex) number;
Console.WriteLine(c1);
}
// The example displays the following output:
// (Infinity, 0)
// (9.01345277852318E+26, 0)
// (1, 0)
let numbers =
[ (bigint Double.MaxValue) * 2I
BigInteger.Parse "901345277852317852466891423"
BigInteger.One ]
for number in numbers do
let c1 = Complex(float number, 0.)
printfn $"{number, 30} --> {c1}"
// The example displays the following output:
// (Infinity, 0)
// (9.01345277852318E+26, 0)
// (1, 0)
Dim numbers() As BigInteger = {
CType(Double.MaxValue, BigInteger) * 2,
BigInteger.Parse("901345277852317852466891423"),
BigInteger.One }
For Each number In numbers
Dim c1 As System.Numerics.Complex = CType(number,
System.Numerics.Complex)
Console.WriteLine(c1)
Next
' The example displays the following output:
' (Infinity, 0)
' (9.01345277852318E+26, 0)
' (1, 0)
설명
명시적 변환 연산자는 개체로 변환할 수 있는 형식을 Complex 정의합니다. 언어 컴파일러에서는 데이터 손실이 포함될 수 있으므로 이 변환을 자동으로 수행하지 않습니다. 대신 캐스팅 연산자(C#) 또는 변환 함수(예: CType Visual Basic)를 사용하는 경우에만 변환을 수행합니다. 그렇지 않으면 컴파일러 오류가 표시됩니다.
값을 복소수의 BigInteger 실제 부분으로 변환하면 복소수의 속성 형식인 가 보다 BigInteger더 적은 수의 Real 유효 자릿수를 가지므로 Double전체 자릿수가 손실됩니다.
값이 형식 범위를 Double 벗어나므로 변환에 실패 BigInteger 하면 연산에서 을 OverflowExceptionthrow하지 않습니다. 대신 가 보다 작으면 value 결과는 속성 값이 Real 와 같은 NegativeInfinity복소수MinValue입니다. 가 보다 크면 value 결과는 속성 값이 와 Real 같은 PositiveInfinity복소수MaxValue입니다.
적용 대상
Explicit(Decimal to Complex)
- Source:
- Complex.cs
- Source:
- Complex.cs
- Source:
- Complex.cs
- Source:
- Complex.cs
Decimal 값을 복소수로 변환하는 명시적 변환을 정의합니다.
public:
static explicit operator System::Numerics::Complex(System::Decimal value);
public static explicit operator System.Numerics.Complex(decimal value);
static member op_Explicit : decimal -> System.Numerics.Complex
Public Shared Narrowing Operator CType (value As Decimal) As Complex
매개 변수
- value
- Decimal
복소수로 변환할 값입니다.
반환
value와 일치하는 실수 구성 요소와 0과 일치하는 허수 구성 요소가 있는 복소수입니다.
예제
다음 예제에서는 값을 값으로 명시적으로 변환 Decimal 하는 방법을 Complex 보여 줍니다.
decimal[] numbers = { Decimal.MinValue, -18.35m, 0m, 1893.019m,
Decimal.MaxValue };
foreach (decimal number in numbers)
{
System.Numerics.Complex c1 = (System.Numerics.Complex) number;
Console.WriteLine("{0,30} --> {1}", number, c1);
}
// The example displays the following output:
// -79228162514264337593543950335 --> (-7.92281625142643E+28, 0)
// -18.35 --> (-18.35, 0)
// 0 --> (0, 0)
// 1893.019 --> (1893.019, 0)
// 79228162514264337593543950335 --> (7.92281625142643E+28, 0)
let numbers = [ Decimal.MinValue; -18.35m; 0m; 1893.019m; Decimal.MaxValue ]
for number in numbers do
let c1 = Complex(float number, 0.)
printfn $"{number, 30} --> {c1}"
// The example displays the following output:
// -79228162514264337593543950335 --> (-7.92281625142643E+28, 0)
// -18.35 --> (-18.35, 0)
// 0 --> (0, 0)
// 1893.019 --> (1893.019, 0)
// 79228162514264337593543950335 --> (7.92281625142643E+28, 0)
Dim numbers() As Decimal = { Decimal.MinValue, -18.35d, 0d, 1893.019d,
Decimal.MaxValue }
For Each number In numbers
Dim c1 As System.Numerics.Complex = CType(number,
System.Numerics.Complex)
Console.WriteLine("{0,30} --> {1}", number, c1)
Next
' The example displays the following output:
' -79228162514264337593543950335 --> (-7.92281625142643E+28, 0)
' -18.35 --> (-18.3500003814697, 0)
' 0 --> (0, 0)
' 1893.019 --> (1893.01904296875, 0)
' 79228162514264337593543950335 --> (7.92281625142643E+28, 0)
설명
명시적 변환 연산자는 개체로 변환할 수 있는 형식을 Complex 정의합니다. 언어 컴파일러에서는 데이터 손실이 포함될 수 있으므로 이 변환을 자동으로 수행하지 않습니다. 대신 캐스팅 연산자(C#) 또는 변환 함수(예: CType Visual Basic)를 사용하는 경우에만 변환을 수행합니다. 그렇지 않으면 컴파일러 오류가 표시됩니다.
값을 복소수의 Decimal 실제 부분으로 변환하면 복소수의 속성 형식인 가 보다 Decimal더 적은 수의 Real 유효 자릿수를 가지므로 Double전체 자릿수가 손실됩니다.
적용 대상
Explicit(Int128 to Complex)
- Source:
- Complex.cs
- Source:
- Complex.cs
- Source:
- Complex.cs
- Source:
- Complex.cs
값을 배정밀도 복소수로 명시적으로 변환 Int128 합니다.
public:
static explicit operator System::Numerics::Complex(Int128 value);
public static explicit operator System.Numerics.Complex(Int128 value);
static member op_Explicit : Int128 -> System.Numerics.Complex
Public Shared Narrowing Operator CType (value As Int128) As Complex
매개 변수
- value
- Int128
변환할 값입니다.
반환
value 을 배정밀도 복소수로 변환합니다.