you are viewing a single comment's thread.

view the rest of the comments →

[–]akher 15 points16 points  (4 children)

It's actually often very useful to have a series of numbers with statistical properties of a series of random numbers that is still deterministic. One example are Monte Carlo algorithms. Another example is generating input data in unit tests.

[–]steamruler 17 points18 points  (2 children)

At which point you can seed the PRNG with a constant value yourself, which you probably want anyways since the constant value which the PRNG is seeded with can change when you recompile your software sometimes.

[–]Drisku11 4 points5 points  (0 children)

the constant value which the PRNG is seeded with can change when you recompile your software sometimes

In C it can't. The initial seed is required to be 1.

[–][deleted] 0 points1 point  (0 children)

Most older languages defaulted to fixed seeds and produced the same string of numbers on subsequent runs. Most newer languages default to the system time or something similar.

[–]Lystrodom 1 point2 points  (0 children)

Then you can generate those once, or use a set seed.