Namespaces
Variants

conjf, conj, conjl

From cppreference.net
헤더 파일에 정의됨 <complex.h>
float complex conjf ( float complex z ) ;
(1) (C99 이후)
double complex conj ( double complex z ) ;
(2) (C99 이후)
long double complex conjl ( long double complex z ) ;
(3) (C99 이후)
헤더 파일에 정의됨 <tgmath.h>
#define conj( z )
(4) (C99 이후)
1-3) z 복소켤레 를 허수부의 부호를 반전시켜 계산합니다.
4) 타입-제네릭 매크로: 만약 z long double complex , long double imaginary , 또는 long double 타입을 가지면 conjl 이 호출됩니다. 만약 z float complex , float imaginary , 또는 float 타입을 가지면 conjf 이 호출됩니다. 만약 z double complex , double imaginary , double , 또는 임의의 정수 타입을 가지면 conj 이 호출됩니다.

목차

매개변수

z - 복소 인수

반환값

z 의 복소켤레.

참고 사항

I _Imaginary_I 로 구현하지 않는 C99 구현체에서, conj 는 음수 영 허수부를 갖는 복소수를 얻는 데 사용될 수 있습니다. C11에서는 이 목적을 위해 CMPLX 매크로가 사용됩니다.

예제

#include <stdio.h>
#include <complex.h>
int main(void)
{
    double complex z = 1.0 + 2.0*I;
    double complex z2 = conj(z);
    printf("The conjugate of %.1f%+.1fi is %.1f%+.1fi\n",
            creal(z), cimag(z), creal(z2), cimag(z2));
    printf("Their product is %.1f%+.1fi\n", creal(z*z2), cimag(z*z2));
}

출력:

The conjugate of 1.0+2.0i is 1.0-2.0i
Their product is 5.0+0.0i

참고문헌

  • C11 표준 (ISO/IEC 9899:2011):
  • 7.3.9.4 conj 함수 (p: 198)
  • 7.25 Type-generic math <tgmath.h> (p: 373-375)
  • G.7 Type-generic math <tgmath.h> (p: 545)
  • C99 표준 (ISO/IEC 9899:1999):
  • 7.3.9.3 conj 함수 (p: 179)
  • 7.22 Type-generic math <tgmath.h> (p: 335-337)
  • G.7 Type-generic math <tgmath.h> (p: 480)

참고 항목

C++ 문서 for conj