- Timestamp:
- 02/19/10 12:55:18 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Permutation/3.3/Tests/Random.cs
r2836 r2840 62 62 public int Next(int maxVal) { 63 63 if (nextIntIndex >= intNumbers.Length) throw new InvalidOperationException("Random: No more integer random numbers available"); 64 if (IntNumbers[nextIntIndex] >= maxVal) throw new InvalidOperationException("Random: Next integer random number (" + IntNumbers[nextIntIndex] + ") is >= " + maxVal); 64 65 return intNumbers[nextIntIndex++]; 65 66 } … … 67 68 public int Next(int minVal, int maxVal) { 68 69 if (nextIntIndex >= intNumbers.Length) throw new InvalidOperationException("Random: No more integer random numbers available"); 70 if (IntNumbers[nextIntIndex] < minVal || IntNumbers[nextIntIndex] >= maxVal) throw new InvalidOperationException("Random: Next integer random number (" + IntNumbers[nextIntIndex] + ") is not in the range [" + minVal + ";" + maxVal + ")"); 69 71 return intNumbers[nextIntIndex++]; 70 72 } … … 72 74 public double NextDouble() { 73 75 if (nextDoubleIndex >= doubleNumbers.Length) throw new InvalidOperationException("Random: No more double random numbers available"); 76 if (doubleNumbers[nextDoubleIndex] < 0.0 || doubleNumbers[nextDoubleIndex] >= 1.0) throw new InvalidOperationException("Random: Next double ranomd number (" + DoubleNumbers[nextDoubleIndex] + ") is not in the range [0;1)"); 74 77 return doubleNumbers[nextDoubleIndex++]; 75 78 }
Note: See TracChangeset
for help on using the changeset viewer.