05-20-2008, 12:08 AM
|
#6 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
OK, looks like there may be a rounding problem on your machine or version of PHP (mine's 5.2.5). Simply round the value rather than casting it to integer.
$rounds = round(log($players, 2)); // 6
As a fun check try: echo (int) 5.999999999999999; that's what PHP might be seeing rather than 6 as we expect.
|
|
|
|