fabs
Computes the absolute value of the argument (function or macro)
#include <math.h>
double fabs (
double x);
The fabs function or macro returns the absolute value of x.
#include <math.h> #include <stdio.h> main () { printf ("%f %f\n", fabs (.5), fabs (-.5) ); }
produces the following:
0.500000 0.500000