تفاوت rand و mt_rand

i-php-i

Active Member
توی منوال گفته شده که تابع mt_rand اعداد رندم بهتری نسبت به rand ایجاد می کنه. لطفا در این مورد توضیح بدید و بگید که چه تفاوتی بین نتیجه حاصل از این دو تابع وجود داره؟
 

ziXet

مدیر انجمن PHP/MYSQL
کد:
[LEFT]The mt_rand() function is a drop-in    replacement for this.  It uses a random number generator with    known characteristics using the [URL="http://www.math.sci.hiroshima-u.ac.jp/%7Em-mat/MT/emt.html"]»     Mersenne Twister[/URL], which will produce random numbers four times    faster than what the average libc rand() provides.   [/LEFT]
گفته 4 بار سریعتره!
 

جدیدترین ارسال ها

بالا