home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / math / cephes / cmath / fabs.c < prev    next >
Encoding:
Text File  |  1992-11-17  |  265 b   |  32 lines

  1. /*                            fabs.c
  2.  *
  3.  *        Absolute value
  4.  *
  5.  *
  6.  *
  7.  * SYNOPSIS:
  8.  *
  9.  * double x, y;
  10.  *
  11.  * y = fabs( x );
  12.  *
  13.  *
  14.  *
  15.  * DESCRIPTION:
  16.  * 
  17.  * Returns the absolute value of the argument.
  18.  *
  19.  */
  20.  
  21.  
  22. double fabs(x)
  23. double x;
  24. {
  25.  
  26. if( x < 0.0 )
  27.     return( -x );
  28. else
  29.     return( x );
  30. }
  31.  
  32.