File: manual052.html

package info (click to toggle)
ocaml-doc 2.04-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,820 kB
  • ctags: 997
  • sloc: makefile: 38; sh: 12
file content (66 lines) | stat: -rw-r--r-- 2,203 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset= ISO-8859-1">
<TITLE>
 Module Random: pseudo-random number generator
</TITLE>
</HEAD>
<BODY >
<A HREF="manual051.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="manual053.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<A HREF="manual030.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<HR>

<H2>17.22&nbsp;&nbsp; Module <TT>Random</TT>: pseudo-random number generator</H2><A NAME="s:Random"></A>
<A NAME="@manual424"></A><PRE>
val init : int -&gt; unit
</PRE>
<A NAME="@manual425"></A><BLOCKQUOTE>
Initialize the generator, using the argument as a seed.
The same seed will always yield the same sequence of numbers. 
</BLOCKQUOTE>
<PRE>
val full_init : int array -&gt; unit
</PRE>
<A NAME="@manual426"></A><BLOCKQUOTE>
Same as <CODE>init</CODE> but takes more data as seed. 
</BLOCKQUOTE>
<PRE>
val self_init : unit -&gt; unit
</PRE>
<A NAME="@manual427"></A><BLOCKQUOTE>
Initialize the generator with a more-or-less random seed chosen
in a system-dependent way. 
</BLOCKQUOTE>
<PRE>
val bits : unit -&gt; int
</PRE>
<A NAME="@manual428"></A><BLOCKQUOTE>
Return 30 random bits in a nonnegative integer. 
</BLOCKQUOTE>
<PRE>
val int : int -&gt; int
</PRE>
<A NAME="@manual429"></A><BLOCKQUOTE>
<CODE>Random.int bound</CODE> returns a random integer between 0 (inclusive)
and <CODE>bound</CODE> (exclusive). <CODE>bound</CODE> must be more than 0 and less
than 2<SUP><FONT SIZE=2>30</FONT></SUP>. 
</BLOCKQUOTE>
<PRE>
val float : float -&gt; float
</PRE>
<A NAME="@manual430"></A><BLOCKQUOTE>
<CODE>Random.float bound</CODE> returns a random floating-point number
between 0 (inclusive) and <CODE>bound</CODE> (exclusive). If <CODE>bound</CODE> is
negative, the result is negative. If <CODE>bound</CODE> is 0, the result
is 0. 
</BLOCKQUOTE>

<HR>
<A HREF="manual051.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="manual053.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<A HREF="manual030.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
</BODY>
</HTML>