OSDN Git Service

(split) LDP: Update draft pages
[linuxjm/LDP_man-pages.git] / draft / man3 / ecvt.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 Sat Jul 24 19:40:39 1993 by Rik Faith (faith@cs.unc.edu)
30 .\" Modified Fri Jun 25 12:10:47 1999 by Andries Brouwer (aeb@cwi.nl)
31 .\"
32 .\"*******************************************************************
33 .\"
34 .\" This file was generated with po4a. Translate the source file.
35 .\"
36 .\"*******************************************************************
37 .TH ECVT 3 2013\-07\-04 "" "Linux Programmer's Manual"
38 .SH 名前
39 ecvt, fcvt \- 浮動小数点数の文字列への変換
40 .SH 書式
41 \fB#include <stdlib.h>\fP
42 .sp
43 \fBchar *ecvt(double \fP\fInumber\fP\fB, int \fP\fIndigits\fP\fB, int *\fP\fIdecpt\fP\fB,\fP
44 \fBint *\fP\fIsign\fP\fB);\fP
45 .sp
46 \fBchar *fcvt(double \fP\fInumber\fP\fB, int \fP\fIndigits\fP\fB, int *\fP\fIdecpt\fP\fB,\fP
47 \fBint *\fP\fIsign\fP\fB);\fP
48 .sp
49 .in -4n
50 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
51 .in
52 .sp
53 \fBecvt\fP(), \fBfcvt\fP():
54 .ad l
55 .RS 4
56 .PD 0
57 .TP  4
58 glibc 2.12 以降:
59 .nf
60 _SVID_SOURCE ||
61     (_XOPEN_SOURCE\ >=\ 500 ||
62         _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) &&
63     !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600)
64 .fi
65 .TP  4
66 glibc 2.12 より前:
67 _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
68 .PD
69 .RE
70 .ad b
71 .SH 説明
72 関数 \fBecvt\fP()  は \fInumber\fP を NUL 文字で終端された \fIndigits\fP
73 文字の文字列へ変換し、その文字列へのポインタを返す (\fIndigits\fP が \fIdouble\fP
74 の精度によって決定されるシステム依存の上限値より大きい場合は、 その条件値が \fIndigits\fP の値となる)。 \fInumber\fP が 0
75 でなければ、最上位の桁は 0 以外である。 最下位の桁は丸められる。 文字列には小数点は含まれない。そのかわりに、文字列の先頭からの小数点の 位置が
76 \fI*decpt\fP に保持される。 \fI*decpt\fP が負の値の場合、小数点が文字列の先頭の左側にあることを意味する。
77 もし(\fInumber\fPの)符号が負ならば \fI*sign\fP は 0 以外の値に、 そうでなければ 0 に設定される。 \fInumber\fP が 0
78 なら、\fI*decpt\fP が 0 か 1 かは未規定である。
79 .PP
80 関数 \fBfcvt\fP()  は \fBecvt\fP()  と同じ機能を持つが、\fIndigits\fP は小数点以下の文字数を指定する。
81 .SH 返り値
82 関数 \fBecvt\fP()  と \fBfcvt\fP()  は \fInumber\fP の ASCII 表現を含む 静的な領域内の文字列へのポインタを返す。
83 この文字列は \fBecvt\fP()  や \fBfcvt\fP()  の呼び出しのたびに上書きされる。
84 .SH 属性
85 .SS "マルチスレッディング (pthreads(7) 参照)"
86 関数 \fBecvt\fP() と \fBfcvt\fP() はスレッドセーフではない。
87 .SH 準拠
88 SVr2。 POSIX.1\-2001 では「過去の名残 (LEGACY)」と位置付けられている。 POSIX.1\-2008 では \fBecvt\fP()
89 と \fBfcvt\fP()  の仕様が削除され、代わりに \fBsprintf\fP(3)  の使用が推奨されている(しかし \fBsnprintf\fP(3)
90 がより適切かもしれない)。
91 .SH 注意
92 Linux libc4 と libc5 では \fIndigits\fP の型は \fIsize_t\fP となっていた。
93 小数点にピリオドを使わないロケールもある。
94 .SH 関連項目
95 \fBecvt_r\fP(3), \fBgcvt\fP(3), \fBqecvt\fP(3), \fBsetlocale\fP(3), \fBsprintf\fP(3)
96 .SH この文書について
97 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
98 である。プロジェクトの説明とバグ報告に関する情報は
99 http://www.kernel.org/doc/man\-pages/ に書かれている。