version 1, including all changes.
.
| Rev |
Author |
# |
Line |
| 1 |
perry |
1 |
ABS |
| |
|
2 |
!!!ABS |
| |
|
3 |
NAME |
| |
|
4 |
SYNOPSIS |
| |
|
5 |
DESCRIPTION |
| |
|
6 |
RETURN VALUE |
| |
|
7 |
CONFORMING TO |
| |
|
8 |
NOTES |
| |
|
9 |
SEE ALSO |
| |
|
10 |
---- |
| |
|
11 |
!!NAME |
| |
|
12 |
|
| |
|
13 |
|
| |
|
14 |
abs, labs, llabs, imaxabs - compute the absolute value of an integer. |
| |
|
15 |
!!SYNOPSIS |
| |
|
16 |
|
| |
|
17 |
|
| |
|
18 |
__#include |
| |
|
19 |
__ ''j''__); |
| |
|
20 |
long int labs(long int__ ''j''__); |
| |
|
21 |
long long int llabs(long long int__ ''j''__); |
| |
|
22 |
#include |
| |
|
23 |
__ ''j''__); |
| |
|
24 |
__ |
| |
|
25 |
!!DESCRIPTION |
| |
|
26 |
|
| |
|
27 |
|
| |
|
28 |
The __abs()__ function computes the absolute value of the |
| |
|
29 |
integer argument ''j''. The __labs()__, __llabs()__ |
| |
|
30 |
and __imaxabs()__ functions compute the absolute value of |
| |
|
31 |
the argument ''j'' of the appropriate integer type for |
| |
|
32 |
the function. |
| |
|
33 |
!!RETURN VALUE |
| |
|
34 |
|
| |
|
35 |
|
| |
|
36 |
Returns the absolute value of the integer argument, of the |
| |
|
37 |
appropriate integer type for the function. |
| |
|
38 |
!!CONFORMING TO |
| |
|
39 |
|
| |
|
40 |
|
| |
|
41 |
SVID 3, POSIX.1, BSD 4.3, ISO/IEC 9899. POSIX.1 (1996 |
| |
|
42 |
edition) only requires the __abs()__ function. ISO/IEC |
| |
|
43 |
9899:1990 (C89) only includes the __abs()__ and |
| |
|
44 |
__labs()__ functions; the functions __llabs()__ and |
| |
|
45 |
__imaxabs()__ were added in C99. |
| |
|
46 |
!!NOTES |
| |
|
47 |
|
| |
|
48 |
|
| |
|
49 |
Trying to take the absolute value of the most negative |
| |
|
50 |
integer is not defined. |
| |
|
51 |
|
| |
|
52 |
|
| |
|
53 |
The __llabs()__ function is included in glibc since |
| |
|
54 |
version 2.0, but is not in libc5 or libc4. The |
| |
|
55 |
__imaxabs()__ function is included in glibc since version |
| |
|
56 |
2.1.1. |
| |
|
57 |
|
| |
|
58 |
|
| |
|
59 |
For __llabs()__ to be declared, it may be necessary to |
| |
|
60 |
define ___ISOC99_SOURCE__ or ___ISOC9X_SOURCE__ |
| |
|
61 |
(depending on the version of glibc) before including any |
| |
|
62 |
standard headers. |
| |
|
63 |
|
| |
|
64 |
|
| |
|
65 |
GCC handles __abs()__ and __labs()__ as builtin |
| |
|
66 |
functions. GCC 3.0 also handles __llabs()__ and |
| |
|
67 |
__imaxabs()__ as builtins. |
| |
|
68 |
!!SEE ALSO |
| |
|
69 |
|
| |
|
70 |
|
| |
|
71 |
ceil(3), floor(3), fabs(3), |
| |
|
72 |
rint(3) |
| |
|
73 |
---- |