Added todo
This commit is contained in:
parent
4b97c44b1c
commit
9cb9fd911e
@ -36,8 +36,12 @@ namespace FastRng.Double
|
|||||||
{
|
{
|
||||||
var nextNumber = await this.rng.GetUniform(token);
|
var nextNumber = await this.rng.GetUniform(token);
|
||||||
var nextBucket = (int)Math.Floor(nextNumber * this.sampleSize);
|
var nextBucket = (int)Math.Floor(nextNumber * this.sampleSize);
|
||||||
|
// var firstInBucket = this.samples[nextBucket] == 0;
|
||||||
this.samples[nextBucket] += this.probabilities[nextBucket];
|
this.samples[nextBucket] += this.probabilities[nextBucket];
|
||||||
|
|
||||||
|
// if (firstInBucket) // TODO: Could be an option (optional)
|
||||||
|
// return nextNumber;
|
||||||
|
|
||||||
if (this.samples[nextBucket] >= this.threshold)
|
if (this.samples[nextBucket] >= this.threshold)
|
||||||
{
|
{
|
||||||
this.samples[nextBucket] -= this.threshold;
|
this.samples[nextBucket] -= this.threshold;
|
||||||
|
Loading…
Reference in New Issue
Block a user