home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / clib / labs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-09  |  728 b   |  52 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: labs.c,v 1.1 1996/12/12 16:07:05 aros Exp $
  4.  
  5.     Desc: ANSI C function labs()
  6.     Lang: english
  7. */
  8.  
  9. /*****************************************************************************
  10.  
  11.     NAME */
  12. #include <stdlib.h>
  13.  
  14.     long labs (
  15.  
  16. /*  SYNOPSIS */
  17.     long j)
  18.  
  19. /*  FUNCTION
  20.     Compute the absolute value of j.
  21.  
  22.     INPUTS
  23.     j - A signed long
  24.  
  25.     RESULT
  26.     The absolute value of j.
  27.  
  28.     NOTES
  29.  
  30.     EXAMPLE
  31.     // returns 1
  32.     labs (1L);
  33.  
  34.     // returns 1
  35.     labs (-1L);
  36.  
  37.     BUGS
  38.  
  39.     SEE ALSO
  40.     abs(), fabs()
  41.  
  42.     INTERNALS
  43.  
  44.     HISTORY
  45.     12.12.1996 digulla created
  46.  
  47. ******************************************************************************/
  48. {
  49.     return (j < 0) ? -j : j;
  50. } /* labs */
  51.  
  52.