fabs : fabs « math.h « C Tutorial






ItemValue
Header filemath.h
Declarationfloat fabsf(float num);
double fabs(double num);
long double fabsl(long double num);
Returnreturns the absolute value of num.


#include <math.h>
  #include <stdio.h>

  int main(void)
  {
    printf("%1.1f %1.1f", fabs(1.0), fabs(-1.0));

    return 0;
  }
1.0 1.0








19.19.fabs
19.19.1.fabs