commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles <>
Subject [Math] Add 64-bits based RNG (Was: [Math] New base class for all RNGs)
Date Sun, 10 Jan 2016 04:09:21 GMT

Relevant excerpt of previous posts:

>> [...]
>> Something implicit in "BitStreamGenerator": the maximum number of
>> bits is 32 (cf. return type of "next(int)" and the ubiquitous use
>> of hard-coded "32".
>> What about the possibility of using a "long" as a building block
>> for another family of RNG?
> Why?  We don't have contributions of other RNGs implemented using
> 64-bit blocks of data.  In theory, I guess you could do that, but I
> don't know of any and all the ones we have use 32-bit words.
> Phil
>> Gilles

CPUs and OS are nowadays commonly 64-bits based.
Thus one could legitimately wonder whether, on such systems, generating
   one "long" value
would not be faster than generating
   two "int" values,
especially when 64 bits are necessary in order to produce the next 
"long" or "double" value.

There indeed exist 64-bits implementations of RNGs:

I thus propose to create a feature branch that will contain
* a new interface, for when "nextLong()" is the "random bits" producer
* the (adapted) "xorshift1024*" RNG implementation from
* an "adapter" to the existing generic methods
* benchmarking code


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message