Synopsis

#include <math.h>

double fabs(double x);
float fabsf(float x);
long double fabsl(long double x);

Description

The functions compute the absolute value of their argument x,| x|.

Arguments:

x - the value of which the absolute value is computed.

Return value

Upon successful completion, these functions return the absolute value of x.

If x is NaN, a NaN is returned.

If x is ±0, ±0 is returned.

If x is ±Inf, +Inf is returned.

Errors

No errors are defined.

Implementation tasks

  • Implement the functions