How reliable is the Random function in Delphi

前端 未结 9 1301
遥遥无期
遥遥无期 2020-12-30 06:53

I am writing a program which write statistical tests in Delphi (must be Delphi) and I\'ve heard that the Random functionality is somewhat odd. You have to call randomize to

9条回答
  •  囚心锁ツ
    2020-12-30 07:10

    From the Embarcadero web site:

    _lrand is the long random number generator function. _rand uses a multiplicative congruential random number generator with period 2^64 to return successive pseudo-random numbers in the range from 0 to 2^31 - 1.

    The generator is reinitialized by calling srand with an argument value of 1. It can be set to a new starting point by calling srand with a given seed number.

提交回复
热议问题