OSDN Git Service

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