home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 1.ddi / CLIBSRC.ZIP / LABS.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  861 b   |  36 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - labs.c
  3.  *
  4.  * function(s)
  5.  *        labs - gives long absolute value
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*
  9.  *      C/C++ Run Time Library - Version 5.0
  10.  *
  11.  *      Copyright (c) 1987, 1992 by Borland International
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15.  
  16.  
  17. #include <stdlib.h>
  18.  
  19. /*---------------------------------------------------------------------*
  20.  
  21. Name            labs - gives long absolute value
  22.  
  23. Usage           long labs(long n);
  24.  
  25. Prototype in    stdlib.h
  26.  
  27. Description     calculates the absolute value of n, a long integer.
  28.  
  29. Return value    the absolute value of n.
  30.  
  31. *---------------------------------------------------------------------*/
  32. long labs(long n)
  33. {
  34.         return(n < 0 ? -n : n);
  35. }
  36.