<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap:break-word">
<pre style="word-wrap:break-word; font-size:10.0pt; font-family:Tahoma; color:black">
7> [erlang:spawn( fun() -> random:seed(X,Y,0), io:fwrite("~p ", [random:uniform(3)]) end ) || X<-lists:seq(1,10), Y<-lists:seq(1,10)].
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Sent from Moxier Mail
(http://www.moxier.com)
----- Ursprungligt meddelande -----
Från: Bengt Kleberg <bengt.kleberg@ericsson.com>
Till: null
Kopia: "erlang-questions@erlang.org" <erlang-questions@erlang.org>
Skickat: 27-10-2013 11:33 fm
Ämne: Re: [erlang-questions] more random uniform
</pre>
<div>
<pre style="word-wrap:break-word; font-size:10.0pt; font-family:Tahoma; color:black">Thank you.
I have 15B.
Is the erase/1 necessary? I am using new processes each time.
Bengt
Sent from Moxier Mail
(http://www.moxier.com)
----- Ursprungligt meddelande -----
Från: Tony Rogvall <tony@rogvall.se>
Till: Bengt Kleberg <bengt.kleberg@ericsson.com>
Kopia: "erlang-questions@erlang.org" <erlang-questions@erlang.org>
Skickat: 27-10-2013 11:13 fm
Ämne: Re: [erlang-questions] more random uniform
</pre>
<div>I can not replicate this (on R16B01).
<div><br>
</div>
<div>
<div>> erase(random_seed), random:seed(erlang:now()), random:uniform(3).</div>
<div>1</div>
<div>
<div>> erase(random_seed), random:seed(erlang:now()), random:uniform(3).</div>
<div>2</div>
</div>
<div>...</div>
<div><br>
</div>
<div>?</div>
<div><br>
</div>
<div>/Tony</div>
<div><br>
</div>
<div><br>
<div>
<div>
<div>On 27 okt 2013, at 10:45, Bengt Kleberg <<a href="mailto:bengt.kleberg@ericsson.com">bengt.kleberg@ericsson.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">Greetings,<br>
<br>
When doing random:uniform/1 for small values, ie 3, the result is 1 the first time. Changing the seed does not help.<br>
What am I missing?<br>
<br>
<br>
Bengt<br>
<br>
Sent from Moxier Mail<br>
(<a href="http://www.moxier.com">http://www.moxier.com</a>)<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
http://erlang.org/mailman/listinfo/erlang-questions<br>
</blockquote>
</div>
<br>
<div><span class="Apple-style-span" style="border-collapse:separate; border-spacing:0px">
<div><span class="Apple-style-span" style="color:rgb(51,51,51); font-family:Geneva,Arial,Helvetica,sans-serif; font-size:12px">"Installing applications can lead to corruption over time. </span><span class="Apple-style-span" style="color:rgb(51,51,51); font-family:Geneva,Arial,Helvetica,sans-serif; font-size:12px">Applications
gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix"</span></div>
<div><span class="Apple-style-span" style="color:rgb(51,51,51); font-family:Geneva,Arial,Helvetica,sans-serif; font-size:12px"><br>
</span></div>
</span><br class="Apple-interchange-newline">
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>