.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 19:40:39 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Fri Jun 25 12:10:47 1999 by Andries Brouwer (aeb@cwi.nl) .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya .\" all rights reserved. .\" Translated Mon Feb 10 1997 by Hiroaki Nagoya .\" Updated 2000-01-08 by Kentaro Shirakata .\" Updated 2009-04-22 by Kentaro Shirakata .\" .TH ECVT 3 2014\-08\-19 "" "Linux Programmer's Manual" .SH 名前 ecvt, fcvt \- 浮動小数点数の文字列への変換 .SH 書式 \fB#include \fP .sp \fBchar *ecvt(double \fP\fInumber\fP\fB, int \fP\fIndigits\fP\fB, int *\fP\fIdecpt\fP\fB,\fP \fBint *\fP\fIsign\fP\fB);\fP .sp \fBchar *fcvt(double \fP\fInumber\fP\fB, int \fP\fIndigits\fP\fB, int *\fP\fIdecpt\fP\fB,\fP \fBint *\fP\fIsign\fP\fB);\fP .sp .in -4n glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp \fBecvt\fP(), \fBfcvt\fP(): .ad l .RS 4 .PD 0 .TP 4 glibc 2.12 以降: .nf _SVID_SOURCE || (_XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) && !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600) .fi .TP 4 glibc 2.12 より前: _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED .PD .RE .ad b .SH 説明 関数 \fBecvt\fP() は \fInumber\fP をヌル文字で終端された \fIndigits\fP 文字の文字列へ変換し、その文字列へのポインターを返す (\fIndigits\fP が \fIdouble\fP の精度によって決定されるシステム依存の上限値より大きい場合は、 その条件値が \fIndigits\fP の値となる)。 \fInumber\fP が 0 でなければ、最上位の桁は 0 以外である。 最下位の桁は丸められる。 文字列には小数点は含まれない。そのかわりに、文字列の先頭からの小数点の 位置が \fI*decpt\fP に保持される。 \fI*decpt\fP が負の値の場合、小数点が文字列の先頭の左側にあることを意味する。 もし(\fInumber\fPの)符号が負ならば \fI*sign\fP は 0 以外の値に、 そうでなければ 0 に設定される。 \fInumber\fP が 0 なら、\fI*decpt\fP が 0 か 1 かは未規定である。 .PP 関数 \fBfcvt\fP() は \fBecvt\fP() と同じ機能を持つが、\fIndigits\fP は小数点以下の文字数を指定する。 .SH 返り値 関数 \fBecvt\fP() と \fBfcvt\fP() は \fInumber\fP の ASCII 表現を含む 静的な領域内の文字列へのポインターを返す。 この文字列は \fBecvt\fP() や \fBfcvt\fP() の呼び出しのたびに上書きされる。 .SH 属性 .SS "マルチスレッディング (pthreads(7) 参照)" 関数 \fBecvt\fP() と \fBfcvt\fP() はスレッドセーフではない。 .SH 準拠 SVr2。 POSIX.1\-2001 では「過去の名残 (LEGACY)」と位置付けられている。 POSIX.1\-2008 では \fBecvt\fP() と \fBfcvt\fP() の仕様が削除され、代わりに \fBsprintf\fP(3) の使用が推奨されている(しかし \fBsnprintf\fP(3) がより適切かもしれない)。 .SH 注意 .\" Linux libc4 and libc5 specified the type of .\" .I ndigits .\" as .\" .IR size_t . 小数点にピリオドを使わないロケールもある。 .SH 関連項目 \fBecvt_r\fP(3), \fBgcvt\fP(3), \fBqecvt\fP(3), \fBsetlocale\fP(3), \fBsprintf\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。