다음을 통해 공유


_cabs

복잡 한 숫자의 절대값을 계산합니다.

double _cabs( 
   struct _complex z 
);

매개 변수

  • z
    복잡 한 수 있습니다.

반환 값

_cabs성공 하는 경우 인수의 절대 값을 반환 합니다.On overflow, _cabs returns HUGE_VAL and sets errno to ERANGE.오류 처리를 변경할 수 있습니다 _matherr.

설명

_cabs 구조체의 형식 이어야 하는 복잡 한 숫자의 절대값을 계산 하는 함수 _complex.구조 z 의 실제 구성 요소 구성 됩니다 x 는 가상의 구성 요소 및 y.A call to _cabs produces a value equivalent to that of the expression sqrt( z.x*z.x+z.y*z.y ).

요구 사항

루틴

필수 헤더

_cabs

<math.h>

더 많은 호환성 정보를 참조 하십시오. 호환성 소개에서 합니다.

예제

// crt_cabs.c
/* Using _cabs, this program calculates
 * the absolute value of a complex number.
 */
#include <math.h>
#include <stdio.h>

int main( void )
{
   struct _complex number = { 3.0, 4.0 };
   double d;

   d = _cabs( number );
   printf( "The absolute value of %f + %fi is %f\n",
           number.x, number.y, d );
}
  

해당 .NET Framework 항목

해당 사항 없음. 표준 C 함수를 호출할 수 있습니다 PInvoke. 자세한 내용은 플랫폼 호출 예제.

참고 항목

참조

부동 소수점 지원

abs, _abs64

fabs, fabsf

labs