我正在编写一个应该有点快的数值程序,而且也是多线程的。我有一个类表示一个数字,我想在其中使用一个随机数生成器。现在,我并不真的要求我的RNG是一个真正的RNG,我只需要它生成均匀分布在0到NMAX之间的整数。// use just an int here and forget about multithreading.// this will be called multithreadedly
static uint32 GetRand() { return rand = ( rand + 1 ) % N