OSDN Git Service

Releases pages updated/added in LDP v3.76
[linuxjm/LDP_man-pages.git] / release / man3 / printf.3
index f27ef8f..05f5b57 100644 (file)
@@ -251,23 +251,19 @@ long int\fP へのポインタ、 \fBc\fP 変換では \fIwint_t\fP、 \fBs\fP 
 であることを示す。 (C99 では %LF を使うことを認めているが、SUSv2 では認められていない。) これは \fBll\fP の同義語である。
 .TP 
 \fBj\fP
-A following integer conversion corresponds to an \fIintmax_t\fP or \fIuintmax_t\fP
-argument, or a following \fBn\fP conversion corresponds to a pointer to an
-\fIintmax_t\fP argument.
+整数変換に対応する引き数が \fIintmax_t\fP か \fIuintmax_t\fP で、 \fBn\fP 変換に対応する引き数が \fIintmax_t\fP
+へのポインタであることを示す。
 .TP 
 \fBz\fP
 .\" (Linux libc5 has
 .\" .B Z
 .\" with this meaning.
 .\" Don't use it.)
-A following integer conversion corresponds to a \fIsize_t\fP or \fIssize_t\fP
-argument, or a following \fBn\fP conversion corresponds to a pointer to a
-\fIsize_t\fP argument.
+整数変換に対応する引き数が \fIsize_t\fP か \fIssize_t\fP で、 \fBn\fP 変換に対応する引き数が \fIsize_t\fP
+へのポインタであることを示す。
 .TP 
 \fBt\fP
