Convert Code to C#
<p>I was looking into random number generators and found pseudo code for one:</p>

<pre><code>function Noise1(integer x)
    x = (x&lt;&lt;13) ^ x;
    return ( 1.0 - ( (x * (x * x * 15731 + 789221) + 1376312589) &amp; 7fffffff) / 1073741824.0);    
end function
</code></pre>

<p>I would like to convert this into C# but I get all kinds of error like invalid expressions and ")" expected. This is what I have so far how can I convert it?</p>

<pre><code>double Noise(int x) {
    x = (x&lt;&lt;13) ^ x;
    return ( 1.0 - ((x * (x * x * 15731 + 789221) + 1376312589) &amp; 7fffffff) / 1073741824.0);
}
</code></pre>

<p>Thanks.</p>
