OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / draft / man3 / drand48.3
index 2fbe026..97ee73d 100644 (file)
@@ -1,5 +1,6 @@
 .\" 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.
 .\"
 .\" 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:46:03 1993 by Rik Faith (faith@cs.unc.edu)
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
 .\"
 .\" Japanese Version Copyright (c) 1997 YOSHINO Takashi
 .\"       all rights reserved.
 .\" Translated Mon Jan 20 20:04:05 JST 1997
 .\"       by YOSHINO Takashi <yoshino@civil.jcn.nihon-u.ac.jp>
 .\"
-.\" WORD: internal buffer  ÆâÉô¥Ð¥Ã¥Õ¥¡
-.\"
-.TH DRAND48 3  2007-07-26 "" "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH Ì¾Á°
-.\"O drand48, erand48, lrand48, nrand48, mrand48, jrand48, srand48, seed48,
-.\"O lcong48 \- generate uniformly distributed pseudo-random numbers
+.TH DRAND48 3 2014\-09\-21 "" "Linux Programmer's Manual"
+.SH 名前
 drand48, erand48, lrand48, nrand48, mrand48, jrand48, srand48, seed48,
-lcong48 \- °ìÍÍʬÉÛ¤¹¤ëµ¿»÷Íð¿ô¤òÀ¸À®¤¹¤ë´Ø¿ô
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
+lcong48 \- 一様分布する疑似乱数を生成する関数
+.SH 書式
 .nf
-.B #include <stdlib.h>
+\fB#include <stdlib.h>\fP
 .sp
-.B double drand48(void);
+\fBdouble drand48(void);\fP
 .sp
-.BI "double erand48(unsigned short " xsubi [3]);
+\fBdouble erand48(unsigned short \fP\fIxsubi\fP\fB[3]);\fP
 .sp
-.B long int lrand48(void);
+\fBlong int lrand48(void);\fP
 .sp
-.BI "long int nrand48(unsigned short " xsubi [3]);
+\fBlong int nrand48(unsigned short \fP\fIxsubi\fP\fB[3]);\fP
 .sp
-.B long int mrand48(void);
+\fBlong int mrand48(void);\fP
 .sp
-.BI "long int jrand48(unsigned short " xsubi [3]);
+\fBlong int jrand48(unsigned short \fP\fIxsubi\fP\fB[3]);\fP
 .sp
-.BI "void srand48(long int " seedval );
+\fBvoid srand48(long int \fP\fIseedval\fP\fB);\fP
 .sp
-.BI "unsigned short *seed48(unsigned short " seed16v [3]);
+\fBunsigned short *seed48(unsigned short \fP\fIseed16v\fP\fB[3]);\fP
 .sp
-.BI "void lcong48(unsigned short " param [7]);
+\fBvoid lcong48(unsigned short \fP\fIparam\fP\fB[7]);\fP
 .fi
 .sp
 .in -4n
-.\"O Feature Test Macro Requirements for glibc (see
-.\"O .BR feature_test_macros (7)):
-glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
-.RB ( feature_test_macros (7)
-»²¾È):
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
 .in
 .sp
 .ad l
-.\"O All functions shown above:
-¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô:
 .\" .BR drand48 (),
 .\" .BR erand48 (),
 .\" .BR lrand48 (),
@@ -84,249 +79,69 @@ glibc 
 .\" .BR srand48 (),
 .\" .BR seed48 (),
 .\" .BR lcong48 ():
-_SVID_SOURCE || _XOPEN_SOURCE
+上記の全ての関数: _SVID_SOURCE || _XOPEN_SOURCE
 .ad b
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O These functions generate pseudo-random numbers using the linear congruential
-.\"O algorithm and 48-bit integer arithmetic.
-¤³¤ì¤é¤Î´Ø¿ô¤ÏÀþ·Á¹çƱ¥¢¥ë¥´¥ê¥º¥à¤È 48¥Ó¥Ã¥ÈÀ°¿ô±é»»¤òÍѤ¤¤Æ
-µ¿»÷Íð¿ô¤òÀ¸À®¤¹¤ë¡£
+.SH 説明
+これらの関数は線形合同アルゴリズムと 48ビット整数演算を用いて 疑似乱数を生成する。
 .PP
