Exemplo n.º 1
0
 internal double[] NextDoubleArray(int length)
 {
     if (length < 0)
     {
         throw new ArgumentOutOfRangeException(nameof(length), "Length must be greater than or equal to 0.");
     }
     double[] result = new double[length];
     for (var i = 0; i < length; i++)
     {
         result[i] = NumberFactory.MakeDouble(NextULong());
     }
     return(result);
 }
Exemplo n.º 2
0
 internal float[] NextFloatArray(int length)
 {
     if (length < 0)
     {
         throw new ArgumentOutOfRangeException(nameof(length), "Length must be greater than or equal to 0.");
     }
     float[] result = new float[length];
     for (var i = 0; i < length; i++)
     {
         result[i] = NumberFactory.MakeFloat(NextUInt());
     }
     return(result);
 }
Exemplo n.º 3
0
 internal uint NextUInt()
 {
     if (cachedIntSource)
     {
         cachedIntSource = false;
         return(NumberFactory.ExtractLow(intSource));
     }
     else
     {
         intSource       = NextULong();
         cachedIntSource = true;
         return(NumberFactory.ExtractHigh(intSource));
     }
 }
Exemplo n.º 4
0
 internal ushort NextUShort()
 {
     if (cachedShortSource)
     {
         cachedShortSource = false;
         return(NumberFactory.ExtractLow(shortSource));
     }
     else
     {
         shortSource       = NextUInt();
         cachedShortSource = true;
         return(NumberFactory.ExtractHigh(shortSource));
     }
 }
Exemplo n.º 5
0
 internal double NextDouble()
 {
     return(NumberFactory.MakeDouble(NextULong()));
 }
Exemplo n.º 6
0
 internal float NextFloat()
 {
     return(NumberFactory.MakeFloat(NextUInt()));
 }