diff --git a/FastRng/Double/ShapeFitter.cs b/FastRng/Double/ShapeFitter.cs index 6e0fa1d..4b45ebd 100644 --- a/FastRng/Double/ShapeFitter.cs +++ b/FastRng/Double/ShapeFitter.cs @@ -36,7 +36,10 @@ namespace FastRng.Double this.samples[nextBucket] += this.probabilities[nextBucket]; if (this.samples[nextBucket] >= 1.0) + { + this.samples[nextBucket] = 0.0; return nextNumber; + } } } }