OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / man3 / abs.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\"     386BSD man pages
29 .\" Modified Mon Mar 29 22:31:13 1993, David Metcalfe
30 .\" Modified Sun Jun  6 23:27:50 1993, David Metcalfe
31 .\" Modified Sat Jul 24 21:45:37 1993, Rik Faith (faith@cs.unc.edu)
32 .\" Modified Sat Dec 16 15:02:59 2000, Joseph S. Myers
33 .\"
34 .\"*******************************************************************
35 .\"
36 .\" This file was generated with po4a. Translate the source file.
37 .\"
38 .\"*******************************************************************
39 .TH ABS 3 2010\-09\-20 GNU "Linux Programmer's Manual"
40 .SH 名前
41 abs, labs, llabs, imaxabs \- 整数の絶対値を計算する
42 .SH 書式
43 .nf
44 \fB#include <stdlib.h>\fP
45 .sp
46 \fBint abs(int \fP\fIj\fP\fB);\fP
47 .br
48 \fBlong int labs(long int \fP\fIj\fP\fB);\fP
49 .br
50 \fBlong long int llabs(long long int \fP\fIj\fP\fB);\fP
51 .sp
52 \fB#include <inttypes.h>\fP
53 .sp
54 \fBintmax_t imaxabs(intmax_t \fP\fIj\fP\fB);\fP
55 .fi
56 .sp
57 .in -4n
58 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
59 .in
60 .sp
61 .ad l
62 \fBllabs\fP():
63 .RS 4
64 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L;
65 .br
66 or \fIcc\ \-std=c99\fP
67 .RE
68 .ad
69 .SH 説明
70 \fBabs\fP()  関数は、整数の引数 \fIj\fP の絶対値を計算する。 \fBlabs\fP(), \fBllabs\fP(), \fBimaxabs\fP()
71 関数は、 それぞれの関数の型に応じた引数 \fIj\fP の絶対値を計算する。
72 .SH 返り値
73 それぞれの関数の型に応じた整数の引数の絶対値を返す。
74 .SH 準拠
75 .\" POSIX.1 (1996 edition) only requires the
76 .\" .BR abs ()
77 .\" function.
78 SVr4, POSIX.1\-2001, 4.3BSD, C99.  C89 は \fBabs\fP()  関数と \fBlabs\fP()  関数のみを含んでいる。
79 \fBllabs\fP()  関数と \fBimaxabs\fP()  関数は C99 で追加された。
80 .SH 注意
81 最大の負整数の絶対値は、定義されていない。
82 .PP
83 \fBllabs\fP()  関数はバージョン 2.0 から glibc に含まれるようになったが、 libc5 や libc4 にはない。
84 \fBimaxabs\fP()  関数は バージョン 2.1.1 から glibc に含まれるようになった。
85 .PP
86 \fBllabs\fP()  が宣言されるためには、標準ヘッダを include する前に \fB_ISOC99_SOURCE\fP か
87 \fB_ISOC9X_SOURCE\fP(どちらかは glibc の バージョンに依存する)を define しておく必要がある。
88 .PP
89 GCC は \fBabs\fP()  と \fBlabs\fP()  をビルドイン関数として扱う。 GCC 3.0 は \fBllabs\fP()  と
90 \fBimaxabs\fP()  もビルドインとして扱う。
91 .SH 関連項目
92 \fBcabs\fP(3), \fBceil\fP(3), \fBfabs\fP(3), \fBfloor\fP(3), \fBrint\fP(3)
93 .SH この文書について
94 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
95 である。プロジェクトの説明とバグ報告に関する情報は
96 http://www.kernel.org/doc/man\-pages/ に書かれている。