From: "Török Edwin" <edwintorok@gmail.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] portablility of random.mli in the stdlib
Date: Sat, 30 Apr 2011 14:26:16 +0300 [thread overview]
Message-ID: <4DBBF1D8.6020105@gmail.com> (raw)
In-Reply-To: <4DBBEF0B.2050204@univ-savoie.fr>
On 04/30/2011 02:14 PM, Christophe Raffalli wrote:
> Le 30/04/11 12:37, Christophe Raffalli a écrit :
>> Hello,
>>
>> Playing with my game (see my previous post), I saw that it seems that
>> the random number generator in not portable ... The same seed will not
>> give the same random sequence on a 32 bits and 64 bits machine ...
>>
> In fact it was a change in random generator in ocaml 3.12
>
> ------------------------------------
> Objective Caml version 3.12.0+beta1
>
> # Random.init 0;;
> - : unit = ()
> # Random.float 1.0;;
> - : float = 0.849294619789682792
> ------------------------------------
> Objective Caml version 3.11.2
>
> # Random.init 0;;
> - : unit = ()
> # Random.float 1.0;;
> - : float = 0.454763353840783646
>
>
> This means that any long living program should use its own random
> generator ?
>
Why should a random generator give the same results over multiple
versions and architectures?
Starting from same seed is useful only for debugging.
Best regards,
--Edwin
next prev parent reply other threads:[~2011-04-30 11:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-30 10:37 Christophe Raffalli
2011-04-30 11:14 ` Christophe Raffalli
2011-04-30 11:26 ` Török Edwin [this message]
2011-04-30 11:42 ` Christophe Raffalli
2011-04-30 15:38 ` Andrei Formiga
2011-04-30 12:06 ` Alexandre Pilkiewicz
2011-04-30 13:33 ` Andrew
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DBBF1D8.6020105@gmail.com \
--to=edwintorok@gmail.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox