Inconsistent pseudo random between c++ and c#
<p>I'm attempting to convert a pseudo rand function from c++ to c# but it doesnt seem to return the correct values. Its important that i use a consistent set for encryption so i cant just use a random number.</p>

<p>this is the function in c++.</p>

<pre><code>int get_pseudo_rand()
{
  return( ((_last_rand = _last_rand * 214013L
     + 2531011L) &gt;&gt; 16) &amp; 0x7fff );
}
</code></pre>

<p>and this is my c# alternative</p>

<pre><code>int get_pseudo_rand()
{
  return (((_last_rand = (_last_rand * 214013 + 2531011) &gt;&gt; 16) &amp; 0x7fff));
}
</code></pre>

<p>I removed the Ls since c#s int data type is 4 bytes like c++ longs whereas c#s longs are 8 bytes.</p>

<p>the first time the function is run from the seed the answer is consistent with the c++ version but then it begins to diverge.</p>

<p>Any ideas?</p>
