| Store | Cart

Pure python implementation of Mersenne Twister?

From: Sean Shaleh Perry <shal...@attbi.com>
Tue, 29 Oct 2002 08:25:05 -0800
On Tuesday 29 October 2002 07:25, PoulsenL at capanalysis.com wrote:
> I know of at least 3 implementations of the Mersenne Twister algorithm as C> extensions for python, but has anyone written one in pure python, for> educational purposes, for example?>> Thanks in advance,>> Loren

so I hit google, found the mersenne home page, grabbed a C source and 
transliterated it to python.  The two output identical results so i have some 
faith in the translation.  Took me about 15 minutes, testing and all.

Attached is the .py and the original .c.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mersenne.py
Type: text/x-python
Size: 3745 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20021029/125e5f3a/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mersenne.c
Type: text/x-csrc
Size: 4291 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20021029/125e5f3a/attachment.c>

Recent Messages in this Thread
Poul...@capanalysis.com Oct 29, 2002 03:25 pm
Andrew Thompson Oct 29, 2002 03:55 pm
Emile van Sebille Oct 29, 2002 04:01 pm
Sean Shaleh Perry Oct 29, 2002 04:25 pm
Tim Peters Oct 29, 2002 04:50 pm
Messages in this thread