#27355 [Opn->Bgs]: rand() generates even-odd-even-odd numbers

From: Date: Mon, 23 Feb 2004 03:27:15 +0000
Subject: #27355 [Opn->Bgs]: rand() generates even-odd-even-odd numbers
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-55341@lists.php.net to get a copy of this message
ID: 27355 Updated by: sniper@php.net Reported By: chrisrogers at planetunreal dot com -Status: Open +Status: Bogus Bug Type: Math related Operating System: Windows PHP Version: 4.3.4 New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. This is already fixed in CVS.. Previous Comments: ------------------------------------------------------------------------ [2004-02-22 21:17:06] cjbj at hotmail dot com May be related to bug 27052 which I reproduced (with the same pattern too). ------------------------------------------------------------------------ [2004-02-22 15:25:20] chrisrogers at planetunreal dot com Description: ------------ The rand() function under Windows XP Pro and possibly other Windows OSs generates numbers in a strict even-odd-even-odd pattern. The pattern doesn't occur on *nix OSs Reproduce code: --------------- <?php for (i = 0; i < 100; i++) echo rand()."<br />\n"; ?> Expected result: ---------------- expected numbers with no noticable pattern Actual result: -------------- numbers were in an even-odd-even-odd pattern ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27355&edit=1

« previous php.bugs (#55341) next »