// Provides a pseudo-random decimal number uniformely spread // between 0 (included) and 1 (excluded). // // 0x204fce5dffffffffffffffff is the highest 96-bit integer number with the first 32-bits // set to 1, and less than 10E28. Thus, the highest decimal value which can be obtained // with is method is 0x204fce5dffffffffffffffff / 10E28 = 0.9999999995522011979606654975. private decimal RandomDecimal() { var data = new byte[8]; InnerGenerator.NextBytes(data); int lo = ToInt32(data, 0); int mid = ToInt32(data, 4); int hi = InnerGenerator.Next(0x204fce5d); return(new Decimal(lo, mid, hi, false, 28)); }
/// <inheritdoc/> protected override string GetNextString() { return(Values[InnerGenerator.Next(Values.Length)]); }
private double GetNextRandomValue() { return(Minimum.Value + InnerGenerator.NextDouble() * (Maximum.Value - Minimum.Value)); }
private int GetNextRandomValue() { return(InnerGenerator.Next(Minimum.Value, Maximum.Value)); }