Understanding “randomness”

前端 未结 28 2454
轻奢々
轻奢々 2020-11-22 15:28

I can\'t get my head around this, which is more random?

rand()

OR:

rand() * rand()

I´m f

28条回答
  •  一生所求
    2020-11-22 16:12

    Multiplying numbers would end up in a smaller solution range depending on your computer architecture.

    If the display of your computer shows 16 digits rand() would be say 0.1234567890123 multiplied by a second rand(), 0.1234567890123, would give 0.0152415 something you'd definitely find fewer solutions if you'd repeat the experiment 10^14 times.

提交回复
热议问题