diff --git a/FastRng/Double/ShapeFitter.cs b/FastRng/Double/ShapeFitter.cs index 1a9c34c..a0c9c43 100644 --- a/FastRng/Double/ShapeFitter.cs +++ b/FastRng/Double/ShapeFitter.cs @@ -36,8 +36,12 @@ namespace FastRng.Double { var nextNumber = await this.rng.GetUniform(token); var nextBucket = (int)Math.Floor(nextNumber * this.sampleSize); + // var firstInBucket = this.samples[nextBucket] == 0; this.samples[nextBucket] += this.probabilities[nextBucket]; + // if (firstInBucket) // TODO: Could be an option (optional) + // return nextNumber; + if (this.samples[nextBucket] >= this.threshold) { this.samples[nextBucket] -= this.threshold;