[mercury-users] Converting time_t to int using common library?

Peter Wang wangp at students.csse.unimelb.edu.au
Thu Feb 15 10:27:13 AEDT 2007


On 2007-02-14, doug.auclair at logicaltypes.com <doug.auclair at logicaltypes.com> wrote:
> ... and while we're on the topic ...
> 
> I'm generating many random floats, and it would be nice to extend
> random to have a pred that returns a random value between 0.0
> and 1.0 ... of course, it is doable with
> 
> randmax(Maxie, !RNG),
> random(Intie, !RNG),
> Floatie = float(Intie) / float(Maxie)
> 
> but I worry about the randomness of the float value returned
> (should I?)

AFAIK you should be worried about the randomness of the `random' module
anyway.  Just wrap up your favourite C PRNG and use that instead.

Peter

--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list