-.\"O The
-.\"O .BR drand48 ()
-.\"O and
-.\"O .BR erand48 ()
-.\"O functions return nonnegative
-.\"O double-precision floating-point values uniformly distributed between
-.\"O [0.0, 1.0).
-´Ø¿ô
-.BR drand48 ()
-¤È
-.BR erand48 ()
-¤Ï¡¢¶è´Ö [0.0, 1.0) ¤Ç
-°ìÍÍʬÉÛ¤¹¤ëÈóÉé¤ÎÇÜÀºÅÙÉâÆ°¾®¿ôÅÀ¼Â¿ôÃͤòÊÖ¤¹¡£
+関数 \fBdrand48\fP()  と \fBerand48\fP()  は、区間 [0.0, 1.0) で 一様分布する非負の倍精度浮動小数点実数値を返す。
 .PP
-.\"O The
-.\"O .BR lrand48 ()
-.\"O and
-.\"O .BR nrand48 ()
-.\"O functions return nonnegative
-.\"O long integers uniformly distributed between 0 and 2^31.
-´Ø¿ô
-.BR lrand48 ()
-¤È
-.BR nrand48 ()
-¤Ï 0 ¤È 2^31 ¤Î´Ö¤Ç°ìÍÍʬÉÛ¤¹¤ë
-ÈóÉé¤Î¥í¥ó¥°À°¿ô¤òÊÖ¤¹¡£
+関数 \fBlrand48\fP()  と \fBnrand48\fP()  は 0 と 2^31 の間で一様分布する 非負のロング整数を返す。
 .PP
-.\"O The
-.\"O .BR mrand48 ()
-.\"O and
-.\"O .BR jrand48 ()
-.\"O functions return signed long
-.\"O integers uniformly distributed between \-2^31 and 2^31.
-´Ø¿ô
-.BR mrand48 ()
-¤È
-.BR jrand48 ()
-¤Ï
-\-2^31 ¤È 2^31 ¤Î´Ö¤Ç°ìÍÍʬÉÛ¤¹¤ëÉä¹æÉÕ¤­¥í¥ó¥°À°¿ô¤òÊÖ¤¹¡£
+関数 \fBmrand48\fP()  と \fBjrand48\fP()  は \-2^31 と 2^31 の間で一様分布する符号付きロング整数を返す。
 .PP
-.\"O The
-.\"O .BR srand48 (),
-.\"O .BR seed48 ()
-.\"O and
-.\"O .BR lcong48 ()
-.\"O functions are
-.\"O initialization functions, one of which should be called before using
-.\"O .BR drand48 (),
-.\"O .BR lrand48 ()
-.\"O or
-.\"O .BR mrand48 ().
-.\"O The functions
-.\"O .BR erand48 (),
-.\"O .BR nrand48 ()
-.\"O and
-.\"O .BR jrand48 ()
-.\"O do not require
-.\"O an initialization function to be called first.
-´Ø¿ô
-.BR srand48 (),
-.BR seed48 (),
-.BR lcong48 ()
-¤Ï½é´ü²½´Ø¿ô
-¤Ç¤¢¤ë¡£
-´Ø¿ô
-.BR drand48 (),
-.BR lrand48 (),
-.BR mrand48 ()
-¤ò
-»ÈÍѤ¹¤ëÁ°¤Ë¡¢¤³¤ì¤é¤Î½é´ü²½´Ø¿ô¤Î¤¤¤º¤ì¤«¤ò¸Æ¤Ö¤Ù¤­¤Ç¤¢¤ë¡£
-´Ø¿ô
-.BR erand48 (),
-.BR nrand48 (),
-.BR jrand48 ()
-¤Ï½é¤á¤Ë
-½é´ü²½´Ø¿ô¤ò¸Æ¤Ö¤³¤È¤òɬÍפȤ·¤Ê¤¤¡£
+関数 \fBsrand48\fP(), \fBseed48\fP(), \fBlcong48\fP()  は初期化関数 である。 関数 \fBdrand48\fP(),
+\fBlrand48\fP(), \fBmrand48\fP()  を 使用する前に、これらの初期化関数のいずれかを呼ぶべきである。 関数
+\fBerand48\fP(), \fBnrand48\fP(), \fBjrand48\fP()  は初めに 初期化関数を呼ぶことを必要としない。
 .PP
