OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / release / man3 / drand48.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 Sat Jul 24 19:46:03 1993 by Rik Faith (faith@cs.unc.edu)
28 .\"
29 .\" Japanese Version Copyright (c) 1997 YOSHINO Takashi
30 .\"       all rights reserved.
31 .\" Translated Mon Jan 20 20:04:05 JST 1997
32 .\"       by YOSHINO Takashi <yoshino@civil.jcn.nihon-u.ac.jp>
33 .\"
34 .\" WORD: internal buffer  ÆâÉô¥Ð¥Ã¥Õ¥¡
35 .\"
36 .TH DRAND48 3  2007-07-26 "" "Linux Programmer's Manual"
37 .SH Ì¾Á°
38 drand48, erand48, lrand48, nrand48, mrand48, jrand48, srand48, seed48,
39 lcong48 \- °ìÍÍʬÉÛ¤¹¤ëµ¿»÷Íð¿ô¤òÀ¸À®¤¹¤ë´Ø¿ô
40 .SH ½ñ¼°
41 .nf
42 .B #include <stdlib.h>
43 .sp
44 .B double drand48(void);
45 .sp
46 .BI "double erand48(unsigned short " xsubi [3]);
47 .sp
48 .B long int lrand48(void);
49 .sp
50 .BI "long int nrand48(unsigned short " xsubi [3]);
51 .sp
52 .B long int mrand48(void);
53 .sp
54 .BI "long int jrand48(unsigned short " xsubi [3]);
55 .sp
56 .BI "void srand48(long int " seedval );
57 .sp
58 .BI "unsigned short *seed48(unsigned short " seed16v [3]);
59 .sp
60 .BI "void lcong48(unsigned short " param [7]);
61 .fi
62 .sp
63 .in -4n
64 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
65 .RB ( feature_test_macros (7)
66 »²¾È):
67 .in
68 .sp
69 .ad l
70 ¾åµ­¤ÎÁ´¤Æ¤Î´Ø¿ô:
71 .\" .BR drand48 (),
72 .\" .BR erand48 (),
73 .\" .BR lrand48 (),
74 .\" .BR nrand48 (),
75 .\" .BR mrand48 (),
76 .\" .BR jrand48 (),
77 .\" .BR srand48 (),
78 .\" .BR seed48 (),
79 .\" .BR lcong48 ():
80 _SVID_SOURCE || _XOPEN_SOURCE
81 .ad b
82 .SH ÀâÌÀ
83 ¤³¤ì¤é¤Î´Ø¿ô¤ÏÀþ·Á¹çƱ¥¢¥ë¥´¥ê¥º¥à¤È 48¥Ó¥Ã¥ÈÀ°¿ô±é»»¤òÍѤ¤¤Æ
84 µ¿»÷Íð¿ô¤òÀ¸À®¤¹¤ë¡£
85 .PP
86 ´Ø¿ô
87 .BR drand48 ()
88 ¤È
89 .BR erand48 ()
90 ¤Ï¡¢¶è´Ö [0.0, 1.0) ¤Ç
91 °ìÍÍʬÉÛ¤¹¤ëÈóÉé¤ÎÇÜÀºÅÙÉâÆ°¾®¿ôÅÀ¼Â¿ôÃͤòÊÖ¤¹¡£
92 .PP
93 ´Ø¿ô
94 .BR lrand48 ()
95 ¤È
96 .BR nrand48 ()
97 ¤Ï 0 ¤È 2^31 ¤Î´Ö¤Ç°ìÍÍʬÉÛ¤¹¤ë
98 ÈóÉé¤Î¥í¥ó¥°À°¿ô¤òÊÖ¤¹¡£
99 .PP
100 ´Ø¿ô
101 .BR mrand48 ()
102 ¤È
103 .BR jrand48 ()
104 ¤Ï
105 \-2^31 ¤È 2^31 ¤Î´Ö¤Ç°ìÍÍʬÉÛ¤¹¤ëÉä¹æÉÕ¤­¥í¥ó¥°À°¿ô¤òÊÖ¤¹¡£
106 .PP
107 ´Ø¿ô
108 .BR srand48 (),
109 .BR seed48 (),
110 .BR lcong48 ()
111 ¤Ï½é´ü²½´Ø¿ô
112 ¤Ç¤¢¤ë¡£
113 ´Ø¿ô
114 .BR drand48 (),
115 .BR lrand48 (),
116 .BR mrand48 ()
117 ¤ò
118 »ÈÍѤ¹¤ëÁ°¤Ë¡¢¤³¤ì¤é¤Î½é´ü²½´Ø¿ô¤Î¤¤¤º¤ì¤«¤ò¸Æ¤Ö¤Ù¤­¤Ç¤¢¤ë¡£
119 ´Ø¿ô
120 .BR erand48 (),
121 .BR nrand48 (),
122 .BR jrand48 ()
123 ¤Ï½é¤á¤Ë
124 ½é´ü²½´Ø¿ô¤ò¸Æ¤Ö¤³¤È¤òɬÍפȤ·¤Ê¤¤¡£
125 .PP
126 ¤³¤³¤ÇÀâÌÀ¤·¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î´Ø¿ô¤Ï 48¥Ó¥Ã¥È¤ÎÀ°¿ô¤Î
127 ¥·¡¼¥±¥ó¥¹ (\fIXi\fP) ¤òÀ¸À®¤¹¤ë¤³¤È¤Ç
128 µ¡Ç½¤·¤Æ¤¤¤ë¡£À¸À®ÊýË¡¤Ï°Ê²¼¤ÎÀþ·Á¹çƱ¤Î¼°¤Ë¤è¤ë¡£
129 .sp
130 .nf
131 .RS
132 .B Xn+1 = (aXn + c) mod m,
133 .RE
134 .fi
135 .sp
136 ¤³¤³¤Ç n >= 0 ¤Ç¤¢¤ë¡£
137 ¥Ñ¥é¥á¡¼¥¿¤¬ \fIm\fP = 2^48 ¤Ç¤¢¤ë¤¿¤á¡¢48¥Ó¥Ã¥ÈÀ°¿ô±é»»¤¬¹Ô¤ï¤ì¤Æ¤¤¤ë¡£
138 .BR lcong48 ()
139 ¤¬¸Æ¤Ð¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢\fIa\fP ¤È \fIc\fP ¤Ï°Ê²¼¤Î¼°¤ÇÍ¿¤¨¤é¤ì¤ë¡£
140 .sp
141 .nf
142 .RS
143 .B a = 0x5DEECE66D
144 .B c = 0xB
145 .RE
146 .fi
147 .sp
148 ´Ø¿ô
149 .BR drand48 (),
150 .BR erand48 (),
151 .BR lrand48 (),
152 .BR nrand48 (),
153 .BR mrand48 (),
154 .BR jrand48 ()
155 ¤ÇÊÖ¤µ¤ì¤ëÃͤϼ¡¤Î¤è¤¦¤Ë¤·¤Æ·×»»¤µ¤ì¤ë¡£
156 ¤Ï¤¸¤á¤Ë¡¢¼¡¤Î48¥Ó¥Ã¥È¤Î \fIXi\fP ¤¬·×»»¤µ¤ì¤ë¡£
157 ¤½¤·¤Æ¡¢ÊÖ¤¹¤Ù¤­¥Ç¡¼¥¿¤Î·¿¤Ë°Í¸¤·¤¿Å¬ÀÚ¤Ê
158 ¥Ó¥Ã¥È¿ô¤¬ \fIXi\fP ¤Î¾å°Ì¥Ó¥Ã¥È¤«¤é¥³¥Ô¡¼¤µ¤ì¤ë¡£
159 ºÇ¸å¤Ë¡¢¤³¤ÎÃͤòÊÖ¤êÃͤËÊÑ´¹¤¹¤ë¡£
160 .PP
161 ´Ø¿ô
162 .BR drand48 (),
163 .BR lrand48 (),
164 .BR mrand48 ()
165 ¤Ï
166 ºÇ¸å¤ËÀ¸À®¤µ¤ì¤¿48¥Ó¥Ã¥È¤Î \fIXi\fP ¤òÆâÉô¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤¹¤ë¡£
167 ÇÛÎó¤Î·Á¤Î°ú¿ô \fIxsubi\fP ¤Ë¸Ä¡¹¤Î \fIXi\fP ¤ÎÃͤò
168 ³ÊǼ¤Ç¤­¤ë¤è¤¦¤ÊÎΰè¤ò³ÎÊݤ¹¤ë¤³¤È¤ò¡¢
169 ´Ø¿ô
170 .BR erand48 (),
171 .BR nrand48 (),
172 .BR jrand48 ()
173 ¤Ï¡¢
174 ¸Æ¤Ó½Ð¤·Â¦¤Î¥×¥í¥°¥é¥à¤ËÍ׵᤹¤ë¡£
175 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢¤Ï¤¸¤á¤Æ¤½¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤ÖÁ°¤Ë \fIXi\fP ¤Î½é´üÃͤòÇÛÎó¤Ë
176 ÂåÆþ¤¹¤ë¤³¤È¤Ç½é´ü²½¤µ¤ì¤ë¡£
177 .PP
178 ½é´ü²½´Ø¿ô
179 .BR srand48 ()
180 ¤Ï¡¢\fIXi\fP ¤Î
181 ¾å°Ì32¥Ó¥Ã¥È¤ò°ú¿ô \fIseedval\fP ¤ËÀßÄꤹ¤ë¡£
182 ²¼°Ì¤Î16¥Ó¥Ã¥È¤Ï¡¢Å¬Åö¤Ë·è¤á¤é¤ì¤¿ÃͤǤ¢¤ë0x330E¤ËÀßÄꤵ¤ì¤ë¡£
183 .PP
184 ½é´ü²½´Ø¿ô
185 .BR seed48 ()
186 ¤Ï¡¢\fIXi\fP ¤ÎÃͤò¡¢
187 ÇÛÎó¤Î·Á¤ò¤·¤¿°ú¿ô¤Ç¤¢¤ë \fIseed16v\fP ¤ÎÃæ¤Ç»ØÄꤵ¤ì¤¿ 48¥Ó¥Ã¥È¤ÎÃͤËÀßÄꤹ¤ë¡£
188 \fIXi\fP ¤ÎÁ°¤ÎÃͤÏÆâÉô¥Ð¥Ã¥Õ¥¡¤Ë¥³¥Ô¡¼¤µ¤ì¡¢¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬
189 .BR seed48 ()
190 ¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë¡£
191 .PP
192 ½é´ü²½´Ø¿ô
193 .BR lcong48 ()
194 ¤Ï»ÈÍѼԤ¬ \fIXi\fP, \fIa\fP, \fIc\fP ¤Î
195 ½é´üÃͤò»ØÄꤹ¤ë¤¿¤á¤Î´Ø¿ô¤Ç¤¢¤ë¡£
196 ÇÛÎó¤Î·Á¤ò¤·¤¿°ú¿ô¤ÎÍ×ÁǤϤ½¤ì¤¾¤ì¡¢\fIparam[0-2]\fP ¤Ï \fIXi\fP ¤ò¡¢
197 \fIparam[3-5]\fP ¤Ï \fIa\fP ¤ò¡¢\fIparam[6]\fP ¤Ï \fIc\fP ¤ò»ØÄꤹ¤ë¤â¤Î
198 ¤Ç¤¢¤ë¡£
199 .BR lcong48 ()
200 ¤¬¸Æ¤Ð¤ì¤¿¸å¤Ç¡¢
201 .BR srand48 ()
202 ¤«
203 .BR seed48 ()
204 ¤ò¸Æ¤Ö¤È¡¢Á°½Ò¤Î \fIa\fP ¤È \fIc\fP ¤Î
205 ɸ½àÃͤ¬ºÆ¤ÓÀßÄꤵ¤ì¤ë¡£
206 .SH ½àµò
207 SVr4, POSIX.1-2001.
208 .SH Ãí°Õ
209 SVID 3 ¤Ç¤Ï¤³¤ì¤é¤Î´Ø¿ô¤Ï»þÂåÃÙ¤ì¤ÈÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£
210 SVID 3 ¤Ç¤Ï
211 .BR rand (3)
212 ¤¬Âå¤ï¤ê¤Ë»ÈÍѤµ¤ì¤ë¤Ù¤­¤À¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¡£
213 .SH ´ØÏ¢¹àÌÜ
214 .BR rand (3),
215 .BR random (3)