[MLton-devel] random numbers

Henry Cejtin henry@sourcelight.com
Tue, 14 May 2002 01:57:59 -0500


I was inspired by the discussion on usenet about random number generators and
ended up implementing the Mersenne Twister one discussed there.  Stephen, you
said  that  `you  used  one  from ... in Numerical recipies), but it isn't in
MLton, is it?

Is it really true that there isn't one in the basis library?

Any way, I'm going to play with it a bit to make sure that it is as  good  as
the paper
    http://www.math.keio.ac.jp/~matumoto/emt.html
seems  to  indicate  that  it is.  Then we can at least replace the MLton one
with one that gets the seed from /dev/?random and uses this.

Is it worth it to include real number output?  Is it worth it to have all the
mantissa  bits  be  random?   It  isn't  hard,  it  just means 2 calls to the
underlying Word32-producing random number generator.

Any suggested utilities?  At the moment  the  only  things  exported  in  the
structure are

    val init: Word32.word -> unit
    val random: unit -> Word32.word

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth@sourceforge.net
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel