fabs

Computes the absolute value of the argument (function or macro)

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:Mathematical Computation

Syntax

  #include <math.h>  
   
  double fabs  (  
     double   x);
  

Parameters

x
(IN) Specifies an argument whose absolute value is to be computed.

Return Values

The fabs function or macro returns the absolute value of x.

Example

  #include <math.h>  
  #include <stdio.h> 
    
  main ()  
  {  
     printf ("%f %f\n", fabs (.5), fabs (-.5) );  
  }
  

produces the following:

  0.500000 0.500000