I want to get a random uint in C#, am I doing correctly?
Random ran;
a[i] = (uint)ran.Next(int.MaxValue); //random only gets to maxInt
if (ran.Next(2) == 1)
a[i] = (uint)(a[i] | (1 << 31));
Another thing that confuses me is that I can't write it as (uint)(a[i] | (uint)(1 << 31))
.