-.\"O All the functions work by generating a sequence of 48-bit integers,
-.\"O \fIXi\fP, according to the linear congruential formula:
-¤³¤³¤ÇÀâÌÀ¤·¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î´Ø¿ô¤Ï 48¥Ó¥Ã¥È¤ÎÀ°¿ô¤Î
-¥·¡¼¥±¥ó¥¹ (\fIXi\fP) ¤òÀ¸À®¤¹¤ë¤³¤È¤Ç
-µ¡Ç½¤·¤Æ¤¤¤ë¡£À¸À®ÊýË¡¤Ï°Ê²¼¤ÎÀþ·Á¹çƱ¤Î¼°¤Ë¤è¤ë¡£
+ここで説明しているすべての関数は 48ビットの整数の シーケンス (\fIXi\fP) を生成することで 機能している。生成方法は以下の線形合同の式による。
 .sp
 .nf
 .RS
-.B Xn+1 = (aXn + c) mod m,
+\fBXn+1 = (aXn + c) mod m,\fP
 .RE
 .fi
 .sp
-.\"O The parameter \fIm\fP = 2^48, hence 48-bit integer arithmetic is performed.
-.\"O Unless
-.\"O .BR lcong48 ()
-.\"O is called, \fIa\fP and \fIc\fP are given by:
-¤³¤³¤Ç n >= 0 ¤Ç¤¢¤ë¡£
-¥Ñ¥é¥á¡¼¥¿¤¬ \fIm\fP = 2^48 ¤Ç¤¢¤ë¤¿¤á¡¢48¥Ó¥Ã¥ÈÀ°¿ô±é»»¤¬¹Ô¤ï¤ì¤Æ¤¤¤ë¡£
-.BR lcong48 ()
-¤¬¸Æ¤Ð¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢\fIa\fP ¤È \fIc\fP ¤Ï°Ê²¼¤Î¼°¤ÇÍ¿¤¨¤é¤ì¤ë¡£
+ここで n >= 0 である。 パラメーターが \fIm\fP = 2^48 であるため、48ビット整数演算が行われている。 \fBlcong48\fP()
+が呼ばれていない場合、\fIa\fP と \fIc\fP は以下の式で与えられる。
 .sp
 .nf
 .RS
-.B a = 0x5DEECE66D
-.B c = 0xB
+\fBa = 0x5DEECE66D\fP
+\fBc = 0xB\fP
 .RE
 .fi
 .sp
-.\"O The value returned by any of the functions
-.\"O .BR drand48 (),
-.\"O .BR erand48 (),
-.\"O .BR lrand48 (),
-.\"O .BR nrand48 (),
-.\"O .BR mrand48 ()
-.\"O or
-.\"O .BR jrand48 ()
-.\"O is
-.\"O computed by first generating the next 48-bit \fIXi\fP in the sequence.
-.\"O Then the appropriate number of bits, according to the type of data item to
-.\"O be returned, is copied from the high-order bits of \fIXi\fP and transformed
-.\"O into the returned value.
-´Ø¿ô
-.BR drand48 (),
-.BR erand48 (),
-.BR lrand48 (),
-.BR nrand48 (),
-.BR mrand48 (),
-.BR jrand48 ()
-¤ÇÊÖ¤µ¤ì¤ëÃͤϼ¡¤Î¤è¤¦¤Ë¤·¤Æ·×»»¤µ¤ì¤ë¡£
-¤Ï¤¸¤á¤Ë¡¢¼¡¤Î48¥Ó¥Ã¥È¤Î \fIXi\fP ¤¬·×»»¤µ¤ì¤ë¡£
-¤½¤·¤Æ¡¢ÊÖ¤¹¤Ù¤­¥Ç¡¼¥¿¤Î·¿¤Ë°Í¸¤·¤¿Å¬ÀÚ¤Ê
-¥Ó¥Ã¥È¿ô¤¬ \fIXi\fP ¤Î¾å°Ì¥Ó¥Ã¥È¤«¤é¥³¥Ô¡¼¤µ¤ì¤ë¡£
-ºÇ¸å¤Ë¡¢¤³¤ÎÃͤòÊÖ¤êÃͤËÊÑ´¹¤¹¤ë¡£
+関数 \fBdrand48\fP(), \fBerand48\fP(), \fBlrand48\fP(), \fBnrand48\fP(), \fBmrand48\fP(),
+\fBjrand48\fP()  で返される値は次のようにして計算される。 はじめに、次の48ビットの \fIXi\fP が計算される。
+そして、返すべきデータの型に依存した適切な ビット数が \fIXi\fP の上位ビットからコピーされる。 最後に、この値を返り値に変換する。
 .PP
