Was thinking of creating a random number generator which will support uint, long & ulong
. I got to making the random uint
generator but got stuck on making a min, max generator.
This is what i have
public class Rand : System.Random
public uint UInt32(uint min, uint max)
{
byte[] array = new byte[4];
base.NextBytes(array);
uint result = BitConverter.ToUInt32(array, 0);
if (result < min | result > max)
{
UInt32(min, max); //here i get a StackOverflowException
}
return result;
}
Why do i get a StackOverflowException
when trying to run the same method with the same parameters?