Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'implements': 0.07; 'creighton': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'url:github': 0.09; 'python.': 0.11; 'generator.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:Cython': 0.16; 'wrote:': 0.16; 'laura': 0.18; 'header:In-Reply-To:1': 0.24; 'url:download': 0.24; 'header:User-Agent:1': 0.26; 'header:X -Complaints-To:1': 0.26; 'random': 0.29; 'usually': 0.33; 'to:addr :python-list': 0.35; 'something': 0.35; 'url:org': 0.36; 'subject:: ': 0.37; 'received:org': 0.38; 'to:addr:python.org': 0.39; 'grab': 0.61; 'charset:windows-1252': 0.65; 'subject:. ': 0.66; 'url:master': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Sturla Molden Subject: Re: Python Random vs. Cython C Rand for Dice Rolls Date: Mon, 08 Jun 2015 23:44:53 +0200 References: <55748e6d$0$13008$c3e8da3$5496439d@news.astraweb.com> <201506081733.t58HX7Ft006182@fido.openend.se> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 60-177-11.connect.netcom.no User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <201506081733.t58HX7Ft006182@fido.openend.se> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433799910 news.xs4all.nl 2870 [2001:888:2000:d::a6]:58777 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92350 On 08/06/15 19:33, Laura Creighton wrote: > Better C random number generator. > http://www.pcg-random.org/download.html Or for something less minimalistic, just grab randomkit.c and randomkit.h from NumPy, which implements the same Mersenne Twister as Python. That is what I usually do to get fast random numbers from Cython https://github.com/numpy/numpy/tree/master/numpy/random/mtrand Sturla