Поделиться через


fabs, fabsf

Calculates the absolute value of the floating-point argument.

double fabs( 
   double x 
);
float fabs(
   float x 
); // C++ only
long double fabs(
   long double x
); // C++ only
float fabsf( 
   float x 
);

Параметры

  • x
    Floating-point value.

Возвращаемое значение

fabs returns the absolute value of its argument. There is no error return.

Input

SEH Exception

Matherr Exception

± QNAN,IND

none

_DOMAIN

Заметки

C++ allows overloading, so you can call overloads of fabs. In a C program, fabs always takes and returns a double.

Требования

Function

Required header

fabs, fabsf

<math.h>

For additional compatibility information, see Compatibility in the Introduction.

Пример

See the example for abs.

Эквивалент в .NET Framework

System::Math::Abs

См. также

Основные понятия

Floating-Point Support

abs, _abs64

_cabs

labs