Mersienne Twister
Derek Parnell
derek at psych.ward
Thu Apr 13 06:23:35 PDT 2006
I did a port of the Mersienne Twister (C-language edition) by Takuji
Nishimura and Makoto Matsumoto into D. It is a free function version and
doesn't use any classes. It also has a template for ranged random numbers.
eg..
uint v = genrand_range!(uint)(1, 10));
double f = genrand_range!(double)(-0.5, 0.5))
It can be found at
http://www.users.bigpond.com/ddparnell/mt.d
To get the object file only, compile with
dmd -c mt
to get a stand alone self-test version compile with
dmd -version=main mt
--
Derek Parnell
Melbourne, Australia
More information about the Digitalmars-d-announce
mailing list