다음을 통해 공유


cabs, cabsf, cabsl

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at cabs, cabsf, cabsl.

Retrieves the absolute value of a complex number.

Syntax

double cabs(   
   _Dcomplex z   
);  
float cabs(   
   _Fcomplex z   
);  // C++ only  
long double cabs(   
   _Lcomplex z   
);  // C++ only  
float cabsf(   
   _Fcomplex z   
);  
long double cabsl(   
   _Lcomplex z   
);  

Parameters

z
A complex number.

Return Value

The absolute value of z.

Remarks

Because C++ allows overloading, you can call overloads of cabs that take _Fcomplex or _Lcomplex values, and return float or long double values. In a C program, cabs always takes a _Dcomplex value and returns a double value.

Requirements

Routine C header C++ header
cabs, cabsf, cabsl <complex.h> <ccomplex>

For more compatibility information, see Compatibility in the Introduction.

See Also

Alphabetical Function Reference
norm, normf, norml
creal, crealf, creall
cproj, cprojf, cprojl
conj, conjf, conjl
cimag, cimagf, cimagl
carg, cargf, cargl