Mega Code Archive

 
Categories / C / Math
 

Return absolute value of floating-point

#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; }