Skip to main content

All Questions

Filter by
Sorted by
Tagged with
6 votes
3 answers
2k views

How good are current implementations of rand() in C?

There is a lot of literature that indicates using rand() for simulations might be harmful. A couple of them are as follows: https://www.sciencedirect.com/science/...
physkets's user avatar
2 votes
1 answer
190 views

What PRNG function is this?

This is a 16-bit PRNG function, transcribed from assembly to C for easier reading: ...
Andrew Cheong's user avatar
1 vote
1 answer
110 views

PETCs - How should one initialize PetscRandom?

The documentation of PETSc shows an example of usage: ...
guhur's user avatar
  • 133
1 vote
2 answers
106 views

Maintain Uniform Distribution across Subranges

Note: this is a continuation of Generate Random Number outside Bounds. I have a function (thanks to the previous question) with the following prototype which returns an integer in the range $[0,b]$, $...
user19087's user avatar
  • 143
8 votes
1 answer
517 views

WELL pseudo-random number generations

I've used MT19937 in a test harness to generate uniformly (unsigned) 32-bit [0, $2^{32}$- 1] values, based on the original Authors' mt19937.c implementation, to ...
Brett Hale's user avatar