The old LCG (linear congruential generator) represents the best and simplest pseudo-random number generator algorithm. The main reason is that it is easy to understand, easy to implement, and fast.
The LCG algorithm is based on the formula:
X (n +
The random numbers we speak of actually imply pseudo random numbers. Many friends may think of the C language rand (), unfortunately, this function produces random number of randomness is very poor, and the speed is very slow, I believe almost not
Comparison between functions rand and mt_rand in PHP. PHP functions rand and mt_randmt_rand () are four times faster than rand (). The old libc random number generator has some uncertain and unknown features and is very slow. PHP rand () functions
PHP functions rand and mt_rand Mt_rand () is four times faster than rand () Many old libc random number generators have some uncertain and unknown features and are very slow. The rand () function of PHP uses the libc random number generator by
Mt_rand () is four times faster than rand (). many old libc random number generators have some uncertain and unknown features and are very slow. The rand () function of PHP uses the libc random number generator by default. The mt_rand () function is
Mt_rand () is four times times faster than Rand (), and many of the old libc random number generators have some uncertainties and unknown characteristics and are slow. The rand () function of PHP uses the libc random number generator by default. The
PHP Functions Rand and Mt_rand
Mt_rand () four times times faster than Rand ()
Many old libc random number generators have some uncertainties and unknown properties and are slow. The rand () function of PHP uses the libc random number
PHP functions rand and mt_rand
Mt_rand () is four times faster than rand ()
Many old libc random number generators have some uncertain and unknown features and are very slow. The rand () function of PHP uses the libc random number generator
Mt_rand () is four times faster than rand (). many old libc random number generators have some uncertain and unknown features and are very slow. The rand () function of PHP uses the libc random number generator by default. The mt_rand () function is
Mt_rand () is four times times faster than Rand (), and many of the old libc random number generators have some uncertainties and unknown characteristics and are slow. The rand () function of PHP uses the libc random number generator by default. The
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.