Another 64-bit patch

This commit is contained in:
Shoghi Cervantes 2014-04-08 15:50:13 +02:00
parent 29ab53a46f
commit 731fbbc8d1

View File

@ -47,7 +47,7 @@ class Random{
* @param int $seed Integer to be used as seed. * @param int $seed Integer to be used as seed.
*/ */
public function setSeed($seed){ public function setSeed($seed){
$seed = crc32($seed) % 0x7fffffff; $seed = crc32($seed);
$this->x = $seed ^ 0x0badc0de; $this->x = $seed ^ 0x0badc0de;
$this->z = $seed ^ -123456789; $this->z = $seed ^ -123456789;
$this->y = $seed ^ 0x12345678; $this->y = $seed ^ 0x12345678;
@ -91,7 +91,7 @@ class Random{
* @return float * @return float
*/ */
public function nextFloat(){ public function nextFloat(){
return $this->nextInt() / 0x7FFFFFFF; return $this->nextInt() / 0x7fffffff;
} }
/** /**
@ -100,7 +100,7 @@ class Random{
* @return float * @return float
*/ */
public function nextSignedFloat(){ public function nextSignedFloat(){
return $this->nextSignedInt() / 0x7FFFFFFF; return $this->nextSignedInt() / 0x7fffffff;
} }
/** /**