Return absolute value of floating-point: fabs : Absolute Value « Math « C / ANSI-C






Return absolute value of floating-point: fabs

Return absolute value of floating-point: fabs


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

int main ()
{
  printf ("Absoulte value of 3.14 is %lf\n", fabs (3.14) );
  printf ("Absoulte value of -11.6 is %lf\n", fabs (-11.6) );
  return 0;
}



           
       








Related examples in the same category

1.How to get absolute value for float
2.Get absolute value of long integer parameter: how to use labs
3.Return absolute value of integer parameter: how to use abs