복소수 객체
***********

type PyComplexObject

   파이썬 복소수 객체를 나타내는 "PyObject"의 서브 형.

   Py_complex cval

      The complex number value, using the C "Py_complex"
      representation.

      Deprecated since version 3.15, will be removed in version 3.20:
      Use "PyComplex_AsCComplex()" and "PyComplex_FromCComplex()" to
      convert a Python complex number to/from the C "Py_complex"
      representation.

PyTypeObject PyComplex_Type
    * Part of the 안정 ABI.*

   이 "PyTypeObject" 인스턴스는 파이썬 복소수 형을 나타냅니다. 파이썬
   계층의 "complex"와 같은 객체입니다.

int PyComplex_Check(PyObject *p)

   인자가 "PyComplexObject" 나 "PyComplexObject"의 서브 형이면 참을 반
   환합니다. 이 함수는 항상 성공합니다.

int PyComplex_CheckExact(PyObject *p)

   인자가 "PyComplexObject"이지만, "PyComplexObject"의 서브 유형이 아
   니면 참을 반환합니다. 이 함수는 항상 성공합니다.

PyObject *PyComplex_FromDoubles(double real, double imag)
    *반환값: 새 참조.** Part of the 안정 ABI.*

   *real* 및 *imag*로 새로운 "PyComplexObject" 객체를 반환합니다. 에러
   면 예외를 설정하고 "NULL"을 반환합니다.

double PyComplex_RealAsDouble(PyObject *op)
    * Part of the 안정 ABI.*

   *op*의 실수부를 C double로 반환합니다.

   *op*가 파이썬 복소수 객체가 아니지만 "__complex__()" 메서드가 있으
   면, 이 메서드는 먼저 *op*를 파이썬 복소수 객체로 변환하도록 그 메서
   드를 호출합니다. "__complex__()"가 정의되지 않았으면
   "PyFloat_AsDouble()"을 호출하는 것으로 대체하고 그 결과를 반환합니
   다.

   실패하면, 이 메서드는 예외를 설정하고 "-1.0"을 반환합니다.
   "PyErr_Occurred()"를 호출하여 에러를 확인해야 합니다.

   버전 3.13에서 변경: 사용할 수 있다면 "__complex__()"를 사용합니다.

double PyComplex_ImagAsDouble(PyObject *op)
    * Part of the 안정 ABI.*

   *op*의 허수부를 C double로 반환합니다.

   *op*가 파이썬 복소수 객체가 아니지만 "__complex__()" 메서드가 있으
   면, 이 메서드는 먼저 *op*를 파이썬 복소수 객체로 변환하도록 그 메서
   드를 호출합니다. "__complex__()"가 정의되지 않았으면
   "PyFloat_AsDouble()"을 호출하는 것으로 대체하고 성공할 때 "0.0"을
   반환합니다.

   실패하면, 이 메서드는 예외를 설정하고 "-1.0"을 반환합니다.
   "PyErr_Occurred()"를 호출하여 에러를 확인해야 합니다.

   버전 3.13에서 변경: 사용할 수 있다면 "__complex__()"를 사용합니다.

type Py_complex

   This C structure defines an export format for a Python complex
   number object.

   double real
   double imag

   구조체는 다음과 같이 정의됩니다:

      typedef struct {
          double real;
          double imag;
      } Py_complex;

PyObject *PyComplex_FromCComplex(Py_complex v)
    *반환값: 새 참조.*

   C "Py_complex" 값으로 새로운 파이썬 복소수 객체를 만듭니다. 에러면
   예외를 설정하고 "NULL"을 반환합니다.

Py_complex PyComplex_AsCComplex(PyObject *op)

   복소수 *op*의 "Py_complex" 값을 반환합니다.

   *op*가 파이썬 복소수 객체가 아니지만 "__complex__()" 메서드가 있으
   면, 이 메서드는 먼저 *op*를 파이썬 복소수 객체로 변환하도록 그 메서
   드를 호출합니다. "__complex__()"가 정의되지 않았으면 "__float__()"
   로 대체합니다. "__float__()"가 정의되지 않았으면 "__index__()"로 대
   체합니다.

   실패하면, 이 메서드는 예외를 설정하고 "real"을 "-1.0"으로 설정한
   "Py_complex"를 반환합니다. "PyErr_Occurred()"를 호출하여 에러를 확
   인해야 합니다.

   버전 3.8에서 변경: 사용할 수 있다면 "__index__()"를 사용합니다.


C 구조체로서의 복소수
=====================

The API also provides functions for working with complex numbers,
using the "Py_complex" representation.  Note that the functions which
accept these structures as parameters and return them as results do so
*by value* rather than dereferencing them through pointers.

Please note, that these functions are *soft deprecated* since Python
3.15.  Avoid using this API in a new code to do complex arithmetic:
either use the Number Protocol API or use native complex types, like
double complex.

Py_complex _Py_c_sum(Py_complex left, Py_complex right)

   C "Py_complex" 표현을 사용하여 두 복소수의 합을 반환합니다.

   버전 3.15부터 폐지됨.

Py_complex _Py_c_diff(Py_complex left, Py_complex right)

   C "Py_complex" 표현을 사용하여 두 복소수의 차이를 반환합니다.

   버전 3.15부터 폐지됨.

Py_complex _Py_c_neg(Py_complex num)

   C "Py_complex" 표현을 사용하여 복소수 *num*의 음의 값을 반환합니다.

   버전 3.15부터 폐지됨.

Py_complex _Py_c_prod(Py_complex left, Py_complex right)

   C "Py_complex" 표현을 사용하여 두 복소수의 곱을 반환합니다.

   버전 3.15부터 폐지됨.

Py_complex _Py_c_quot(Py_complex dividend, Py_complex divisor)

   C "Py_complex" 표현을 사용하여 두 복소수의 몫을 반환합니다.

   *divisor*가 null이면, 이 메서드는 0을 반환하고, "errno"를 "EDOM"으
   로 설정합니다.

   버전 3.15부터 폐지됨.

Py_complex _Py_c_pow(Py_complex num, Py_complex exp)

   C "Py_complex" 표현을 사용하여 *num*의 *exp* 거듭제곱을 반환합니다.

   *num*이 null이고 *exp*가 양의 실수가 아니면, 이 메서드는 0을 반환하
   고 "errno"를 "EDOM"으로 설정합니다.

   오버플로면 "errno"를 "ERANGE"으로 설정합니다.

   버전 3.15부터 폐지됨.

double _Py_c_abs(Py_complex num)

   Return the absolute value of the complex number *num*.

   오버플로면 "errno"를 "ERANGE"으로 설정합니다.

   버전 3.15부터 폐지됨.
