Generating a random bit - lack of randomness in C rand()

后端 未结 4 1694
礼貌的吻别
礼貌的吻别 2020-11-30 14:13

I am using rand() to generate either 0 or 1 (rand() % 2). I am seeding it using the current time (srand(time(NULL))).

After mu

4条回答
  •  自闭症患者
    2020-11-30 14:39

    Well, You can use Algorithms for Mersenne Twister or WELL. The code for WELL is on here(I don't have enough reputations) http://i.stack.imgur.com/q6VPL.pngenter image description here

提交回复
热议问题