Date: 10/17/00
- Next message: sniper <email protected>: "[PHP-DEV] PHP 4.0 Bug #6926 Updated: Segfault in imap_open()"
- Previous message: chagenbu <email protected>: "[PHP-DEV] PHP 4.0 Bug #6928 Updated: No documentation of function parameter length restrictions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: a.schommer <email protected>
Operating system: Solaris 2.7
PHP version: 4.0.2
PHP Bug Type: Math related
Bug description: rand() gives range warnings over 15 bits
rand() should work on int, which is about 2 billion. But i get
Warning: rand(): Invalid range: 1000000..1032768 in /tmp/apa2/htdocs/admin/tst.php3 on line 1
For this code:
<? print rand (1000000, 1032768); ?>
(a result is given anyway)
Not the size, but the difference seems to matter: If it exceeds 2^15-1, the warning comes up:
<? print rand (1000000, 1032767); ?>
produces only a result
sizeof(int) really is 4.
So i don't think it's my fault.
-- Edit Bug report at: http://bugs.php.net/?id=7281&edit=1-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: sniper <email protected>: "[PHP-DEV] PHP 4.0 Bug #6926 Updated: Segfault in imap_open()"
- Previous message: chagenbu <email protected>: "[PHP-DEV] PHP 4.0 Bug #6928 Updated: No documentation of function parameter length restrictions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