-.\"O The functions
-.\"O .BR drand48 (),
-.\"O .BR lrand48 ()
-.\"O and
-.\"O .BR mrand48 ()
-.\"O store
-.\"O the last 48-bit \fIXi\fP generated in an internal buffer.
-.\"O The functions
-.\"O .BR erand48 (),
-.\"O .BR nrand48 ()
-.\"O and
-.\"O .BR jrand48 ()
-.\"O require the calling
-.\"O program to provide storage for the successive \fIXi\fP values in the array
-.\"O argument \fIxsubi\fP.
-.\"O The functions are initialized by placing the initial
-.\"O value of \fIXi\fP into the array before calling the function for the first
-.\"O time.
-´Ø¿ô
-.BR drand48 (),
-.BR lrand48 (),
-.BR mrand48 ()
-¤Ï
-ºÇ¸å¤ËÀ¸À®¤µ¤ì¤¿48¥Ó¥Ã¥È¤Î \fIXi\fP ¤òÆâÉô¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤¹¤ë¡£
-ÇÛÎó¤Î·Á¤Î°ú¿ô \fIxsubi\fP ¤Ë¸Ä¡¹¤Î \fIXi\fP ¤ÎÃͤò
-³ÊǼ¤Ç¤­¤ë¤è¤¦¤ÊÎΰè¤ò³ÎÊݤ¹¤ë¤³¤È¤ò¡¢
-´Ø¿ô
-.BR erand48 (),
-.BR nrand48 (),
-.BR jrand48 ()
-¤Ï¡¢
-¸Æ¤Ó½Ð¤·Â¦¤Î¥×¥í¥°¥é¥à¤ËÍ׵᤹¤ë¡£
-¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤Ï¤¸¤á¤Æ¤½¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤ÖÁ°¤Ë \fIXi\fP ¤Î½é´üÃͤòÇÛÎó¤Ë
-ÂåÆþ¤¹¤ë¤³¤È¤Ç½é´ü²½¤µ¤ì¤ë¡£
+関数 \fBdrand48\fP(), \fBlrand48\fP(), \fBmrand48\fP()  は 最後に生成された48ビットの \fIXi\fP
+を内部バッファーに格納する。 配列の形の引数 \fIxsubi\fP に個々の \fIXi\fP の値を 格納できるような領域を確保することを、 関数
+\fBerand48\fP(), \fBnrand48\fP(), \fBjrand48\fP()  は、 呼び出し側のプログラムに要求する。
+これらの関数は、はじめてそれらの関数を呼ぶ前に \fIXi\fP の初期値を配列に 代入することで初期化される。
 .PP
-.\"O The initializer function
-.\"O .BR srand48 ()
-.\"O sets the high order 32-bits of
-.\"O \fIXi\fP to the argument \fIseedval\fP.
-.\"O The low order 16-bits are set
-.\"O to the arbitrary value 0x330E.
-½é´ü²½´Ø¿ô
-.BR srand48 ()
-¤Ï¡¢\fIXi\fP ¤Î
-¾å°Ì32¥Ó¥Ã¥È¤ò°ú¿ô \fIseedval\fP ¤ËÀßÄꤹ¤ë¡£
-²¼°Ì¤Î16¥Ó¥Ã¥È¤Ï¡¢Å¬Åö¤Ë·è¤á¤é¤ì¤¿ÃͤǤ¢¤ë0x330E¤ËÀßÄꤵ¤ì¤ë¡£
+初期化関数 \fBsrand48\fP()  は、\fIXi\fP の 上位32ビットを引数 \fIseedval\fP に設定する。
+下位の16ビットは、適当に決められた値である0x330Eに設定される。
 .PP
-.\"O The initializer function
-.\"O .BR seed48 ()
-.\"O sets the value of \fIXi\fP to
-.\"O the 48-bit value specified in the array argument \fIseed16v\fP.
-.\"O The
-.\"O previous value of \fIXi\fP is copied into an internal buffer and a
-.\"O pointer to this buffer is returned by
-.\"O .BR seed48 ().
-½é´ü²½´Ø¿ô
-.BR seed48 ()
-¤Ï¡¢\fIXi\fP ¤ÎÃͤò¡¢
-ÇÛÎó¤Î·Á¤ò¤·¤¿°ú¿ô¤Ç¤¢¤ë \fIseed16v\fP ¤ÎÃæ¤Ç»ØÄꤵ¤ì¤¿ 48¥Ó¥Ã¥È¤ÎÃͤËÀßÄꤹ¤ë¡£
-\fIXi\fP ¤ÎÁ°¤ÎÃͤÏÆâÉô¥Ð¥Ã¥Õ¥¡¤Ë¥³¥Ô¡¼¤µ¤ì¡¢¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬
-.BR seed48 ()
-¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë¡£
+初期化関数 \fBseed48\fP()  は、\fIXi\fP の値を、 配列の形をした引数である \fIseed16v\fP の中で指定された
+48ビットの値に設定する。 \fIXi\fP の前の値は内部バッファーにコピーされ、このバッファーへのポインターが \fBseed48\fP()
+によって返される。
 .PP
