|
![](/i/fill.gif) |
Phoenex <rib### [at] sapo pt> wrote:
> This algorithm is not a basic LCG.
> If you Check carefully the tests, you can not find weaknesses or shortcomings.
Unless someone explains in more detail how it's different from a basic
LCG, I can't see why it's different. It's doing the basic LCG formula:
seed = (seed*a + b) mod 1.0
with a value of 0.0 for b (which is interesting, but doesn't really
differentiate it much from a basic LCG).
I wonder if the "quality" of this RNG is not simply caused by its
typical usage: The highest bits of the result are used, rather than
the lowest bits, which is a rather common mistake on integral LCGs.
> In addition it is very, but very fast.
It might be pretty fast if you want to generate random floating point
numbers in the range [0.0, 1.0]. It beats integral RNGs in that with
them you have to perform a floating point division to scale them to the
[0.0, 1.0] range, which is slow.
OTOH, it wouldn't be very fast to generate integer random numbers.
The remaining question would be the quality of the randomness.
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |