Technical Support
On-Line Manuals
Cx51 User's Guide
#include <math.h> float fabs ( float val); /* number to take absolute value of */
The fabs function determines the absolute value of the floating-point number val.
The fabs function returns the absolute value of val.
abs, cabs, labs
#include <math.h> #include <stdio.h> /* for printf */ void tst_fabs (void) { float x; float y; x = 10.2; y = fabs (x); printf ("FABS(%f) = %f\n", x, y); x = -3.6; y = fabs (x); printf ("FABS(%f) = %f\n", x, y); }