Hi,
Hopefully someone can help a wee bit. I'm attempting to convert a C# class into PHP, but I'm getting stuck on one line..
c# code:
int n = x + y * 57;
n = ( n << 13 ) ^ n;
return 1.0 - ((n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0;
returns 0.992571315728128
php code:
$n = $x + $y * 57;
$n = ( $n << 13 ) ^ $n ;
return 1 - ( ( $n * ( $n * $n * 15731 + 789221) + 1376312589 ) & 0x7fffffff ) / 1073741824;
returns 1
where x and y are 78.
Any ideas? I get lost when you start doing all this << >> ^ & rubbish! |