#27355 [NEW]: rand() generates even-odd-even-odd numbers
| From: | chrisrogers at planetunreal dot com | Date: | Sun, 22 Feb 2004 20:25:20 +0000 |
| Subject: | #27355 [NEW]: rand() generates even-odd-even-odd numbers | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-55323@lists.php.net to get a copy of this message | ||
From: chrisrogers at planetunreal dot com
Operating system: Windows
PHP version: 4.3.4
PHP Bug Type: Math related
Bug description: rand() generates even-odd-even-odd numbers
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 bug report at http://bugs.php.net/?id=27355&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27355&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27355&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27355&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27355&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27355&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27355&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27355&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27355&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27355&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27355&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27355&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27355&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27355&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27355&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27355&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27355&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27355&r=float