Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / stdlib / abs.c
blob85a3fecd8191b58c23221a060936bf5331cf0099
1 /*
2 FUNCTION
3 <<abs>>---integer absolute value (magnitude)
5 INDEX
6 abs
8 SYNOPSIS
9 #include <stdlib.h>
10 int abs(int <[i]>);
12 DESCRIPTION
13 <<abs>> returns
14 @tex
15 $|x|$,
16 @end tex
17 the absolute value of <[i]> (also called the magnitude
18 of <[i]>). That is, if <[i]> is negative, the result is the opposite
19 of <[i]>, but if <[i]> is nonnegative the result is <[i]>.
21 The similar function <<labs>> uses and returns <<long>> rather than <<int>> values.
23 RETURNS
24 The result is a nonnegative integer.
26 PORTABILITY
27 <<abs>> is ANSI.
29 No supporting OS subroutines are required.
32 #include <stdlib.h>
34 int
35 abs (int i)
37 return (i < 0) ? -i : i;