-A following integer conversion corresponds to a \fIptrdiff_t\fP argument, or a
-following \fBn\fP conversion corresponds to a pointer to a \fIptrdiff_t\fP
-argument.
+整数変換に対応する引き数が \fIptrdiff_t\fP で、 \fBn\fP 変換に対応する引き数が \fIptrdiff_t\fP へのポインタであることを示す。
 .PP
 SUSv3 では上記のすべてが規定されている。 SUSv2 で規定されていたのは、 長さ修飾子 \fBh\fP (\fBhd\fP, \fBhi\fP, \fBho\fP,
 \fBhx\fP, \fBhX\fP, \fBhn\fP), \fBl\fP (\fBld\fP, \fBli\fP, \fBlo\fP, \fBlx\fP, \fBlX\fP, \fBln\fP, \fBlc\fP,
@@ -298,12 +294,10 @@ SUSv3 では上記のすべてが規定されている。 SUSv2 で規定され
 精度が指定されていない場合には 6 として扱われる。 精度として明示的に 0 が指定されたときには、小数点以下は表示されない。
 小数点を表示する際には、小数点の前に少なくとも一桁は数字が表示される。
 
-(SUSv2 does not know about \fBF\fP and says that character string
-representations for infinity and NaN may be made available.  SUSv3 adds a
-specification for \fBF\fP.  The C99 standard specifies "[\-]inf" or
-"[\-]infinity" for infinity, and a string starting with "nan" for NaN, in the
-case of \fBf\fP conversion, and "[\-]INF" or "[\-]INFINITY" or "NAN*" in the case
-of \fBF\fP conversion.)
+(SUSv2 では、\fBF\fP は規定されておらず、無限や NaN に関する文字列表現を行ってもよいことになっている。 SUSv3 では \fBF\fP
+の規定が追加された。 C99 標準では、\fBf\fP 変換では、無限は "[\-]inf" か "[\-]infinity" と表示し、 NaN
+は文字列の先頭に `nan' をつけて表示するように規定されている。 \fBF\fP 変換の場合は "[\-]INF", "[\-]INFINITY",
+"NAN*" と表示される。)
 .TP 
 \fBg\fP, \fBG\fP
 \fIdouble\fP 引き数を \fBf\fP か \fBe\fP (\fBG\fP 変換の場合は \fBF\fP か \fBE\fP)  の形式に変換する。
@@ -312,16 +306,17 @@ of \fBF\fP conversion.)
 小数点以下に数字が少なくとも一つある場合にだけである。
 .TP 
 \fBa\fP, \fBA\fP
-(C99; not in SUSv2, but added in SUSv3)  For \fBa\fP conversion, the \fIdouble\fP
-argument is converted to hexadecimal notation (using the letters abcdef)  in
-the style [\-]\fB0x\fPh\fB\&.\fPhhhh\fBp\fP\(+-; for \fBA\fP conversion the prefix \fB0X\fP,
-the letters ABCDEF, and the exponent separator \fBP\fP is used.  There is one
-hexadecimal digit before the decimal point, and the number of digits after
-it is equal to the precision.  The default precision suffices for an exact
-representation of the value if an exact representation in base 2 exists and
-otherwise is sufficiently large to distinguish values of type \fIdouble\fP.
-The digit before the decimal point is unspecified for nonnormalized numbers,
-and nonzero but otherwise unspecified for normalized numbers.
+(C99 にはあるが SUSv2 にはないが SUSv3 で追加された)
+\fBa\fP 変換では、 \fIdouble\fP 引き数を
+(abcdef の文字を使って) [\-]\fB0x\fPh\fB\&.\fPhhhh\fBp\fP\(+- 形式の
+16 進表記に変換する。
+\fBA\fP 変換では、前置文字列 \fB0X\fP, 文字 ABCDEF, 指数文字 \fBP\fP を用いる。
+小数点の前には 1 桁の 16 進数が置かれ、小数点の後ろの桁数は 精度で指定
+された値となる。デフォルトの精度は、その値が 2 進数で正確に表現できる
+場合には、その値を正確に表現できる桁数となる。それ以外の場合は、
+\fIdouble\fP 型の値を区別するのに十分な大きさとなる。 小数点の前の数字は、
+正規化されていない数の場合はいくつになるか分からない。 正規化された数の
+場合は、 0 以外の値になるが、いくつになるかは分からない。
 .TP 
 \fBc\fP
 \fBl\fP 修飾子がなければ、 \fIint\fP 引き数を \fIunsigned char\fP に変換して、その結果に対応する文字を出力する。 \fBl\fP
@@ -344,22 +339,18 @@ and nonzero but otherwise unspecified for normalized numbers.
 精度の値を超える場合だけは、配列はヌルワイド文字で終端されていなくてもよい。 それ以外の場合は、必ず配列はヌルワイド文字で終端されていなければならない。
 .TP 
 \fBC\fP
-(Not in C99 or C11, but in SUSv2, SUSv3, and SUSv4.)  Synonym for \fBlc\fP.
-Don't use.
+(C99, C11 にはないが SUSv2, SUSv3, SUSv4 にはある)  \fBlc\fP と同じ。使ってはならない。
 .TP 
 \fBS\fP
-(Not in C99 or C11, but in SUSv2, SUSv3, and SUSv4.)  Synonym for \fBls\fP.
-Don't use.
+(C99, C11 にはないが SUSv2, SUSv3, SUSv4 にはある)  \fBls\fP と同じ。使ってはならない。
 .TP 
 \fBp\fP
 \fIvoid\ *\fP ポインタ引き数を (\fB%#x\fP や \fB%#lx\fP のような) 16 進数で出力する。
 .TP 
 \fBn\fP
-The number of characters written so far is stored into the integer pointed
-to by the corresponding argument.  That argument shall be an \fIint\ * ,\fP or
-variant whose size matches the (optionally)  supplied integer length
-modifier.  No argument is converted.  The behavior is undefined if the
-conversion specification includes any flags, a field width, or a precision.
+これまでに書き込まれた文字数が対応する引き数が指す整数に格納される。 この引き数は \fIint\ *\fP
+系でなければならず、そのサイズは指定された整数の長さ修飾子 (省略可能) と一致していなければならない。 引き数の変換は行われない。
+変換指定にフラグ、フィールド幅、精度に含まれていた場合の動作は不定である。
 .TP 
 \fBm\fP
 (glibc での拡張)  \fIstrerror(errno)\fP の出力を表示する。引き数は必要ない。
@@ -398,13 +389,10 @@ conversion specification includes any flags, a field width, or a precision.
 .\" .IR strerror(errno) .
 .\" .PP
 .\" glibc 2.0 adds conversion characters \fBC\fP and \fBS\fP.
-Concerning the return value of \fBsnprintf\fP(), SUSv2 and C99 contradict each
-other: when \fBsnprintf\fP()  is called with \fIsize\fP=0 then SUSv2 stipulates an
-unspecified return value less than 1, while C99 allows \fIstr\fP to be NULL in
-this case, and gives the return value (as always)  as the number of
-characters that would have been written in case the output string has been
-large enough.  SUSv3 and later align their specification of \fBsnprintf\fP()
-with C99.
+\fBsnprintf\fP()  の返り値を見ると、 SUSv2 と C99 標準は互いに矛盾している。 SUSv2 では、 \fBsnprintf\fP()
+が \fIsize\fP=0 で呼び出された場合、 1 未満の値を何か返り値とするように規定している。 一方 C99 では、このような場合 \fIstr\fP を
+NULL とし、返り値として (通常通り) 出力バッファが十分な大きさが あった場合に出力されるであろう文字数を返す。 SUSv3 やそれ以降では
+C99 の \fBsnprintf\fP() の規定にあわせたものとなっている。
 .PP
 glibc 2.1 では、長さ修飾子 \fBhh\fP, \fBj\fP, \fBt\fP, \fBz\fP と変換文字 \fBa\fP, \fBA\fP が追加された。
 .PP