help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rand implementation question


From: Przemek Klosowski
Subject: Re: Rand implementation question
Date: Fri, 28 Feb 2014 13:39:35 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 02/27/2014 10:04 PM, mpender wrote:
should be some efficient way to extract multiple bits from a single
double-precision floating point value returned by the Mersenne twister.
in general, it's a bad idea to extract bitfields from a pseudo-random number generators (it's also  famously bad to aggregate consecutive values, as shown by classic Marsaglia paper http://www.pnas.org/content/61/1/25.full.pdf)

Now, the Mersenne twister may not be subject to those problems, but one should refrain from using the generators in a way that they weren't designed or tested for. Hence, it's best to use randi() which just plain gives integers without any gymnastics.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]