-.\"O The initialization function
-.\"O .BR lcong48 ()
-.\"O allows the user to specify
-.\"O initial values for \fIXi\fP, \fIa\fP and \fIc\fP.
-.\"O Array argument
-.\"O elements \fIparam[0-2]\fP specify \fIXi\fP, \fIparam[3-5]\fP specify
-.\"O \fIa\fP, and \fIparam[6]\fP specifies \fIc\fP.
-.\"O After
-.\"O .BR lcong48 ()
-.\"O has been called, a subsequent call to either
-.\"O .BR srand48 ()
-.\"O or
-.\"O .BR seed48 ()
-.\"O will restore the standard values of \fIa\fP and \fIc\fP.
-½é´ü²½´Ø¿ô
-.BR lcong48 ()
-¤Ï»ÈÍѼԤ¬ \fIXi\fP, \fIa\fP, \fIc\fP ¤Î
-½é´üÃͤò»ØÄꤹ¤ë¤¿¤á¤Î´Ø¿ô¤Ç¤¢¤ë¡£
-ÇÛÎó¤Î·Á¤ò¤·¤¿°ú¿ô¤ÎÍ×ÁǤϤ½¤ì¤¾¤ì¡¢\fIparam[0-2]\fP ¤Ï \fIXi\fP ¤ò¡¢
-\fIparam[3-5]\fP ¤Ï \fIa\fP ¤ò¡¢\fIparam[6]\fP ¤Ï \fIc\fP ¤ò»ØÄꤹ¤ë¤â¤Î
-¤Ç¤¢¤ë¡£
-.BR lcong48 ()
-¤¬¸Æ¤Ð¤ì¤¿¸å¤Ç¡¢
-.BR srand48 ()
-¤«
-.BR seed48 ()
-¤ò¸Æ¤Ö¤È¡¢Á°½Ò¤Î \fIa\fP ¤È \fIc\fP ¤Î
-ɸ½àÃͤ¬ºÆ¤ÓÀßÄꤵ¤ì¤ë¡£
-.SH ½àµò
-SVr4, POSIX.1-2001.
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O These functions are declared obsolete by SVID 3, which states that
-.\"O .BR rand (3)
-.\"O should be used instead.
-SVID 3 ¤Ç¤Ï¤³¤ì¤é¤Î´Ø¿ô¤Ï»þÂåÃÙ¤ì¤ÈÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£
-SVID 3 ¤Ç¤Ï
-.BR rand (3)
-¤¬Âå¤ï¤ê¤Ë»ÈÍѤµ¤ì¤ë¤Ù¤­¤À¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR rand (3),
-.BR random (3)
+初期化関数 \fBlcong48\fP()  は使用者が \fIXi\fP, \fIa\fP, \fIc\fP の 初期値を指定するための関数である。
+配列の形をした引数の要素はそれぞれ、\fIparam[0\-2]\fP は \fIXi\fP を、 \fIparam[3\-5]\fP は \fIa\fP
+を、\fIparam[6]\fP は \fIc\fP を指定するもの である。 \fBlcong48\fP()  が呼ばれた後で、 \fBsrand48\fP()  か
+\fBseed48\fP()  を呼ぶと、前述の \fIa\fP と \fIc\fP の 標準値が再び設定される。
+.SH 属性
+.SS "マルチスレッディング (pthreads(7) 参照)"
+関数 \fBdrand48\fP(), \fBerand48\fP(), \fBlrand48\fP(), \fBnrand48\fP(), \fBmrand48\fP(),
+\fBjrand48\fP(), \fBsrand48\fP(), \fBseed48\fP(), \fBlcong48\fP() は、
+乱数生成に使用する状態情報をグローバルに保持する。 そのため、 これらの関数はスレッドセーフではない。
+.SH 準拠
+SVr4, POSIX.1\-2001.
+.SH 関連項目
+\fBrand\fP(3), \fBrandom\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。